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
refactor(connector): [Peach Payments] Authorize And Manual Capture Integration Update (#10143)
Anurag1b3bce0ae032
diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rsindex 37a35f19d5..02c018d021 100644--- a/crates/connector_configs/src/connector.rs+++ b/crates/connector_configs/src/connector.rs@@ -184,9 +184,7 @@ pub struct ConfigMetadata {pub account_id: Option<AccountIDSupportedMethods>,pub name: Option<InputData>,pub client_merchant_reference_id: Option<InputData>,- pub route: Option<InputData>,- pub mid: Option<InputData>,- pub tid: Option<InputData>,+ pub merchant_payment_method_route_id: Option<InputData>,pub site: Option<InputData>,}diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.tomlindex cb10b6f278..49ca8e73cb 100644--- a/crates/connector_configs/toml/development.toml+++ b/crates/connector_configs/toml/development.toml@@ -7196,116 +7196,12 @@ label="Client Merchant Reference Id"placeholder="Enter Client Merchant Reference Id"required=truetype="Text"-[peachpayments.metadata.name]-name="name"-label="Merchant Name"-placeholder="Enter Merchant Name"-required=true-type="Text"-[peachpayments.metadata.mcc]-name="mcc"-label="Merchant Category Code"-placeholder="Enter MCC (e.g., 5411)"-required=true-type="Text"-[peachpayments.metadata.merchant_phone]-name="merchant_phone"-label="Merchant Phone"-placeholder="Enter merchant phone (e.g., +27123456789)"-required=true-type="Text"-[peachpayments.metadata.merchant_email]-name="merchant_email"-label="Merchant Email"-placeholder="Enter merchant email"-required=true-type="Text"-[peachpayments.metadata.merchant_mobile]-name="merchant_mobile"-label="Merchant Mobile"-placeholder="Enter merchant mobile (e.g., +27123456789)"-required=true-type="Text"-[peachpayments.metadata.merchant_address]-name="merchant_address"-label="Merchant Address"-placeholder="Enter merchant address"-required=true-type="Text"-[peachpayments.metadata.merchant_city]-name="merchant_city"-label="Merchant City"-placeholder="Enter merchant city"+[peachpayments.metadata.merchant_payment_method_route_id]+name="merchant_payment_method_route_id"+label="Merchant Payment Method Route Id"+placeholder="Enter Merchant Payment Method Route Id"required=truetype="Text"-[peachpayments.metadata.merchant_postal_code]-name="merchant_postal_code"-label="Merchant Postal Code"-placeholder="Enter postal code"-required=true-type="Text"-[peachpayments.metadata.merchant_region_code]-name="merchant_region_code"-label="Merchant Region Code"-placeholder="Enter region code (e.g., WC)"-required=true-type="Text"-[peachpayments.metadata.merchant_type]-name="merchant_type"-label="Merchant Type"-placeholder="Select merchant type"-required=true-type="Select"-options=["direct", "sub"]-[peachpayments.metadata.merchant_website]-name="merchant_website"-label="Merchant Website"-placeholder="Enter merchant website URL"-required=true-type="Text"-[peachpayments.metadata.mid]-name="mid"-label="Routing MID"-placeholder="Enter routing MID"-required=true-type="Text"-[peachpayments.metadata.tid]-name="tid"-label="Routing TID"-placeholder="Enter routing TID"-required=true-type="Text"-[peachpayments.metadata.route]-name="route"-label="Routing Route"-placeholder="Select routing route"-required=true-type="Select"-options=["cardgateway_emulator", "exipay_emulator", "absa_base24", "nedbank_postbridge"]-[peachpayments.metadata.amex_id]-name="amex_id"-label="AmEx ID"-placeholder="Enter AmEx ID for routing"-required=false-type="Text"-[peachpayments.metadata.sub_mid]-name="sub_mid"-label="Sub Mid"-placeholder="Enter Sub Mid"-required=false-type="Text"-[peachpayments.metadata.visa_payment_facilitator_id]-name="visa_payment_facilitator_id"-label="Visa Payment Facilitator Id"-placeholder="Enter Visa Payment Facilitator Id"-required=false-type="Text"-[peachpayments.metadata.mastercard_payment_facilitator_id]-name="mastercard_payment_facilitator_id"-label="mastercard Payment Facilitator Id"-placeholder="Enter mastercard Payment Facilitator Id"-required=false-type="Text"[tokenex][tokenex.connector_auth.BodyKey]diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.tomlindex e59684032e..409db3b5fc 100644--- a/crates/connector_configs/toml/production.toml+++ b/crates/connector_configs/toml/production.toml@@ -5934,116 +5934,12 @@ label="Client Merchant Reference Id"placeholder="Enter Client Merchant Reference Id"required=truetype="Text"-[peachpayments.metadata.name]-name="name"-label="Merchant Name"-placeholder="Enter Merchant Name"+[peachpayments.metadata.merchant_payment_method_route_id]+name="merchant_payment_method_route_id"+label="Merchant Payment Method Route Id"+placeholder="Enter Merchant Payment Method Route Id"required=truetype="Text"-[peachpayments.metadata.mcc]-name="mcc"-label="Merchant Category Code"-placeholder="Enter MCC (e.g., 5411)"-required=true-type="Text"-[peachpayments.metadata.merchant_phone]-name="merchant_phone"-label="Merchant Phone"-placeholder="Enter merchant phone (e.g., +27123456789)"-required=true-type="Text"-[peachpayments.metadata.merchant_email]-name="merchant_email"-label="Merchant Email"-placeholder="Enter merchant email"-required=true-type="Text"-[peachpayments.metadata.merchant_mobile]-name="merchant_mobile"-label="Merchant Mobile"-placeholder="Enter merchant mobile (e.g., +27123456789)"-required=true-type="Text"-[peachpayments.metadata.merchant_address]-name="merchant_address"-label="Merchant Address"-placeholder="Enter merchant address"-required=true-type="Text"-[peachpayments.metadata.merchant_city]-name="merchant_city"-label="Merchant City"-placeholder="Enter merchant city"-required=true-type="Text"-[peachpayments.metadata.merchant_postal_code]-name="merchant_postal_code"-label="Merchant Postal Code"-placeholder="Enter postal code"-required=true-type="Text"-[peachpayments.metadata.merchant_region_code]-name="merchant_region_code"-label="Merchant Region Code"-placeholder="Enter region code (e.g., WC)"-required=true-type="Text"-[peachpayments.metadata.merchant_type]-name="merchant_type"-label="Merchant Type"-placeholder="Select merchant type"-required=true-type="Select"-options=["direct", "sub"]-[peachpayments.metadata.merchant_website]-name="merchant_website"-label="Merchant Website"-placeholder="Enter merchant website URL"-required=true-type="Text"-[peachpayments.metadata.mid]-name="mid"-label="Routing MID"-placeholder="Enter routing MID"-required=true-type="Text"-[peachpayments.metadata.tid]-name="tid"-label="Routing TID"-placeholder="Enter routing TID"-required=true-type="Text"-[peachpayments.metadata.route]-name="route"-label="Routing Route"-placeholder="Select routing route"-required=true-type="Select"-options=["cardgateway_emulator", "exipay_emulator", "absa_base24", "nedbank_postbridge"]-[peachpayments.metadata.amex_id]-name="amex_id"-label="AmEx ID"-placeholder="Enter AmEx ID for routing"-required=false-type="Text"-[peachpayments.metadata.sub_mid]-name="sub_mid"-label="Sub Mid"-placeholder="Enter Sub Mid"-required=false-type="Text"-[peachpayments.metadata.visa_payment_facilitator_id]-name="visa_payment_facilitator_id"-label="Visa Payment Facilitator Id"-placeholder="Enter Visa Payment Facilitator Id"-required=false-type="Text"-[peachpayments.metadata.mastercard_payment_facilitator_id]-name="mastercard_payment_facilitator_id"-label="mastercard Payment Facilitator Id"-placeholder="Enter mastercard Payment Facilitator Id"-required=false-type="Text"[tokenex][tokenex.connector_auth.HeaderKey]diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.tomlindex 15c3753aac..86de497c7e 100644--- a/crates/connector_configs/toml/sandbox.toml+++ b/crates/connector_configs/toml/sandbox.toml@@ -7172,116 +7172,12 @@ label="Client Merchant Reference Id"placeholder="Enter Client Merchant Reference Id"required=truetype="Text"-[peachpayments.metadata.name]-name="name"-label="Merchant Name"-placeholder="Enter Merchant Name"+[peachpayments.metadata.merchant_payment_method_route_id]+name="merchant_payment_method_route_id"+label="Merchant Payment Method Route Id"+placeholder="Enter Merchant Payment Method Route Id"required=truetype="Text"-[peachpayments.metadata.mcc]-name="mcc"-label="Merchant Category Code"-placeholder="Enter MCC (e.g., 5411)"-required=true-type="Text"-[peachpayments.metadata.merchant_phone]-name="merchant_phone"-label="Merchant Phone"-placeholder="Enter merchant phone (e.g., +27123456789)"-required=true-type="Text"-[peachpayments.metadata.merchant_email]-name="merchant_email"-label="Merchant Email"-placeholder="Enter merchant email"-required=true-type="Text"-[peachpayments.metadata.merchant_mobile]-name="merchant_mobile"-label="Merchant Mobile"-placeholder="Enter merchant mobile (e.g., +27123456789)"-required=true-type="Text"-[peachpayments.metadata.merchant_address]-name="merchant_address"-label="Merchant Address"-placeholder="Enter merchant address"-required=true-type="Text"-[peachpayments.metadata.merchant_city]-name="merchant_city"-label="Merchant City"-placeholder="Enter merchant city"-required=true-type="Text"-[peachpayments.metadata.merchant_postal_code]-name="merchant_postal_code"-label="Merchant Postal Code"-placeholder="Enter postal code"-required=true-type="Text"-[peachpayments.metadata.merchant_region_code]-name="merchant_region_code"-label="Merchant Region Code"-placeholder="Enter region code (e.g., WC)"-required=true-type="Text"-[peachpayments.metadata.merchant_type]-name="merchant_type"-label="Merchant Type"-placeholder="Select merchant type"-required=true-type="Select"-options=["direct", "sub"]-[peachpayments.metadata.merchant_website]-name="merchant_website"-label="Merchant Website"-placeholder="Enter merchant website URL"-required=true-type="Text"-[peachpayments.metadata.mid]-name="mid"-label="Routing MID"-placeholder="Enter routing MID"-required=true-type="Text"-[peachpayments.metadata.tid]-name="tid"-label="Routing TID"-placeholder="Enter routing TID"-required=true-type="Text"-[peachpayments.metadata.route]-name="route"-label="Routing Route"-placeholder="Select routing route"-required=true-type="Select"-options=["cardgateway_emulator", "exipay_emulator", "absa_base24", "nedbank_postbridge"]-[peachpayments.metadata.amex_id]-name="amex_id"-label="AmEx ID"-placeholder="Enter AmEx ID for routing"-required=false-type="Text"-[peachpayments.metadata.sub_mid]-name="sub_mid"-label="Sub Mid"-placeholder="Enter Sub Mid"-required=false-type="Text"-[peachpayments.metadata.visa_payment_facilitator_id]-name="visa_payment_facilitator_id"-label="Visa Payment Facilitator Id"-placeholder="Enter Visa Payment Facilitator Id"-required=false-type="Text"-[peachpayments.metadata.mastercard_payment_facilitator_id]-name="mastercard_payment_facilitator_id"-label="mastercard Payment Facilitator Id"-placeholder="Enter mastercard Payment Facilitator Id"-required=false-type="Text"[tokenex][tokenex.connector_auth.HeaderKey]diff --git a/crates/hyperswitch_connectors/src/connectors/peachpayments.rs b/crates/hyperswitch_connectors/src/connectors/peachpayments.rsindex 4c9111a727..d319f25b0b 100644--- a/crates/hyperswitch_connectors/src/connectors/peachpayments.rs+++ b/crates/hyperswitch_connectors/src/connectors/peachpayments.rs@@ -817,7 +817,7 @@ static PEACHPAYMENTS_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods});static PEACHPAYMENTS_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {- display_name: "Peachpayments",+ display_name: "Peach Payments",description: "The secure African payment gateway with easy integrations, 365-day support, and advanced orchestration.",connector_type: enums::HyperswitchConnectorCategory::PaymentGateway,integration_status: enums::ConnectorIntegrationStatus::Beta,diff --git a/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs b/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rsindex a4685a73ec..bd07f52c5e 100644--- a/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs@@ -101,7 +101,7 @@ pub struct CardOnFileData {#[serde(rename_all = "camelCase")]pub struct EcommerceCardPaymentOnlyTransactionData {pub merchant_information: MerchantInformation,- pub routing: Routing,+ pub routing_reference: RoutingReference,pub card: CardDetails,pub amount: AmountDetails,pub rrn: Option<String>,@@ -111,7 +111,7 @@ pub struct EcommerceCardPaymentOnlyTransactionData {#[serde(rename_all = "camelCase")]pub struct EcommerceNetworkTokenPaymentOnlyTransactionData {pub merchant_information: MerchantInformation,- pub routing: Routing,+ pub routing_reference: RoutingReference,pub network_token_data: NetworkTokenDetails,pub amount: AmountDetails,pub cof_data: CardOnFileData,@@ -128,26 +128,6 @@ pub enum EcommercePaymentOnlyTransactionData {#[serde(rename_all = "camelCase")]pub struct MerchantInformation {pub client_merchant_reference_id: Secret<String>,- pub name: Secret<String>,- pub mcc: Secret<String>,- #[serde(skip_serializing_if = "Option::is_none")]- pub phone: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub email: Option<pii::Email>,- #[serde(skip_serializing_if = "Option::is_none")]- pub mobile: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub address: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub city: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub postal_code: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub region_code: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub merchant_type: Option<MerchantType>,- #[serde(skip_serializing_if = "Option::is_none")]- pub website_url: Option<url::Url>,}#[derive(Debug, Serialize, Deserialize, PartialEq)]@@ -160,18 +140,8 @@ pub enum MerchantType {#[derive(Debug, Serialize, Deserialize, PartialEq)]#[serde(rename_all = "camelCase")]-pub struct Routing {- pub route: Route,- pub mid: Secret<String>,- pub tid: Secret<String>,- #[serde(skip_serializing_if = "Option::is_none")]- pub visa_payment_facilitator_id: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub master_card_payment_facilitator_id: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub sub_mid: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub amex_id: Option<Secret<String>>,+pub struct RoutingReference {+ pub merchant_payment_method_route_id: Secret<String>,}#[derive(Debug, Serialize, Deserialize, PartialEq)]@@ -416,37 +386,7 @@ impl TryFrom<&PaymentsCancelRouterData> for PeachpaymentsVoidRequest {#[derive(Debug, Serialize, Deserialize)]pub struct PeachPaymentsConnectorMetadataObject {pub client_merchant_reference_id: Secret<String>,- pub name: Secret<String>,- pub mcc: Secret<String>,- #[serde(skip_serializing_if = "Option::is_none")]- pub phone: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub email: Option<pii::Email>,- #[serde(skip_serializing_if = "Option::is_none")]- pub mobile: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub address: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub city: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub postal_code: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub region_code: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub merchant_type: Option<MerchantType>,- #[serde(skip_serializing_if = "Option::is_none")]- pub website_url: Option<url::Url>,- pub route: Route,- pub mid: Secret<String>,- pub tid: Secret<String>,- #[serde(skip_serializing_if = "Option::is_none")]- pub visa_payment_facilitator_id: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub master_card_payment_facilitator_id: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub sub_mid: Option<Secret<String>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub amex_id: Option<Secret<String>>,+ pub merchant_payment_method_route_id: Secret<String>,}impl TryFrom<&PeachpaymentsRouterData<&PaymentsAuthorizeRouterData>>@@ -493,29 +433,11 @@ impllet merchant_information = MerchantInformation {client_merchant_reference_id: connector_merchant_config.client_merchant_reference_id,- name: connector_merchant_config.name,- mcc: connector_merchant_config.mcc,- phone: connector_merchant_config.phone,- email: connector_merchant_config.email,- mobile: connector_merchant_config.mobile,- address: connector_merchant_config.address,- city: connector_merchant_config.city,- postal_code: connector_merchant_config.postal_code,- region_code: connector_merchant_config.region_code,- merchant_type: connector_merchant_config.merchant_type,- website_url: connector_merchant_config.website_url,};- // Get routing configuration from metadata- let routing = Routing {- route: connector_merchant_config.route,- mid: connector_merchant_config.mid,- tid: connector_merchant_config.tid,- visa_payment_facilitator_id: connector_merchant_config.visa_payment_facilitator_id,- master_card_payment_facilitator_id: connector_merchant_config- .master_card_payment_facilitator_id,- sub_mid: connector_merchant_config.sub_mid,- amex_id: connector_merchant_config.amex_id,+ let routing_reference = RoutingReference {+ merchant_payment_method_route_id: connector_merchant_config+ .merchant_payment_method_route_id,};let network_token_data = NetworkTokenDetails {@@ -542,7 +464,7 @@ impllet ecommerce_data = EcommercePaymentOnlyTransactionData::NetworkToken(EcommerceNetworkTokenPaymentOnlyTransactionData {merchant_information,- routing,+ routing_reference,network_token_data,amount,cof_data: CardOnFileData {@@ -581,29 +503,11 @@ impl TryFrom<(&PeachpaymentsRouterData<&PaymentsAuthorizeRouterData>, Card)>let merchant_information = MerchantInformation {client_merchant_reference_id: connector_merchant_config.client_merchant_reference_id,- name: connector_merchant_config.name,- mcc: connector_merchant_config.mcc,- phone: connector_merchant_config.phone,- email: connector_merchant_config.email,- mobile: connector_merchant_config.mobile,- address: connector_merchant_config.address,- city: connector_merchant_config.city,- postal_code: connector_merchant_config.postal_code,- region_code: connector_merchant_config.region_code,- merchant_type: connector_merchant_config.merchant_type,- website_url: connector_merchant_config.website_url,};- // Get routing configuration from metadata- let routing = Routing {- route: connector_merchant_config.route,- mid: connector_merchant_config.mid,- tid: connector_merchant_config.tid,- visa_payment_facilitator_id: connector_merchant_config.visa_payment_facilitator_id,- master_card_payment_facilitator_id: connector_merchant_config- .master_card_payment_facilitator_id,- sub_mid: connector_merchant_config.sub_mid,- amex_id: connector_merchant_config.amex_id,+ let routing_reference = RoutingReference {+ merchant_payment_method_route_id: connector_merchant_config+ .merchant_payment_method_route_id,};let card = CardDetails {@@ -623,7 +527,7 @@ impl TryFrom<(&PeachpaymentsRouterData<&PaymentsAuthorizeRouterData>, Card)>let ecommerce_data =EcommercePaymentOnlyTransactionData::Card(EcommerceCardPaymentOnlyTransactionData {merchant_information,- routing,+ routing_reference,card,amount,rrn: item.router_data.request.merchant_order_reference_id.clone(),