Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch into cypress-del…
Browse files Browse the repository at this point in the history
…ete-pm

* 'main' of github.com:juspay/hyperswitch:
  fix(connector): Update mandate PMT configs for Mandate Supported Connectors (#6903)
  fix(connector): [STRIPE] fix stripe mandate (#6899)
  • Loading branch information
pixincreate committed Dec 20, 2024
2 parents fb8a8e5 + 02f0824 commit 4a28603
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 80 deletions.
38 changes: 25 additions & 13 deletions config/deployments/integration_test.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,31 @@ payout_connector_list = "stripe,wise"
connectors_with_delayed_session_response = "trustpay,payme" # List of connectors which have delayed session response

[mandates.supported_payment_methods]
bank_debit.ach = { connector_list = "gocardless,adyen" } # Mandate supported payment method type and connector for bank_debit
bank_debit.becs = { connector_list = "gocardless" } # Mandate supported payment method type and connector for bank_debit
bank_debit.bacs = { connector_list = "adyen" } # Mandate supported payment method type and connector for bank_debit
bank_debit.sepa = { connector_list = "gocardless,adyen" } # Mandate supported payment method type and connector for bank_debit
card.credit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree" # Mandate supported payment method type and connector for card
card.debit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree" # Mandate supported payment method type and connector for card
pay_later.klarna.connector_list = "adyen" # Mandate supported payment method type and connector for pay_later
wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica" # Mandate supported payment method type and connector for wallets
wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica" # Mandate supported payment method type and connector for wallets
wallet.paypal.connector_list = "adyen" # Mandate supported payment method type and connector for wallets
bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay" # Mandate supported payment method type and connector for bank_redirect
bank_redirect.sofort.connector_list = "stripe,adyen,globalpay" # Mandate supported payment method type and connector for bank_redirect
bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay" # Mandate supported payment method type and connector for bank_redirect
bank_debit.ach = { connector_list = "gocardless,adyen,stripe" }
bank_debit.becs = { connector_list = "gocardless,stripe,adyen" }
bank_debit.bacs = { connector_list = "stripe,gocardless" }
bank_debit.sepa = { connector_list = "gocardless,adyen,stripe,deutschebank" }
card.credit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal"
card.debit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal"
pay_later.klarna.connector_list = "adyen"
wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica,nexinets,novalnet"
wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica,noon,globalpay,multisafepay,novalnet"
wallet.paypal.connector_list = "adyen,globalpay,nexinets,novalnet,paypal"
wallet.momo.connector_list = "adyen"
wallet.kakao_pay.connector_list = "adyen"
wallet.go_pay.connector_list = "adyen"
wallet.gcash.connector_list = "adyen"
wallet.dana.connector_list = "adyen"
wallet.twint.connector_list = "adyen"
wallet.vipps.connector_list = "adyen"

bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"
bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"
bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"
bank_redirect.bancontact_card.connector_list="adyen,stripe"
bank_redirect.trustly.connector_list="adyen"
bank_redirect.open_banking_uk.connector_list="adyen"
bank_redirect.eps.connector_list="globalpay,nexinets"

[mandates.update_mandate_supported]
card.credit = { connector_list = "cybersource" } # Update Mandate supported payment method type and connector for card
Expand Down
38 changes: 25 additions & 13 deletions config/deployments/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,31 @@ force_cookies = false
enabled = false

[mandates.supported_payment_methods]
bank_debit.ach = { connector_list = "gocardless,adyen" } # Mandate supported payment method type and connector for bank_debit
bank_debit.becs = { connector_list = "gocardless" } # Mandate supported payment method type and connector for bank_debit
bank_debit.bacs = { connector_list = "adyen" } # Mandate supported payment method type and connector for bank_debit
bank_debit.sepa = { connector_list = "gocardless,adyen" } # Mandate supported payment method type and connector for bank_debit
card.credit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree" # Mandate supported payment method type and connector for card
card.debit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree" # Mandate supported payment method type and connector for card
pay_later.klarna.connector_list = "adyen" # Mandate supported payment method type and connector for pay_later
wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica" # Mandate supported payment method type and connector for wallets
wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica" # Mandate supported payment method type and connector for wallets
wallet.paypal.connector_list = "adyen" # Mandate supported payment method type and connector for wallets
bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay" # Mandate supported payment method type and connector for bank_redirect
bank_redirect.sofort.connector_list = "stripe,adyen,globalpay" # Mandate supported payment method type and connector for bank_redirect
bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay" # Mandate supported payment method type and connector for bank_redirect
bank_debit.ach = { connector_list = "gocardless,adyen,stripe" }
bank_debit.becs = { connector_list = "gocardless,stripe,adyen" }
bank_debit.bacs = { connector_list = "stripe,gocardless" }
bank_debit.sepa = { connector_list = "gocardless,adyen,stripe,deutschebank" }
card.credit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal"
card.debit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal"
pay_later.klarna.connector_list = "adyen"
wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica,nexinets,novalnet"
wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica,noon,globalpay,multisafepay,novalnet"
wallet.paypal.connector_list = "adyen,globalpay,nexinets,novalnet,paypal"
wallet.momo.connector_list = "adyen"
wallet.kakao_pay.connector_list = "adyen"
wallet.go_pay.connector_list = "adyen"
wallet.gcash.connector_list = "adyen"
wallet.dana.connector_list = "adyen"
wallet.twint.connector_list = "adyen"
wallet.vipps.connector_list = "adyen"

bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"
bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"
bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"
bank_redirect.bancontact_card.connector_list="adyen,stripe"
bank_redirect.trustly.connector_list="adyen"
bank_redirect.open_banking_uk.connector_list="adyen"
bank_redirect.eps.connector_list="globalpay,nexinets"

[mandates.update_mandate_supported]
card.credit = { connector_list = "cybersource" } # Update Mandate supported payment method type and connector for card
Expand Down
38 changes: 25 additions & 13 deletions config/deployments/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,31 @@ force_cookies = false
enabled = true

[mandates.supported_payment_methods]
bank_debit.ach = { connector_list = "gocardless,adyen" } # Mandate supported payment method type and connector for bank_debit
bank_debit.becs = { connector_list = "gocardless" } # Mandate supported payment method type and connector for bank_debit
bank_debit.bacs = { connector_list = "adyen" } # Mandate supported payment method type and connector for bank_debit
bank_debit.sepa = { connector_list = "gocardless,adyen" } # Mandate supported payment method type and connector for bank_debit
card.credit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree" # Mandate supported payment method type and connector for card
card.debit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree" # Mandate supported payment method type and connector for card
pay_later.klarna.connector_list = "adyen" # Mandate supported payment method type and connector for pay_later
wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica" # Mandate supported payment method type and connector for wallets
wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica" # Mandate supported payment method type and connector for wallets
wallet.paypal.connector_list = "adyen" # Mandate supported payment method type and connector for wallets
bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay" # Mandate supported payment method type and connector for bank_redirect
bank_redirect.sofort.connector_list = "stripe,adyen,globalpay" # Mandate supported payment method type and connector for bank_redirect
bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay" # Mandate supported payment method type and connector for bank_redirect
bank_debit.ach = { connector_list = "gocardless,adyen,stripe" }
bank_debit.becs = { connector_list = "gocardless,stripe,adyen" }
bank_debit.bacs = { connector_list = "stripe,gocardless" }
bank_debit.sepa = { connector_list = "gocardless,adyen,stripe,deutschebank" }
card.credit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal"
card.debit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal"
pay_later.klarna.connector_list = "adyen"
wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica,nexinets,novalnet"
wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica,noon,globalpay,multisafepay,novalnet"
wallet.paypal.connector_list = "adyen,globalpay,nexinets,novalnet,paypal"
wallet.momo.connector_list = "adyen"
wallet.kakao_pay.connector_list = "adyen"
wallet.go_pay.connector_list = "adyen"
wallet.gcash.connector_list = "adyen"
wallet.dana.connector_list = "adyen"
wallet.twint.connector_list = "adyen"
wallet.vipps.connector_list = "adyen"

bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"
bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"
bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"
bank_redirect.bancontact_card.connector_list="adyen,stripe"
bank_redirect.trustly.connector_list="adyen"
bank_redirect.open_banking_uk.connector_list="adyen"
bank_redirect.eps.connector_list="globalpay,nexinets"

[mandates.update_mandate_supported]
card.credit = { connector_list = "cybersource" } # Update Mandate supported payment method type and connector for card
Expand Down
38 changes: 25 additions & 13 deletions config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -614,19 +614,31 @@ connectors_with_delayed_session_response = "trustpay,payme"
connectors_with_webhook_source_verification_call = "paypal"

[mandates.supported_payment_methods]
pay_later.klarna = { connector_list = "adyen" }
wallet.google_pay = { connector_list = "stripe,adyen,cybersource,bankofamerica" }
wallet.apple_pay = { connector_list = "stripe,adyen,cybersource,noon,bankofamerica" }
wallet.paypal = { connector_list = "adyen" }
card.credit = { connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,fiuu" }
card.debit = { connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,fiuu" }
bank_debit.ach = { connector_list = "gocardless,adyen" }
bank_debit.becs = { connector_list = "gocardless" }
bank_debit.bacs = { connector_list = "adyen" }
bank_debit.sepa = { connector_list = "gocardless,adyen" }
bank_redirect.ideal = { connector_list = "stripe,adyen,globalpay,multisafepay" }
bank_redirect.sofort = { connector_list = "stripe,adyen,globalpay" }
bank_redirect.giropay = { connector_list = "adyen,globalpay,multisafepay" }
bank_debit.ach = { connector_list = "gocardless,adyen,stripe" }
bank_debit.becs = { connector_list = "gocardless,stripe,adyen" }
bank_debit.bacs = { connector_list = "stripe,gocardless" }
bank_debit.sepa = { connector_list = "gocardless,adyen,stripe,deutschebank" }
card.credit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal"
card.debit.connector_list = "stripe,adyen,authorizedotnet,cybersource,globalpay,worldpay,multisafepay,nmi,nexinets,noon,bankofamerica,braintree,nuvei,payme,wellsfargo,bamboraapac,elavon,fiuu,nexixpay,novalnet,paybox,paypal"
pay_later.klarna.connector_list = "adyen"
wallet.apple_pay.connector_list = "stripe,adyen,cybersource,noon,bankofamerica,nexinets,novalnet"
wallet.google_pay.connector_list = "stripe,adyen,cybersource,bankofamerica,noon,globalpay,multisafepay,novalnet"
wallet.paypal.connector_list = "adyen,globalpay,nexinets,novalnet,paypal"
wallet.momo.connector_list = "adyen"
wallet.kakao_pay.connector_list = "adyen"
wallet.go_pay.connector_list = "adyen"
wallet.gcash.connector_list = "adyen"
wallet.dana.connector_list = "adyen"
wallet.twint.connector_list = "adyen"
wallet.vipps.connector_list = "adyen"

bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"
bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"
bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"
bank_redirect.bancontact_card.connector_list="adyen,stripe"
bank_redirect.trustly.connector_list="adyen"
bank_redirect.open_banking_uk.connector_list="adyen"
bank_redirect.eps.connector_list="globalpay,nexinets"

[mandates.update_mandate_supported]
card.credit = { connector_list = "cybersource" }
Expand Down
15 changes: 12 additions & 3 deletions crates/router/src/connector/stripe/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,13 @@ impl TryFrom<(&types::PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntent
};
let mut payment_method_options = None;

let (mut payment_data, payment_method, billing_address, payment_method_types) = {
let (
mut payment_data,
payment_method,
billing_address,
payment_method_types,
setup_future_usage,
) = {
match item
.request
.mandate_id
Expand All @@ -1717,6 +1723,7 @@ impl TryFrom<(&types::PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntent
connector_mandate_ids.get_connector_mandate_id(),
StripeBillingAddress::default(),
get_payment_method_type_for_saved_payment_method_payment(item)?,
None,
),
Some(api_models::payments::MandateReferenceId::NetworkMandateId(
network_transaction_id,
Expand Down Expand Up @@ -1782,9 +1789,10 @@ impl TryFrom<(&types::PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntent
None,
StripeBillingAddress::default(),
None,
None,
)
}
_ => {
Some(api_models::payments::MandateReferenceId::NetworkTokenWithNTI(_)) | None => {
let (payment_method_data, payment_method_type, billing_address) =
create_stripe_payment_method(
&item.request.payment_method_data,
Expand All @@ -1806,6 +1814,7 @@ impl TryFrom<(&types::PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntent
None,
billing_address,
payment_method_type,
item.request.setup_future_usage,
)
}
}
Expand Down Expand Up @@ -1969,7 +1978,7 @@ impl TryFrom<(&types::PaymentsAuthorizeRouterData, MinorUnit)> for PaymentIntent
customer,
setup_mandate_details,
off_session: item.request.off_session,
setup_future_usage: item.request.setup_future_usage,
setup_future_usage,
payment_method_types,
expand: Some(ExpandableObjects::LatestCharge),
browser_info,
Expand Down
Loading

0 comments on commit 4a28603

Please sign in to comment.