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): [deutsche bank] add support for sepa one-off payments (#6246)

chikke srujan4e07fe9e8a8c
diff --git a/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs b/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
index 30b1d65134..e4b011f620 100644
--- a/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
@@ -146,7 +146,9 @@ impl TryFrom<&DeutschebankRouterData<&PaymentsAuthorizeRouterData>>
.and_then(|mandate_id| mandate_id.mandate_reference_id)
{
None => {
- if item.router_data.request.is_mandate_payment() {
+ // To facilitate one-off payments via SEPA with Deutsche Bank, we are considering not storing the connector mandate ID in our system if future usage is on-session.
+ // We will only check for customer acceptance to make a one-off payment. we will be storing the connector mandate details only when setup future usage is off-session.
+ if item.router_data.request.customer_acceptance.is_some() {
match item.router_data.request.payment_method_data.clone() {
PaymentMethodData::BankDebit(BankDebitData::SepaBankDebit {
iban, ..
@@ -167,7 +169,7 @@ impl TryFrom<&DeutschebankRouterData<&PaymentsAuthorizeRouterData>>
}
} else {
Err(errors::ConnectorError::MissingRequiredField {
- field_name: "setup_future_usage or customer_acceptance.acceptance_type",
+ field_name: "customer_acceptance",
}
.into())
}
@@ -304,25 +306,29 @@ impl
("signed_on".to_string(), signed_on.clone()),
]),
}),
- mandate_reference: Some(MandateReference {
- connector_mandate_id: item.response.mandate_id,
- payment_method_id: None,
- mandate_metadata: Some(serde_json::json!(DeutschebankMandateMetadata {
- account_holder: item.data.get_billing_address()?.get_full_name()?,
- iban: match item.data.request.payment_method_data.clone() {
- PaymentMethodData::BankDebit(BankDebitData::SepaBankDebit {
- iban,
- ..
- }) => Ok(Secret::from(iban.peek().replace(" ", ""))),
- _ => Err(errors::ConnectorError::MissingRequiredField {
- field_name:
- "payment_method_data.bank_debit.sepa_bank_debit.iban"
- }),
- }?,
- reference: Secret::from(reference),
- signed_on,
- })),
- }),
+ mandate_reference: if item.data.request.is_mandate_payment() {
+ Some(MandateReference {
+ connector_mandate_id: item.response.mandate_id,
+ payment_method_id: None,
+ mandate_metadata: Some(serde_json::json!(DeutschebankMandateMetadata {
+ account_holder: item.data.get_billing_address()?.get_full_name()?,
+ iban: match item.data.request.payment_method_data.clone() {
+ PaymentMethodData::BankDebit(BankDebitData::SepaBankDebit {
+ iban,
+ ..
+ }) => Ok(Secret::from(iban.peek().replace(" ", ""))),
+ _ => Err(errors::ConnectorError::MissingRequiredField {
+ field_name:
+ "payment_method_data.bank_debit.sepa_bank_debit.iban"
+ }),
+ }?,
+ reference: Secret::from(reference.clone()),
+ signed_on,
+ })),
+ })
+ } else {
+ None
+ },
connector_metadata: None,
network_txn_id: None,
connector_response_reference_id: None,