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
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(connector): [Elavon PG] create shopper and stored card through UCS (#15145)
Tushar Shuklaf31398fe37dd
diff --git a/config/config.example.toml b/config/config.example.tomlindex e8c4a9d191..7c09a301e8 100644--- a/config/config.example.toml+++ b/config/config.example.toml@@ -711,6 +711,7 @@ gocardless = { long_lived_token = true, payment_method = "bank_debit" }billwerk = { long_lived_token = false, payment_method = "card" }globalpay = { long_lived_token = false, payment_method = "card", flow = "mandates" }dwolla = { long_lived_token = true, payment_method = "bank_debit" }+elavon_pg = { long_lived_token = false, payment_method = "card", flow = "mandates" }[debit_routing_config] # Debit Routing configssupported_currencies = "USD" # Supported currencies for debit routingdiff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.tomlindex d7259a7283..3f513d82e8 100644--- a/config/deployments/integration_test.toml+++ b/config/deployments/integration_test.toml@@ -1042,6 +1042,7 @@ globalpay = { long_lived_token = false, payment_method = "card", flow = "mandatedwolla = { long_lived_token = true, payment_method = "bank_debit" }finix= { long_lived_token = false, payment_method = "card,wallet" }paysafe= { long_lived_token = false, payment_method = "card,wallet" ,payment_method_type = { type = "enable_only", list = "apple_pay,google_pay,credit,debit"},allowed_card_authentication_type= "no_three_ds", apple_pay_pre_decrypt_flow = "connector_tokenization", google_pay_pre_decrypt_flow = "connector_tokenization"}+elavon_pg = { long_lived_token = false, payment_method = "card", flow = "mandates" }[webhooks]outgoing_enabled = truediff --git a/config/deployments/production.toml b/config/deployments/production.tomlindex 1b7d9c3ae3..596bd19ff9 100644--- a/config/deployments/production.toml+++ b/config/deployments/production.toml@@ -1057,6 +1057,7 @@ globalpay = { long_lived_token = false, payment_method = "card", flow = "mandatedwolla = { long_lived_token = true, payment_method = "bank_debit" }finix= { long_lived_token = false, payment_method = "card,wallet" }paysafe= { long_lived_token = false, payment_method = "card,wallet" ,payment_method_type = { type = "enable_only", list = "apple_pay,google_pay,credit,debit"},allowed_card_authentication_type= "no_three_ds", apple_pay_pre_decrypt_flow = "connector_tokenization", google_pay_pre_decrypt_flow = "connector_tokenization"}+elavon_pg = { long_lived_token = false, payment_method = "card", flow = "mandates" }[webhooks]outgoing_enabled = truediff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.tomlindex b747d69b20..beb60e753d 100644--- a/config/deployments/sandbox.toml+++ b/config/deployments/sandbox.toml@@ -1061,6 +1061,7 @@ globalpay = { long_lived_token = false, payment_method = "card", flow = "mandatedwolla = { long_lived_token = true, payment_method = "bank_debit" }finix= { long_lived_token = false, payment_method = "card,wallet" }paysafe= { long_lived_token = false, payment_method = "card,wallet" ,payment_method_type = { type = "enable_only", list = "apple_pay,google_pay,credit,debit"},allowed_card_authentication_type= "no_three_ds", apple_pay_pre_decrypt_flow = "connector_tokenization", google_pay_pre_decrypt_flow = "connector_tokenization"}+elavon_pg = { long_lived_token = false, payment_method = "card", flow = "mandates" }[webhooks]outgoing_enabled = truediff --git a/config/development.toml b/config/development.tomlindex 703c63f183..d15c599714 100644--- a/config/development.toml+++ b/config/development.toml@@ -1298,6 +1298,7 @@ dwolla = { long_lived_token = true, payment_method = "bank_debit" }globalpay = { long_lived_token = false, payment_method = "card", flow = "mandates" }finix= { long_lived_token = false, payment_method = "card,wallet" }paysafe= { long_lived_token = false, payment_method = "card,wallet" ,payment_method_type = { type = "enable_only", list = "apple_pay,google_pay,credit,debit"},allowed_card_authentication_type= "no_three_ds", apple_pay_pre_decrypt_flow = "connector_tokenization", google_pay_pre_decrypt_flow = "connector_tokenization"}+elavon_pg = { long_lived_token = false, payment_method = "card", flow = "mandates" }[temp_locker_enable_config]saferpay = { payment_method = "card" }diff --git a/config/docker_compose.toml b/config/docker_compose.tomlindex 8a2e0819db..05a6a66b7c 100644--- a/config/docker_compose.toml+++ b/config/docker_compose.toml@@ -597,6 +597,7 @@ globalpay = { long_lived_token = false, payment_method = "card", flow = "mandatedwolla = { long_lived_token = true, payment_method = "bank_debit" }finix= { long_lived_token = false, payment_method = "card,wallet" }paysafe= { long_lived_token = false, payment_method = "card,wallet" ,payment_method_type = { type = "enable_only", list = "apple_pay,google_pay,credit,debit"},allowed_card_authentication_type= "no_three_ds", apple_pay_pre_decrypt_flow = "connector_tokenization", google_pay_pre_decrypt_flow = "connector_tokenization"}+elavon_pg = { long_lived_token = false, payment_method = "card", flow = "mandates" }[temp_locker_enable_config]saferpay = { payment_method = "card" }diff --git a/crates/hyperswitch_connectors/src/connectors/elavon_pg.rs b/crates/hyperswitch_connectors/src/connectors/elavon_pg.rsindex f564b16956..2a7450774b 100644--- a/crates/hyperswitch_connectors/src/connectors/elavon_pg.rs+++ b/crates/hyperswitch_connectors/src/connectors/elavon_pg.rs@@ -14,8 +14,8 @@//! Scope: card one-time payments (non-3DS and external-3DS passthrough). Elavon//! Payment Gateway's direct API performs no gateway-driven redirect authentication,//! so there is no redirect and no complete-authorize leg.-//! Mandates: cards and pre-decrypted Apple Pay / Google Pay open one with a CIT, and cards-//! also with a zero-amount setup. No bank transfers, no BNPL.+//! Mandates and MIT, and the flows that create a shopper and a stored card, run in UCS. No bank+//! transfers, no BNPL.pub mod transformers;@@ -650,9 +650,8 @@ static ELAVON_PG_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =enums::PaymentMethod::Card,enums::PaymentMethodType::Credit,PaymentMethodDetails {- // Recurring cards: the initial sale opens a stored-credential agreement- // and each repeat is a merchant-initiated sale replaying EPG's- // `credentialOnFileData`. Refunds and refund sync are implemented in UCS+ // Recurring cards: the card is saved as an EPG stored card and each repeat is+ // a merchant-initiated sale on it. Refunds and refund sync are implemented in UCS// (`POST /transactions` with `type: "refund"`, read back from// `/transactions/{id}`).mandates: enums::FeatureStatus::Supported,@@ -680,9 +679,8 @@ static ELAVON_PG_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =enums::PaymentMethod::Card,enums::PaymentMethodType::Debit,PaymentMethodDetails {- // Recurring cards: the initial sale opens a stored-credential agreement- // and each repeat is a merchant-initiated sale replaying EPG's- // `credentialOnFileData`. Refunds and refund sync are implemented in UCS+ // Recurring cards: the card is saved as an EPG stored card and each repeat is+ // a merchant-initiated sale on it. Refunds and refund sync are implemented in UCS// (`POST /transactions` with `type: "refund"`, read back from// `/transactions/{id}`).mandates: enums::FeatureStatus::Supported,@@ -811,4 +809,33 @@ impl ConnectorSpecifications for ElavonPg {| api::CurrentFlowInfo::ConnectorWebhookRegister { .. } => false,}}++ /// Elavon PG keeps a saved card as a stored card, which has to belong to a shopper. A+ /// merchant-initiated charge uses the stored card it already has, so only the payment that+ /// saves the card creates one.+ #[cfg(feature = "v1")]+ fn should_call_connector_customer(+ &self,+ payment_attempt: &hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,+ ) -> api::ConnectorCustomerAction {+ if matches!(+ payment_attempt.setup_future_usage_applied,+ Some(enums::FutureUsage::OffSession)+ ) && payment_attempt.customer_acceptance.is_some()+ && matches!(+ payment_attempt.payment_method,+ Some(enums::PaymentMethod::Card)+ )+ {+ api::ConnectorCustomerAction::CallConnectorCustomer+ } else {+ api::ConnectorCustomerAction::NoAction+ }+ }++ /// A zero-amount setup is itself the call that creates the stored card, so it needs the+ /// card rather than a token.+ fn should_call_tokenization_before_setup_mandate(&self) -> bool {+ false+ }}diff --git a/loadtest/config/development.toml b/loadtest/config/development.tomlindex 4cd488cca0..4eb8241bb9 100644--- a/loadtest/config/development.toml+++ b/loadtest/config/development.toml@@ -840,6 +840,7 @@ billwerk = { long_lived_token = false, payment_method = "card" }globalpay = { long_lived_token = false, payment_method = "card", flow = "mandates" }dwolla = { long_lived_token = true, payment_method = "bank_debit" }datatrans = { long_lived_token = false, payment_method = "wallet", payment_method_type = { type = "enable_only", list = "google_pay" } }+elavon_pg = { long_lived_token = false, payment_method = "card", flow = "mandates" }[connector_customer]payout_connector_list = "nomupay,wise"