Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(connector): [Payme] Fix for partial capture validation (#1939)

Arjun Karthik3d62cb07dd94
diff --git a/crates/router/src/connector/payme/transformers.rs b/crates/router/src/connector/payme/transformers.rs
index 9799130415..fd2121ac81 100644
--- a/crates/router/src/connector/payme/transformers.rs
+++ b/crates/router/src/connector/payme/transformers.rs
@@ -551,6 +551,12 @@ pub struct PaymentCaptureRequest {
impl TryFrom<&types::PaymentsCaptureRouterData> for PaymentCaptureRequest {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(item: &types::PaymentsCaptureRouterData) -> Result<Self, Self::Error> {
+ if item.request.amount_to_capture != item.request.payment_amount {
+ Err(errors::ConnectorError::NotSupported {
+ message: "Partial Capture".to_string(),
+ connector: "Payme",
+ })?
+ }
Ok(Self {
payme_sale_id: item.request.connector_transaction_id.clone(),
sale_price: item.request.amount_to_capture,