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

feat(router): [stripe connect] prevent creation of payment method for afterpay clearpay (#11051)

AkshayaFoiger82ec658df903
diff --git a/.github/workflows/CI-pr.yml b/.github/workflows/CI-pr.yml
index ec1bc0141e..887fe97853 100644
--- a/.github/workflows/CI-pr.yml
+++ b/.github/workflows/CI-pr.yml
@@ -263,6 +263,8 @@ jobs:
- name: Run cargo clippy with v2 features enabled
shell: bash
+ env:
+ CARGO_BUILD_JOBS: 3
run: just clippy_v2
- name: Run cargo check enabling only the release and v2 features
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index 88e5786cc7..03f8190c8b 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -216,7 +216,7 @@ payout_connector_list = "nomupay,stripe,wise"
connectors_with_delayed_session_response = "trustpay,payme" # List of connectors which have delayed session response
[save_payment_method_on_session.unsupported_payment_methods]
-pay_later = "klarna,affirm"
+pay_later = "klarna,affirm,afterpay_clearpay"
[zero_mandates.supported_payment_methods]
bank_debit.ach = { connector_list = "gocardless,adyen,payload" }
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index 8ecb737a28..d97eedc10a 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -185,7 +185,7 @@ netcetera.base_url = "https://{{merchant_endpoint_prefix}}.3ds-server.prod.netce
connectors_with_delayed_session_response = "trustpay,payme" # List of connectors which have delayed session response
[save_payment_method_on_session.unsupported_payment_methods]
-pay_later = "klarna,affirm"
+pay_later = "klarna,affirm,afterpay_clearpay"
[dummy_connector]
enabled = false # Whether dummy connector is enabled or not
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 34d269c5db..857086935a 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -185,7 +185,7 @@ netcetera.base_url = "https://{{merchant_endpoint_prefix}}.3ds-server.prev.netce
connectors_with_delayed_session_response = "trustpay,payme" # List of connectors which have delayed session response
[save_payment_method_on_session.unsupported_payment_methods]
-pay_later = "klarna,affirm"
+pay_later = "klarna,affirm,afterpay_clearpay"
[dummy_connector]
enabled = true # Whether dummy connector is enabled or not
diff --git a/config/development.toml b/config/development.toml
index 75853964e7..841a3159fb 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -1110,7 +1110,7 @@ discord_invite_url = "https://discord.gg/wJZ7DVW8mm"
connectors_with_delayed_session_response = "trustpay,payme"
[save_payment_method_on_session.unsupported_payment_methods]
-pay_later = "klarna,affirm"
+pay_later = "klarna,affirm,afterpay_clearpay"
[webhook_source_verification_call]
connectors_with_webhook_source_verification_call = "paypal"
diff --git a/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs b/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
index 6bce7add23..77c4f582b3 100644
--- a/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
@@ -1104,6 +1104,7 @@ fn validate_and_get_setup_future_usage(
) -> Result<Option<common_enums::FutureUsage>, error_stack::Report<ConnectorError>> {
match payment_method_type {
Some(common_enums::PaymentMethodType::Affirm)
+ | Some(common_enums::PaymentMethodType::AfterpayClearpay)
| Some(common_enums::PaymentMethodType::Klarna) => Ok(None),
Some(_) | None => Ok(setup_future_usage),
}