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): add Worldpay Raft ucs only connector (#13742)
Shubhodip palb9c17f1fee93
diff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.jsonindex 3a65ef1643..e140d8229d 100644--- a/api-reference/v1/openapi_spec_v1.json+++ b/api-reference/v1/openapi_spec_v1.json@@ -17437,6 +17437,7 @@"wise","worldline","worldpay",+ "worldpayraft","worldpayvantiv","worldpayxml","worldpaymodular",@@ -42220,6 +42221,7 @@"worldline","worldpay","worldpaymodular",+ "worldpayraft","worldpayvantiv","worldpayxml","xendit",diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.jsonindex 94bc04de13..e14ed7e375 100644--- a/api-reference/v2/openapi_spec_v2.json+++ b/api-reference/v2/openapi_spec_v2.json@@ -11565,6 +11565,7 @@"wise","worldline","worldpay",+ "worldpayraft","worldpayvantiv","worldpayxml","worldpaymodular",@@ -30061,6 +30062,7 @@"worldline","worldpay","worldpaymodular",+ "worldpayraft","worldpayvantiv","worldpayxml","xendit",diff --git a/config/config.example.toml b/config/config.example.tomlindex 75a55a237b..fdfdcfca02 100644--- a/config/config.example.toml+++ b/config/config.example.toml@@ -434,6 +434,7 @@ wise.base_url = "https://api.wise-sandbox.com/"worldline.base_url = "https://eu.sandbox.api-ingenico.com/"worldpay.base_url = "https://try.access.worldpay.com/"worldpaymodular.base_url = "https://try.access.worldpay.com/"+worldpayraft.base_url = "https://ws-cert.vantiv.com/merchant/servicing/apitransactions/NativeRaftApi/v1"worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"@@ -1440,7 +1441,7 @@ diff_count_threshold = 100 # Non-volume routing diffs per profile within the coubase_url = "http://localhost:8000" # Unified Connector Service Base URLconnection_timeout = 10 # Connection Timeout Duration in Secondsrequest_timeout = 35 # Per-RPC Request Timeout in Seconds-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call[grpc_client.recovery_decider_client] # Revenue recovery client base urldiff --git a/config/deployments/env_specific.toml b/config/deployments/env_specific.tomlindex 0238b3a13b..57b0581fba 100644--- a/config/deployments/env_specific.toml+++ b/config/deployments/env_specific.toml@@ -453,7 +453,7 @@ payment_method = "payment_method_types" # <payment_method> = comma-separated clobase_url = "http://localhost:8000" # Unified Connector Service Base URLconnection_timeout = 10 # Connection Timeout Duration in Secondsrequest_timeout = 35 # Per-RPC Request Timeout in Seconds-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, tesouro, citigate, ilixium, moneris, elavon" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call[revenue_recovery]diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.tomlindex 641015bdef..979f25eee2 100644--- a/config/deployments/integration_test.toml+++ b/config/deployments/integration_test.toml@@ -181,6 +181,7 @@ wise.base_url = "https://api.wise-sandbox.com/"worldline.base_url = "https://eu.sandbox.api-ingenico.com/"worldpay.base_url = "https://try.access.worldpay.com/"worldpaymodular.base_url = "https://try.access.worldpay.com/"+worldpayraft.base_url = "https://ws-cert.vantiv.com/merchant/servicing/apitransactions/NativeRaftApi/v1"worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"@@ -1034,7 +1035,7 @@ connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"connector_list = "worldpayvantiv"[grpc_client.unified_connector_service]-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call# Merchant Advice Code Configurationdiff --git a/config/deployments/production.toml b/config/deployments/production.tomlindex 33bd27f65a..3900018c45 100644--- a/config/deployments/production.toml+++ b/config/deployments/production.toml@@ -184,6 +184,7 @@ wise.base_url = "https://api.wise.com/"worldline.base_url = "https://eu.api-ingenico.com/"worldpay.base_url = "https://access.worldpay.com/"worldpaymodular.base_url = "https://access.worldpay.com/"+worldpayraft.base_url = "https://ws.vantiv.com/merchant/servicing/apitransactions/NativeRaftApi/v1"worldpayvantiv.base_url = "https://transact.vantivcnp.com/vap/communicator/online"worldpayvantiv.secondary_base_url = "https://onlinessr.vantivcnp.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com" # pre-live environment@@ -1042,7 +1043,7 @@ click_to_pay = {connector_list = "adyen, cybersource, trustpay"}connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"[grpc_client.unified_connector_service]-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, citigate, moneris, elavon" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, citigate, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call# Merchant Advice Code Configurationdiff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.tomlindex 4b50a2cba1..77fa6bb426 100644--- a/config/deployments/sandbox.toml+++ b/config/deployments/sandbox.toml@@ -184,6 +184,7 @@ wise.base_url = "https://api.wise-sandbox.com/"worldline.base_url = "https://eu.sandbox.api-ingenico.com/"worldpay.base_url = "https://try.access.worldpay.com/"worldpaymodular.base_url = "https://try.access.worldpay.com/"+worldpayraft.base_url = "https://ws-cert.vantiv.com/merchant/servicing/apitransactions/NativeRaftApi/v1"worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"@@ -1053,7 +1054,7 @@ connector_list = "juspaythreedsserver, ctp_mastercard, ctp_visa"connector_list = "worldpayvantiv"[grpc_client.unified_connector_service]-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, citigate, moneris, elavon" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, jpmorgan, datatrans, tsys_transit, givepayments, citigate, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call# Merchant Advice Code Configurationdiff --git a/config/development.toml b/config/development.tomlindex 848e883776..7669dbc7d7 100644--- a/config/development.toml+++ b/config/development.toml@@ -446,6 +446,7 @@ wise.base_url = "https://api.wise-sandbox.com/"worldline.base_url = "https://eu.sandbox.api-ingenico.com/"worldpay.base_url = "https://try.access.worldpay.com/"worldpaymodular.base_url = "https://try.access.worldpay.com/"+worldpayraft.base_url = "https://ws-cert.vantiv.com/merchant/servicing/apitransactions/NativeRaftApi/v1"worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"@@ -1579,7 +1580,7 @@ enabled = "true"base_url = "http://localhost:8000"connection_timeout = 10request_timeout = 35-ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon" # Comma-separated list of connectors that use UCS only+ucs_only_connectors = "imerchantsolutions, paytm, phonepe, hyperpg, revolv3, fiservcommercehub, absa_sanlam, interpayments, payconex, dlocal, barclaycard, tsys_transit, jpmorgan, datatrans, givepayments, tesouro, citigate, ilixium, moneris, elavon, worldpayraft" # Comma-separated list of connectors that use UCS onlyucs_psync_disabled_connectors = "cashtocode, trustly" # Comma-separated list of connectors to disable UCS PSync call[revenue_recovery]diff --git a/config/docker_compose.toml b/config/docker_compose.tomlindex d2fc6aa391..41d45cb1d4 100644--- a/config/docker_compose.toml+++ b/config/docker_compose.toml@@ -357,6 +357,7 @@ wise.base_url = "https://api.wise-sandbox.com/"worldline.base_url = "https://eu.sandbox.api-ingenico.com/"worldpay.base_url = "https://try.access.worldpay.com/"worldpaymodular.base_url = "https://try.access.worldpay.com/"+worldpayraft.base_url = "https://ws-cert.vantiv.com/merchant/servicing/apitransactions/NativeRaftApi/v1"worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rsindex b67f7ae4cd..afd5c10abc 100644--- a/crates/common_enums/src/connector_enums.rs+++ b/crates/common_enums/src/connector_enums.rs@@ -203,6 +203,7 @@ pub enum Connector {Wise,Worldline,Worldpay,+ Worldpayraft,Worldpayvantiv,Worldpayxml,Worldpaymodular,@@ -462,6 +463,7 @@ impl Connector {| Self::Paytm| Self::Payconex| Self::Citigate+ | Self::Worldpayraft| Self::Payjustnow| Self::Payjustnowinstore| Self::Phonepediff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rsindex f771cdfa36..59cc42e0bb 100644--- a/crates/connector_configs/src/connector.rs+++ b/crates/connector_configs/src/connector.rs@@ -426,6 +426,7 @@ pub struct ConnectorConfig {pub worldline: Option<ConnectorTomlConfig>,pub worldpay: Option<ConnectorTomlConfig>,pub worldpaymodular: Option<ConnectorTomlConfig>,+ pub worldpayraft: Option<ConnectorTomlConfig>,#[cfg(feature = "payouts")]pub worldpay_payout: Option<ConnectorTomlConfig>,pub worldpayvantiv: Option<ConnectorTomlConfig>,@@ -686,6 +687,7 @@ impl ConnectorConfig {Connector::Worldline => Ok(connector_data.worldline),Connector::Worldpay => Ok(connector_data.worldpay),Connector::Worldpaymodular => Ok(connector_data.worldpaymodular),+ Connector::Worldpayraft => Ok(connector_data.worldpayraft),Connector::Worldpayvantiv => Ok(connector_data.worldpayvantiv),Connector::Worldpayxml => Ok(connector_data.worldpayxml),Connector::Zen => Ok(connector_data.zen),diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.tomlindex 075c574879..4a07ac68dc 100644--- a/crates/connector_configs/toml/development.toml+++ b/crates/connector_configs/toml/development.toml@@ -9081,3 +9081,24 @@ payment_method_type = "Discover"payment_method_type = "DinersClub"[[ilixium.debit]]payment_method_type = "UnionPay"++[worldpayraft]+[[worldpayraft.credit]]+ payment_method_type = "Visa"+[[worldpayraft.credit]]+ payment_method_type = "Mastercard"+[[worldpayraft.credit]]+ payment_method_type = "AmericanExpress"+[[worldpayraft.credit]]+ payment_method_type = "DinersClub"+[[worldpayraft.debit]]+ payment_method_type = "Visa"+[[worldpayraft.debit]]+ payment_method_type = "Mastercard"+[[worldpayraft.debit]]+ payment_method_type = "AmericanExpress"+[[worldpayraft.debit]]+ payment_method_type = "DinersClub"+[worldpayraft.connector_auth.BodyKey]+api_key = "Worldpay License"+key1 = "Worldpay Merchant ID"diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.tomlindex f2cee9fe68..51f672fcd1 100644--- a/crates/connector_configs/toml/production.toml+++ b/crates/connector_configs/toml/production.toml@@ -8136,3 +8136,24 @@ payment_method_type = "Discover"payment_method_type = "DinersClub"[[ilixium.debit]]payment_method_type = "UnionPay"++[worldpayraft]+[[worldpayraft.credit]]+ payment_method_type = "Visa"+[[worldpayraft.credit]]+ payment_method_type = "Mastercard"+[[worldpayraft.credit]]+ payment_method_type = "AmericanExpress"+[[worldpayraft.credit]]+ payment_method_type = "DinersClub"+[[worldpayraft.debit]]+ payment_method_type = "Visa"+[[worldpayraft.debit]]+ payment_method_type = "Mastercard"+[[worldpayraft.debit]]+ payment_method_type = "AmericanExpress"+[[worldpayraft.debit]]+ payment_method_type = "DinersClub"+[worldpayraft.connector_auth.BodyKey]+api_key = "Worldpay License"+key1 = "Worldpay Merchant ID"diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.tomlindex 02a9237b56..17a55bc685 100644--- a/crates/connector_configs/toml/sandbox.toml+++ b/crates/connector_configs/toml/sandbox.toml@@ -9055,3 +9055,24 @@ payment_method_type = "Discover"payment_method_type = "DinersClub"[[ilixium.debit]]payment_method_type = "UnionPay"++[worldpayraft]+[[worldpayraft.credit]]+ payment_method_type = "Visa"+[[worldpayraft.credit]]+ payment_method_type = "Mastercard"+[[worldpayraft.credit]]+ payment_method_type = "AmericanExpress"+[[worldpayraft.credit]]+ payment_method_type = "DinersClub"+[[worldpayraft.debit]]+ payment_method_type = "Visa"+[[worldpayraft.debit]]+ payment_method_type = "Mastercard"+[[worldpayraft.debit]]+ payment_method_type = "AmericanExpress"+[[worldpayraft.debit]]+ payment_method_type = "DinersClub"+[worldpayraft.connector_auth.BodyKey]+api_key = "Worldpay License"+key1 = "Worldpay Merchant ID"diff --git a/crates/euclid/src/enums.rs b/crates/euclid/src/enums.rsindex c847c011e2..94ee0dbe45 100644--- a/crates/euclid/src/enums.rs+++ b/crates/euclid/src/enums.rs@@ -359,6 +359,7 @@ pub enum RoutableConnectors {Worldline,Worldpay,Worldpaymodular,+ Worldpayraft,Worldpayvantiv,Worldpayxml,Xendit,@@ -510,6 +511,7 @@ impl TryFrom<Connector> for RoutableConnectors {Connector::Worldline => Ok(Self::Worldline),Connector::Worldpay => Ok(Self::Worldpay),Connector::Worldpaymodular => Ok(Self::Worldpaymodular),+ Connector::Worldpayraft => Ok(Self::Worldpayraft),Connector::Worldpayvantiv => Ok(Self::Worldpayvantiv),Connector::Worldpayxml => Ok(Self::Worldpayxml),Connector::Xendit => Ok(Self::Xendit),@@ -685,6 +687,7 @@ impl From<RoutableConnectors> for Connector {RoutableConnectors::Worldline => Self::Worldline,RoutableConnectors::Worldpay => Self::Worldpay,RoutableConnectors::Worldpaymodular => Self::Worldpaymodular,+ RoutableConnectors::Worldpayraft => Self::Worldpayraft,RoutableConnectors::Worldpayvantiv => Self::Worldpayvantiv,RoutableConnectors::Worldpayxml => Self::Worldpayxml,RoutableConnectors::Zen => Self::Zen,diff --git a/crates/hyperswitch_connectors/src/connectors.rs b/crates/hyperswitch_connectors/src/connectors.rsindex c29896a0cd..e8e2ab795b 100644--- a/crates/hyperswitch_connectors/src/connectors.rs+++ b/crates/hyperswitch_connectors/src/connectors.rs@@ -145,6 +145,7 @@ pub mod wise;pub mod worldline;pub mod worldpay;pub mod worldpaymodular;+pub mod worldpayraft;pub mod worldpayvantiv;pub mod worldpayxml;pub mod xendit;@@ -190,6 +191,7 @@ pub use self::{tsys::Tsys, tsys_transit::TsysTransit,unified_authentication_service::UnifiedAuthenticationService, vgs::Vgs, volt::Volt,wellsfargo::Wellsfargo, wellsfargopayout::Wellsfargopayout, wise::Wise, worldline::Worldline,- worldpay::Worldpay, worldpaymodular::Worldpaymodular, worldpayvantiv::Worldpayvantiv,- worldpayxml::Worldpayxml, xendit::Xendit, zen::Zen, zift::Zift, zsl::Zsl,+ worldpay::Worldpay, worldpaymodular::Worldpaymodular, worldpayraft::Worldpayraft,+ worldpayvantiv::Worldpayvantiv, worldpayxml::Worldpayxml, xendit::Xendit, zen::Zen, zift::Zift,+ zsl::Zsl,};diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayraft.rs b/crates/hyperswitch_connectors/src/connectors/worldpayraft.rsnew file mode 100644index 0000000000..fa289b21ce--- /dev/null+++ b/crates/hyperswitch_connectors/src/connectors/worldpayraft.rs@@ -0,0 +1,622 @@+pub mod transformers;++use std::sync::LazyLock;++use common_enums::enums;+use common_utils::{+ errors::CustomResult,+ ext_traits::BytesExt,+ request::{Method, Request, RequestBuilder, RequestContent},+ types::{AmountConvertor, StringMinorUnit, StringMinorUnitForConnector},+};+use error_stack::{report, ResultExt};+use hyperswitch_domain_models::{+ router_data::{AccessToken, ConnectorAuthType, ErrorResponse, RouterData},+ router_flow_types::{+ access_token_auth::AccessTokenAuth,+ payments::{Authorize, Capture, PSync, PaymentMethodToken, Session, SetupMandate, Void},+ refunds::{Execute, RSync},+ },+ router_request_types::{+ AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,+ PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,+ RefundsData, SetupMandateRequestData,+ },+ router_response_types::{+ ConnectorInfo, PaymentsResponseData, RefundsResponseData, SupportedPaymentMethods,+ },+ types::{+ PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,+ RefundSyncRouterData, RefundsRouterData,+ },+};+use hyperswitch_interfaces::{+ api::{+ self, ConnectorCommon, ConnectorCommonExt, ConnectorIntegration, ConnectorSpecifications,+ ConnectorValidation,+ },+ configs::Connectors,+ errors,+ events::connector_api_logs::ConnectorEvent,+ types::{self, Response},+ webhooks,+};+use hyperswitch_masking::{ExposeInterface, Mask};+use transformers as worldpayraft;++use crate::{constants::headers, types::ResponseRouterData, utils};++#[derive(Clone)]+pub struct Worldpayraft {+ amount_converter: &'static (dyn AmountConvertor<Output = StringMinorUnit> + Sync),+}++impl Worldpayraft {+ pub fn new() -> &'static Self {+ &Self {+ amount_converter: &StringMinorUnitForConnector,+ }+ }+}++impl api::Payment for Worldpayraft {}+impl api::PaymentSession for Worldpayraft {}+impl api::ConnectorAccessToken for Worldpayraft {}+impl api::MandateSetup for Worldpayraft {}+impl api::PaymentAuthorize for Worldpayraft {}+impl api::PaymentSync for Worldpayraft {}+impl api::PaymentCapture for Worldpayraft {}+impl api::PaymentVoid for Worldpayraft {}+impl api::Refund for Worldpayraft {}+impl api::RefundExecute for Worldpayraft {}+impl api::RefundSync for Worldpayraft {}+impl api::PaymentToken for Worldpayraft {}++impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>+ for Worldpayraft+{+ // Not Implemented (R)+}++impl<Flow, Request, Response> ConnectorCommonExt<Flow, Request, Response> for Worldpayraft+where+ Self: ConnectorIntegration<Flow, Request, Response>,+{+ fn build_headers(+ &self,+ req: &RouterData<Flow, Request, Response>,+ _connectors: &Connectors,+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>+ {+ let mut header = vec![(+ headers::CONTENT_TYPE.to_string(),+ self.get_content_type().to_string().into(),+ )];+ let mut api_key = self.get_auth_header(&req.connector_auth_type)?;+ header.append(&mut api_key);+ Ok(header)+ }+}++impl ConnectorCommon for Worldpayraft {+ fn id(&self) -> &'static str {+ "worldpayraft"+ }++ fn get_currency_unit(&self) -> api::CurrencyUnit {+ api::CurrencyUnit::Base+ }++ fn common_get_content_type(&self) -> &'static str {+ "application/json"+ }++ fn base_url<'a>(&self, connectors: &'a Connectors) -> &'a str {+ connectors.worldpayraft.base_url.as_ref()+ }++ fn get_auth_header(+ &self,+ auth_type: &ConnectorAuthType,+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>+ {+ let auth = worldpayraft::WorldpayraftAuthType::try_from(auth_type)+ .change_context(errors::ConnectorError::FailedToObtainAuthType)?;+ Ok(vec![(+ headers::AUTHORIZATION.to_string(),+ auth.license.expose().into_masked(),+ )])+ }++ fn build_error_response(+ &self,+ res: Response,+ event_builder: Option<&mut ConnectorEvent>,+ ) -> CustomResult<ErrorResponse, errors::ConnectorError> {+ let response: worldpayraft::WorldpayraftErrorResponse = res+ .response+ .parse_struct("WorldpayraftErrorResponse")+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;++ event_builder.map(|i| i.set_response_body(&response));+ router_env::logger::info!(connector_response=?response);++ Ok(ErrorResponse {+ status_code: res.status_code,+ code: response.code,+ message: response.message,+ reason: response.reason,+ attempt_status: None,+ connector_transaction_id: None,+ connector_response_reference_id: None,+ network_advice_code: None,+ network_decline_code: None,+ network_error_message: None,+ connector_metadata: None,+ })+ }+}++impl ConnectorValidation for Worldpayraft {+ fn validate_psync_reference_id(+ &self,+ _data: &PaymentsSyncData,+ _is_three_ds: bool,+ _status: enums::AttemptStatus,+ _connector_meta_data: Option<common_utils::pii::SecretSerdeValue>,+ ) -> CustomResult<(), errors::ConnectorError> {+ Ok(())+ }+}++impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Worldpayraft {+ //TODO: implement sessions flow+}++impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Worldpayraft {}++impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData>+ for Worldpayraft+{+}++impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Worldpayraft {+ fn get_headers(+ &self,+ req: &PaymentsAuthorizeRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>+ {+ self.build_headers(req, connectors)+ }++ fn get_content_type(&self) -> &'static str {+ self.common_get_content_type()+ }++ fn get_url(+ &self,+ _req: &PaymentsAuthorizeRouterData,+ _connectors: &Connectors,+ ) -> CustomResult<String, errors::ConnectorError> {+ Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())+ }++ fn get_request_body(+ &self,+ req: &PaymentsAuthorizeRouterData,+ _connectors: &Connectors,+ ) -> CustomResult<RequestContent, errors::ConnectorError> {+ let amount = utils::convert_amount(+ self.amount_converter,+ req.request.minor_amount,+ req.request.currency,+ )?;++ let connector_router_data = worldpayraft::WorldpayraftRouterData::from((amount, req));+ let connector_req =+ worldpayraft::WorldpayraftPaymentsRequest::try_from(&connector_router_data)?;+ Ok(RequestContent::Json(Box::new(connector_req)))+ }++ fn build_request(+ &self,+ req: &PaymentsAuthorizeRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Option<Request>, errors::ConnectorError> {+ Ok(Some(+ RequestBuilder::new()+ .method(Method::Post)+ .url(&types::PaymentsAuthorizeType::get_url(+ self, req, connectors,+ )?)+ .attach_default_headers()+ .headers(types::PaymentsAuthorizeType::get_headers(+ self, req, connectors,+ )?)+ .set_body(types::PaymentsAuthorizeType::get_request_body(+ self, req, connectors,+ )?)+ .build(),+ ))+ }++ fn handle_response(+ &self,+ data: &PaymentsAuthorizeRouterData,+ event_builder: Option<&mut ConnectorEvent>,+ res: Response,+ ) -> CustomResult<PaymentsAuthorizeRouterData, errors::ConnectorError> {+ let response: worldpayraft::WorldpayraftPaymentsResponse = res+ .response+ .parse_struct("Worldpayraft PaymentsAuthorizeResponse")+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;+ event_builder.map(|i| i.set_response_body(&response));+ router_env::logger::info!(connector_response=?response);+ RouterData::try_from(ResponseRouterData {+ response,+ data: data.clone(),+ http_code: res.status_code,+ })+ }++ fn get_error_response(+ &self,+ res: Response,+ event_builder: Option<&mut ConnectorEvent>,+ ) -> CustomResult<ErrorResponse, errors::ConnectorError> {+ self.build_error_response(res, event_builder)+ }+}++impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Worldpayraft {+ fn get_headers(+ &self,+ req: &PaymentsSyncRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>+ {+ self.build_headers(req, connectors)+ }++ fn get_content_type(&self) -> &'static str {+ self.common_get_content_type()+ }++ fn get_url(+ &self,+ _req: &PaymentsSyncRouterData,+ _connectors: &Connectors,+ ) -> CustomResult<String, errors::ConnectorError> {+ Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())+ }++ fn build_request(+ &self,+ req: &PaymentsSyncRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Option<Request>, errors::ConnectorError> {+ Ok(Some(+ RequestBuilder::new()+ .method(Method::Get)+ .url(&types::PaymentsSyncType::get_url(self, req, connectors)?)+ .attach_default_headers()+ .headers(types::PaymentsSyncType::get_headers(self, req, connectors)?)+ .build(),+ ))+ }++ fn handle_response(+ &self,+ data: &PaymentsSyncRouterData,+ event_builder: Option<&mut ConnectorEvent>,+ res: Response,+ ) -> CustomResult<PaymentsSyncRouterData, errors::ConnectorError> {+ let response: worldpayraft::WorldpayraftPaymentsResponse = res+ .response+ .parse_struct("worldpayraft PaymentsSyncResponse")+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;+ event_builder.map(|i| i.set_response_body(&response));+ router_env::logger::info!(connector_response=?response);+ RouterData::try_from(ResponseRouterData {+ response,+ data: data.clone(),+ http_code: res.status_code,+ })+ }++ fn get_error_response(+ &self,+ res: Response,+ event_builder: Option<&mut ConnectorEvent>,+ ) -> CustomResult<ErrorResponse, errors::ConnectorError> {+ self.build_error_response(res, event_builder)+ }+}++impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Worldpayraft {+ fn get_headers(+ &self,+ req: &PaymentsCaptureRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>+ {+ self.build_headers(req, connectors)+ }++ fn get_content_type(&self) -> &'static str {+ self.common_get_content_type()+ }++ fn get_url(+ &self,+ _req: &PaymentsCaptureRouterData,+ _connectors: &Connectors,+ ) -> CustomResult<String, errors::ConnectorError> {+ Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())+ }++ fn get_request_body(+ &self,+ _req: &PaymentsCaptureRouterData,+ _connectors: &Connectors,+ ) -> CustomResult<RequestContent, errors::ConnectorError> {+ Err(errors::ConnectorError::NotImplemented("get_request_body method".to_string()).into())+ }++ fn build_request(+ &self,+ req: &PaymentsCaptureRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Option<Request>, errors::ConnectorError> {+ Ok(Some(+ RequestBuilder::new()+ .method(Method::Post)+ .url(&types::PaymentsCaptureType::get_url(self, req, connectors)?)+ .attach_default_headers()+ .headers(types::PaymentsCaptureType::get_headers(+ self, req, connectors,+ )?)+ .set_body(types::PaymentsCaptureType::get_request_body(+ self, req, connectors,+ )?)+ .build(),+ ))+ }++ fn handle_response(+ &self,+ data: &PaymentsCaptureRouterData,+ event_builder: Option<&mut ConnectorEvent>,+ res: Response,+ ) -> CustomResult<PaymentsCaptureRouterData, errors::ConnectorError> {+ let response: worldpayraft::WorldpayraftPaymentsResponse = res+ .response+ .parse_struct("Worldpayraft PaymentsCaptureResponse")+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;+ event_builder.map(|i| i.set_response_body(&response));+ router_env::logger::info!(connector_response=?response);+ RouterData::try_from(ResponseRouterData {+ response,+ data: data.clone(),+ http_code: res.status_code,+ })+ }++ fn get_error_response(+ &self,+ res: Response,+ event_builder: Option<&mut ConnectorEvent>,+ ) -> CustomResult<ErrorResponse, errors::ConnectorError> {+ self.build_error_response(res, event_builder)+ }+}++impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Worldpayraft {}++impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Worldpayraft {+ fn get_headers(+ &self,+ req: &RefundsRouterData<Execute>,+ connectors: &Connectors,+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>+ {+ self.build_headers(req, connectors)+ }++ fn get_content_type(&self) -> &'static str {+ self.common_get_content_type()+ }++ fn get_url(+ &self,+ _req: &RefundsRouterData<Execute>,+ _connectors: &Connectors,+ ) -> CustomResult<String, errors::ConnectorError> {+ Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())+ }++ fn get_request_body(+ &self,+ req: &RefundsRouterData<Execute>,+ _connectors: &Connectors,+ ) -> CustomResult<RequestContent, errors::ConnectorError> {+ let refund_amount = utils::convert_amount(+ self.amount_converter,+ req.request.minor_refund_amount,+ req.request.currency,+ )?;++ let connector_router_data =+ worldpayraft::WorldpayraftRouterData::from((refund_amount, req));+ let connector_req =+ worldpayraft::WorldpayraftRefundRequest::try_from(&connector_router_data)?;+ Ok(RequestContent::Json(Box::new(connector_req)))+ }++ fn build_request(+ &self,+ req: &RefundsRouterData<Execute>,+ connectors: &Connectors,+ ) -> CustomResult<Option<Request>, errors::ConnectorError> {+ let request = RequestBuilder::new()+ .method(Method::Post)+ .url(&types::RefundExecuteType::get_url(self, req, connectors)?)+ .attach_default_headers()+ .headers(types::RefundExecuteType::get_headers(+ self, req, connectors,+ )?)+ .set_body(types::RefundExecuteType::get_request_body(+ self, req, connectors,+ )?)+ .build();+ Ok(Some(request))+ }++ fn handle_response(+ &self,+ data: &RefundsRouterData<Execute>,+ event_builder: Option<&mut ConnectorEvent>,+ res: Response,+ ) -> CustomResult<RefundsRouterData<Execute>, errors::ConnectorError> {+ let response: worldpayraft::RefundResponse = res+ .response+ .parse_struct("worldpayraft RefundResponse")+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;+ event_builder.map(|i| i.set_response_body(&response));+ router_env::logger::info!(connector_response=?response);+ RouterData::try_from(ResponseRouterData {+ response,+ data: data.clone(),+ http_code: res.status_code,+ })+ }++ fn get_error_response(+ &self,+ res: Response,+ event_builder: Option<&mut ConnectorEvent>,+ ) -> CustomResult<ErrorResponse, errors::ConnectorError> {+ self.build_error_response(res, event_builder)+ }+}++impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Worldpayraft {+ fn get_headers(+ &self,+ req: &RefundSyncRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Vec<(String, hyperswitch_masking::Maskable<String>)>, errors::ConnectorError>+ {+ self.build_headers(req, connectors)+ }++ fn get_content_type(&self) -> &'static str {+ self.common_get_content_type()+ }++ fn get_url(+ &self,+ _req: &RefundSyncRouterData,+ _connectors: &Connectors,+ ) -> CustomResult<String, errors::ConnectorError> {+ Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into())+ }++ fn build_request(+ &self,+ req: &RefundSyncRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Option<Request>, errors::ConnectorError> {+ Ok(Some(+ RequestBuilder::new()+ .method(Method::Get)+ .url(&types::RefundSyncType::get_url(self, req, connectors)?)+ .attach_default_headers()+ .headers(types::RefundSyncType::get_headers(self, req, connectors)?)+ .set_body(types::RefundSyncType::get_request_body(+ self, req, connectors,+ )?)+ .build(),+ ))+ }++ fn handle_response(+ &self,+ data: &RefundSyncRouterData,+ event_builder: Option<&mut ConnectorEvent>,+ res: Response,+ ) -> CustomResult<RefundSyncRouterData, errors::ConnectorError> {+ let response: worldpayraft::RefundResponse = res+ .response+ .parse_struct("worldpayraft RefundSyncResponse")+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;+ event_builder.map(|i| i.set_response_body(&response));+ router_env::logger::info!(connector_response=?response);+ RouterData::try_from(ResponseRouterData {+ response,+ data: data.clone(),+ http_code: res.status_code,+ })+ }++ fn get_error_response(+ &self,+ res: Response,+ event_builder: Option<&mut ConnectorEvent>,+ ) -> CustomResult<ErrorResponse, errors::ConnectorError> {+ self.build_error_response(res, event_builder)+ }+}++#[async_trait::async_trait]+impl webhooks::IncomingWebhook for Worldpayraft {+ fn get_webhook_object_reference_id(+ &self,+ _request: &webhooks::IncomingWebhookRequestDetails<'_>,+ ) -> CustomResult<api_models::webhooks::ObjectReferenceId, errors::ConnectorError> {+ Err(report!(errors::ConnectorError::WebhooksNotImplemented))+ }++ fn get_webhook_event_type(+ &self,+ _request: &webhooks::IncomingWebhookRequestDetails<'_>,+ _context: Option<&webhooks::WebhookContext>,+ ) -> CustomResult<api_models::webhooks::IncomingWebhookEvent, errors::ConnectorError> {+ Err(report!(errors::ConnectorError::WebhooksNotImplemented))+ }++ fn get_webhook_resource_object(+ &self,+ _request: &webhooks::IncomingWebhookRequestDetails<'_>,+ ) -> CustomResult<Box<dyn hyperswitch_masking::ErasedMaskSerialize>, errors::ConnectorError>+ {+ Err(report!(errors::ConnectorError::WebhooksNotImplemented))+ }+}++static WORLDPAYRAFT_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =+ LazyLock::new(SupportedPaymentMethods::new);++static WORLDPAYRAFT_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {+ display_name: "Worldpayraft",+ description: "Worldpay Native RAFT connector",+ connector_type: enums::HyperswitchConnectorCategory::PaymentGateway,+ integration_status: enums::ConnectorIntegrationStatus::Alpha,+};++static WORLDPAYRAFT_SUPPORTED_WEBHOOK_FLOWS: [enums::EventClass; 0] = [];++impl ConnectorSpecifications for Worldpayraft {+ fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {+ Some(&WORLDPAYRAFT_CONNECTOR_INFO)+ }++ fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {+ Some(&*WORLDPAYRAFT_SUPPORTED_PAYMENT_METHODS)+ }++ fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {+ Some(&WORLDPAYRAFT_SUPPORTED_WEBHOOK_FLOWS)+ }+}diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rsnew file mode 100644index 0000000000..de5b6f8562--- /dev/null+++ b/crates/hyperswitch_connectors/src/connectors/worldpayraft/transformers.rs@@ -0,0 +1,226 @@+use common_enums::enums;+use common_utils::types::StringMinorUnit;+use hyperswitch_domain_models::{+ payment_method_data::PaymentMethodData,+ router_data::{ConnectorAuthType, RouterData},+ router_flow_types::refunds::{Execute, RSync},+ router_request_types::ResponseId,+ router_response_types::{PaymentsResponseData, RefundsResponseData},+ types::{PaymentsAuthorizeRouterData, RefundsRouterData},+};+use hyperswitch_interfaces::errors;+use hyperswitch_masking::Secret;+use serde::{Deserialize, Serialize};++use crate::types::{RefundsResponseRouterData, ResponseRouterData};++//TODO: Fill the struct with respective fields+pub struct WorldpayraftRouterData<T> {+ pub amount: StringMinorUnit, // The type of amount that a connector accepts, for example, String, i64, f64, etc.+ pub router_data: T,+}++impl<T> From<(StringMinorUnit, T)> for WorldpayraftRouterData<T> {+ fn from((amount, item): (StringMinorUnit, T)) -> Self {+ Self {+ amount,+ router_data: item,+ }+ }+}++//TODO: Fill the struct with respective fields+#[derive(Default, Debug, Serialize, PartialEq)]+pub struct WorldpayraftPaymentsRequest {+ amount: StringMinorUnit,+ card: WorldpayraftCard,+}++#[derive(Default, Debug, Serialize, Eq, PartialEq)]+pub struct WorldpayraftCard {+ number: cards::CardNumber,+ expiry_month: Secret<String>,+ expiry_year: Secret<String>,+ cvc: Secret<String>,+ complete: bool,+}++impl TryFrom<&WorldpayraftRouterData<&PaymentsAuthorizeRouterData>>+ for WorldpayraftPaymentsRequest+{+ type Error = error_stack::Report<errors::ConnectorError>;+ fn try_from(+ item: &WorldpayraftRouterData<&PaymentsAuthorizeRouterData>,+ ) -> Result<Self, Self::Error> {+ match item.router_data.request.payment_method_data.clone() {+ PaymentMethodData::Card(_) => Err(errors::ConnectorError::NotImplemented(+ "Card payment method not implemented".to_string(),+ )+ .into()),+ _ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()),+ }+ }+}++//TODO: Fill the struct with respective fields+// Auth Struct+pub struct WorldpayraftAuthType {+ pub(super) license: Secret<String>,+ #[allow(dead_code)]+ pub(super) merchant_id: Secret<String>,+}++impl TryFrom<&ConnectorAuthType> for WorldpayraftAuthType {+ type Error = error_stack::Report<errors::ConnectorError>;+ fn try_from(auth_type: &ConnectorAuthType) -> Result<Self, Self::Error> {+ match auth_type {+ // UCS-only connector: HS forwards the raw ConnectorAuthType to the+ // Unified Connector Service, which expects BodyKey { api_key = license, key1 = merchant_id }.+ ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self {+ license: api_key.to_owned(),+ merchant_id: key1.to_owned(),+ }),+ _ => Err(errors::ConnectorError::FailedToObtainAuthType.into()),+ }+ }+}+// PaymentsResponse+//TODO: Append the remaining status flags+#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq)]+#[serde(rename_all = "lowercase")]+pub enum WorldpayraftPaymentStatus {+ Succeeded,+ Failed,+ #[default]+ Processing,+}++impl From<WorldpayraftPaymentStatus> for common_enums::AttemptStatus {+ fn from(item: WorldpayraftPaymentStatus) -> Self {+ match item {+ WorldpayraftPaymentStatus::Succeeded => Self::Charged,+ WorldpayraftPaymentStatus::Failed => Self::Failure,+ WorldpayraftPaymentStatus::Processing => Self::Pending,+ }+ }+}++//TODO: Fill the struct with respective fields+#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq)]+pub struct WorldpayraftPaymentsResponse {+ status: WorldpayraftPaymentStatus,+ id: String,+}++impl<F, T> TryFrom<ResponseRouterData<F, WorldpayraftPaymentsResponse, T, PaymentsResponseData>>+ for RouterData<F, T, PaymentsResponseData>+{+ type Error = error_stack::Report<errors::ConnectorError>;+ fn try_from(+ item: ResponseRouterData<F, WorldpayraftPaymentsResponse, T, PaymentsResponseData>,+ ) -> Result<Self, Self::Error> {+ Ok(Self {+ status: common_enums::AttemptStatus::from(item.response.status),+ response: Ok(PaymentsResponseData::TransactionResponse {+ resource_id: ResponseId::ConnectorTransactionId(item.response.id),+ redirection_data: Box::new(None),+ mandate_reference: Box::new(None),+ connector_metadata: None,+ network_txn_id: None,+ connector_response_reference_id: None,+ incremental_authorization_allowed: None,+ authentication_data: None,+ charges: None,+ network_txn_link_id: None,+ }),+ ..item.data+ })+ }+}++//TODO: Fill the struct with respective fields+// REFUND :+// Type definition for RefundRequest+#[derive(Default, Debug, Serialize)]+pub struct WorldpayraftRefundRequest {+ pub amount: StringMinorUnit,+}++impl<F> TryFrom<&WorldpayraftRouterData<&RefundsRouterData<F>>> for WorldpayraftRefundRequest {+ type Error = error_stack::Report<errors::ConnectorError>;+ fn try_from(item: &WorldpayraftRouterData<&RefundsRouterData<F>>) -> Result<Self, Self::Error> {+ Ok(Self {+ amount: item.amount.to_owned(),+ })+ }+}++// Type definition for Refund Response++#[allow(dead_code)]+#[derive(Debug, Copy, Serialize, Default, Deserialize, Clone)]+pub enum RefundStatus {+ Succeeded,+ Failed,+ #[default]+ Processing,+}++impl From<RefundStatus> for enums::RefundStatus {+ fn from(item: RefundStatus) -> Self {+ match item {+ RefundStatus::Succeeded => Self::Success,+ RefundStatus::Failed => Self::Failure,+ RefundStatus::Processing => Self::Pending,+ }+ }+}++//TODO: Fill the struct with respective fields+#[derive(Default, Debug, Clone, Serialize, Deserialize)]+pub struct RefundResponse {+ id: String,+ status: RefundStatus,+}++impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute> {+ type Error = error_stack::Report<errors::ConnectorError>;+ fn try_from(+ item: RefundsResponseRouterData<Execute, RefundResponse>,+ ) -> Result<Self, Self::Error> {+ Ok(Self {+ response: Ok(RefundsResponseData {+ connector_refund_id: item.response.id.to_string(),+ refund_status: enums::RefundStatus::from(item.response.status),+ }),+ ..item.data+ })+ }+}++impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync> {+ type Error = error_stack::Report<errors::ConnectorError>;+ fn try_from(+ item: RefundsResponseRouterData<RSync, RefundResponse>,+ ) -> Result<Self, Self::Error> {+ Ok(Self {+ response: Ok(RefundsResponseData {+ connector_refund_id: item.response.id.to_string(),+ refund_status: enums::RefundStatus::from(item.response.status),+ }),+ ..item.data+ })+ }+}++//TODO: Fill the struct with respective fields+#[derive(Default, Debug, Serialize, Deserialize, PartialEq)]+pub struct WorldpayraftErrorResponse {+ pub status_code: u16,+ pub code: String,+ pub message: String,+ pub reason: Option<String>,+ pub network_advice_code: Option<String>,+ pub network_decline_code: Option<String>,+ pub network_error_message: Option<String>,+}diff --git a/crates/hyperswitch_connectors/src/default_implementations.rs b/crates/hyperswitch_connectors/src/default_implementations.rsindex 7d73e5660b..1dce858a2a 100644--- a/crates/hyperswitch_connectors/src/default_implementations.rs+++ b/crates/hyperswitch_connectors/src/default_implementations.rs@@ -279,6 +279,7 @@ default_imp_for_authorize_session_token!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Paybox,@@ -444,6 +445,7 @@ default_imp_for_payment_settlement_split_create!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Paybox,@@ -611,6 +613,7 @@ default_imp_for_calculate_tax!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Paybox,@@ -793,6 +796,7 @@ default_imp_for_session_update!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -960,6 +964,7 @@ default_imp_for_post_session_tokens!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -1122,6 +1127,7 @@ default_imp_for_create_order!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -1208,6 +1214,7 @@ macro_rules! default_imp_for_update_post_confirm {default_imp_for_update_post_confirm!(connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::AbsaSanlam,connectors::Fiservcommercehub,connectors::Interpayments,@@ -1453,6 +1460,7 @@ default_imp_for_update_metadata!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -1631,6 +1639,7 @@ default_imp_for_cancel_post_capture!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nmi,@@ -1812,6 +1821,7 @@ default_imp_for_cancel_post_capture_sync!(connectors::Paybox,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Payeezy,connectors::Payjustnow,connectors::Payjustnowinstore,@@ -1879,6 +1889,7 @@ macro_rules! default_imp_for_complete_authorize {default_imp_for_complete_authorize!(connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Revolv3,connectors::TsysTransit,connectors::AbsaSanlam,@@ -2102,6 +2113,7 @@ default_imp_for_incremental_authorization!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -2277,6 +2289,7 @@ default_imp_for_extend_authorization!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -2429,6 +2442,7 @@ default_imp_for_create_customer!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -2584,6 +2598,7 @@ default_imp_for_connector_redirect_response!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nordea,connectors::Opayo,connectors::Opennode,@@ -2655,6 +2670,7 @@ macro_rules! default_imp_for_pre_authenticate_steps{default_imp_for_pre_authenticate_steps!(connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Revolv3,connectors::TsysTransit,connectors::AbsaSanlam,@@ -2897,6 +2913,7 @@ default_imp_for_authenticate_steps!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nomupay,connectors::Noon,@@ -2983,6 +3000,7 @@ default_imp_for_post_authenticate_steps!(connectors::AbsaSanlam,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Aci,connectors::Adyen,connectors::Adyenplatform,@@ -3147,6 +3165,7 @@ macro_rules! default_imp_for_pre_processing_steps{default_imp_for_pre_processing_steps!(connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Revolv3,connectors::TsysTransit,connectors::AbsaSanlam,@@ -3381,6 +3400,7 @@ default_imp_for_post_processing_steps!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -3548,6 +3568,7 @@ default_imp_for_approve!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nmi,@@ -3718,6 +3739,7 @@ default_imp_for_reject!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -3889,6 +3911,7 @@ default_imp_for_webhook_source_verification!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -4053,6 +4076,7 @@ default_imp_for_accept_dispute!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -4218,6 +4242,7 @@ default_imp_for_submit_evidence!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -4383,6 +4408,7 @@ default_imp_for_defend_dispute!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -4552,6 +4578,7 @@ default_imp_for_fetch_disputes!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -4720,6 +4747,7 @@ default_imp_for_dispute_sync!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -4895,6 +4923,7 @@ default_imp_for_file_upload!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -5049,6 +5078,7 @@ default_imp_for_payouts!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nordea,connectors::Opayo,connectors::Opennode,@@ -5203,6 +5233,7 @@ default_imp_for_payouts_create!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nordea,connectors::Opayo,connectors::Opennode,@@ -5369,6 +5400,7 @@ default_imp_for_payouts_retrieve!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -5532,6 +5564,7 @@ default_imp_for_payouts_eligibility!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -5695,6 +5728,7 @@ default_imp_for_payouts_fulfill!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nmi,@@ -5854,6 +5888,7 @@ default_imp_for_payouts_cancel!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -6019,6 +6054,7 @@ default_imp_for_payouts_quote!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -6187,6 +6223,7 @@ default_imp_for_payouts_recipient!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -6354,6 +6391,7 @@ default_imp_for_payouts_recipient_account!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -6524,6 +6562,7 @@ default_imp_for_frm_sale!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -6692,6 +6731,7 @@ default_imp_for_frm_checkout!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -6860,6 +6900,7 @@ default_imp_for_frm_transaction!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -7029,6 +7070,7 @@ default_imp_for_frm_fulfillment!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -7198,6 +7240,7 @@ default_imp_for_frm_record_return!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -7361,6 +7404,7 @@ default_imp_for_revoking_mandates!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -7528,6 +7572,7 @@ default_imp_for_uas_pre_authentication!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -7694,6 +7739,7 @@ default_imp_for_uas_webhook!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -7860,6 +7906,7 @@ default_imp_for_uas_post_authentication!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -8027,6 +8074,7 @@ default_imp_for_uas_authentication_confirmation!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -8185,6 +8233,7 @@ default_imp_for_connector_request_id!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -8347,6 +8396,7 @@ default_imp_for_fraud_check!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Payeezy,@@ -8536,6 +8586,7 @@ default_imp_for_connector_authentication!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -8700,6 +8751,7 @@ default_imp_for_uas_authentication!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Payeezy,connectors::Payjustnow,@@ -8861,6 +8913,7 @@ default_imp_for_revenue_recovery!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -9080,6 +9133,7 @@ default_imp_for_subscriptions!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -9249,6 +9303,7 @@ default_imp_for_billing_connector_payment_sync!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -9410,6 +9465,7 @@ default_imp_for_revenue_recovery_record_back!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -9578,6 +9634,7 @@ default_imp_for_billing_connector_invoice_sync!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -9740,6 +9797,7 @@ default_imp_for_external_vault!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -9907,6 +9965,7 @@ default_imp_for_external_vault_insert!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -10071,6 +10130,7 @@ default_imp_for_gift_card_balance_check!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nomupay,connectors::Noon,@@ -10240,6 +10300,7 @@ default_imp_for_external_vault_retrieve!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -10407,6 +10468,7 @@ default_imp_for_external_vault_delete!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -10575,6 +10637,7 @@ default_imp_for_external_vault_create!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -10744,6 +10807,7 @@ default_imp_for_connector_authentication_token!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -10915,6 +10979,7 @@ default_imp_for_external_vault_proxy_payments_create!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -11089,6 +11154,7 @@ default_imp_for_connector_webhook_register!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Opayo,connectors::Opennode,@@ -12059,6 +12125,7 @@ default_imp_for_generate_qr_flow!(connectors::Netcetera,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nomupay,connectors::Noon,@@ -12234,6 +12301,7 @@ default_imp_for_push_notification_flow!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -12329,6 +12397,7 @@ macro_rules! default_imp_for_pre_authorize_void {default_imp_for_pre_authorize_void!(connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nuvei,connectors::Worldpayvantiv,connectors::Aci,diff --git a/crates/hyperswitch_connectors/src/default_implementations_v2.rs b/crates/hyperswitch_connectors/src/default_implementations_v2.rsindex 8747e96aa9..269bfc7d85 100644--- a/crates/hyperswitch_connectors/src/default_implementations_v2.rs+++ b/crates/hyperswitch_connectors/src/default_implementations_v2.rs@@ -464,6 +464,7 @@ default_imp_for_new_connector_integration_payment!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -633,6 +634,7 @@ default_imp_for_new_connector_integration_refund!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -794,6 +796,7 @@ default_imp_for_new_connector_integration_connector_authentication_token!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -954,6 +957,7 @@ default_imp_for_new_connector_integration_connector_access_token!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -1123,6 +1127,7 @@ default_imp_for_new_connector_integration_accept_dispute!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -1293,6 +1298,7 @@ default_imp_for_new_connector_integration_fetch_disputes!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nomupay,connectors::Noon,@@ -1463,6 +1469,7 @@ default_imp_for_new_connector_integration_dispute_sync!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nomupay,connectors::Noon,@@ -1632,6 +1639,7 @@ default_imp_for_new_connector_integration_defend_dispute!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -1800,6 +1808,7 @@ default_imp_for_new_connector_integration_submit_evidence!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -1979,6 +1988,7 @@ default_imp_for_new_connector_integration_file_upload!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nuvei,connectors::Opayo,@@ -2150,6 +2160,7 @@ default_imp_for_new_connector_integration_payouts_create!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -2321,6 +2332,7 @@ default_imp_for_new_connector_integration_payouts_eligibility!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -2492,6 +2504,7 @@ default_imp_for_new_connector_integration_payouts_fulfill!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -2663,6 +2676,7 @@ default_imp_for_new_connector_integration_payouts_cancel!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -2834,6 +2848,7 @@ default_imp_for_new_connector_integration_payouts_quote!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -3005,6 +3020,7 @@ default_imp_for_new_connector_integration_payouts_recipient!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -3176,6 +3192,7 @@ default_imp_for_new_connector_integration_payouts_sync!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -3347,6 +3364,7 @@ default_imp_for_new_connector_integration_payouts_recipient_account!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -3516,6 +3534,7 @@ default_imp_for_new_connector_integration_webhook_source_verification!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -3687,6 +3706,7 @@ default_imp_for_new_connector_integration_frm_sale!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -3858,6 +3878,7 @@ default_imp_for_new_connector_integration_frm_checkout!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -4029,6 +4050,7 @@ default_imp_for_new_connector_integration_frm_transaction!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -4200,6 +4222,7 @@ default_imp_for_new_connector_integration_frm_fulfillment!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -4371,6 +4394,7 @@ default_imp_for_new_connector_integration_frm_record_return!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -4540,6 +4564,7 @@ default_imp_for_new_connector_integration_revoking_mandates!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Payone,connectors::Opayo,@@ -4685,6 +4710,7 @@ default_imp_for_new_connector_integration_frm!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nomupay,connectors::Nordea,@@ -4853,6 +4879,7 @@ default_imp_for_new_connector_integration_connector_authentication!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nomupay,connectors::Nordea,connectors::Novalnet,@@ -5010,6 +5037,7 @@ default_imp_for_new_connector_integration_revenue_recovery!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nomupay,connectors::Nordea,@@ -5193,6 +5221,7 @@ default_imp_for_new_connector_integration_external_vault!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -5367,6 +5396,7 @@ default_imp_for_new_connector_integration_external_vault_proxy!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Opayo,connectors::Opennode,connectors::Nuvei,@@ -5543,6 +5573,7 @@ default_imp_for_new_connector_integration_webhook_register!(connectors::Nexixpay,connectors::Payconex,connectors::Citigate,+ connectors::Worldpayraft,connectors::Nmi,connectors::Nomupay,connectors::Noon,diff --git a/crates/hyperswitch_domain_models/src/connector_endpoints.rs b/crates/hyperswitch_domain_models/src/connector_endpoints.rsindex ec6ca7c6ac..bceb4157b6 100644--- a/crates/hyperswitch_domain_models/src/connector_endpoints.rs+++ b/crates/hyperswitch_domain_models/src/connector_endpoints.rs@@ -160,6 +160,7 @@ pub struct Connectors {pub worldline: ConnectorParams,pub worldpay: ConnectorParams,pub worldpaymodular: ConnectorParams,+ pub worldpayraft: ConnectorParams,pub worldpayvantiv: ConnectorParamsWithThreeUrls,pub worldpayxml: ConnectorParamsWithSecondaryBaseUrl,pub xendit: ConnectorParams,diff --git a/crates/router/src/connector.rs b/crates/router/src/connector.rsindex 4e57752b48..66c6937e24 100644--- a/crates/router/src/connector.rs+++ b/crates/router/src/connector.rs@@ -55,7 +55,7 @@ pub use hyperswitch_connectors::connectors::{unified_authentication_service::UnifiedAuthenticationService, vgs, vgs::Vgs, volt, volt::Volt,wellsfargo, wellsfargo::Wellsfargo, wellsfargopayout, wellsfargopayout::Wellsfargopayout, wise,wise::Wise, worldline, worldline::Worldline, worldpay, worldpay::Worldpay, worldpaymodular,- worldpaymodular::Worldpaymodular, worldpayvantiv, worldpayvantiv::Worldpayvantiv, worldpayxml,- worldpayxml::Worldpayxml, xendit, xendit::Xendit, zen, zen::Zen, zift, zift::Zift, zsl,- zsl::Zsl,+ worldpaymodular::Worldpaymodular, worldpayraft, worldpayraft::Worldpayraft, worldpayvantiv,+ worldpayvantiv::Worldpayvantiv, worldpayxml, worldpayxml::Worldpayxml, xendit, xendit::Xendit,+ zen, zen::Zen, zift, zift::Zift, zsl, zsl::Zsl,};diff --git a/crates/router/src/core/connector_validation.rs b/crates/router/src/core/connector_validation.rsindex 9a87105100..7e61921ca4 100644--- a/crates/router/src/core/connector_validation.rs+++ b/crates/router/src/core/connector_validation.rs@@ -674,6 +674,10 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> {citigate::transformers::CitigateAuthType::try_from(self.auth_type)?;Ok(())}+ api_enums::Connector::Worldpayraft => {+ worldpayraft::transformers::WorldpayraftAuthType::try_from(self.auth_type)?;+ Ok(())+ }api_enums::Connector::Finix => {finix::transformers::FinixAuthType::try_from(self.auth_type)?;Ok(())diff --git a/crates/router/src/core/unified_connector_service/connector_config.rs b/crates/router/src/core/unified_connector_service/connector_config.rsindex 3daf025fd6..b3dde2489b 100644--- a/crates/router/src/core/unified_connector_service/connector_config.rs+++ b/crates/router/src/core/unified_connector_service/connector_config.rs@@ -273,6 +273,12 @@ pub enum ConnectorSpecificConfig {key1: Secret<String>,base_url: Option<String>,},+ /// Worldpay Native RAFT connector configuration+ Worldpayraft {+ license: Secret<String>,+ merchant_id: Secret<String>,+ base_url: Option<String>,+ },/// Fiservcommercehub connector configurationFiservcommercehub {api_key: Secret<String>,@@ -1776,6 +1782,14 @@ impl ForeignTryFrom<(Connector, &ConnectorAuthType, Option<&serde_json::Value>)>}),_ => Err(err("Citigate requires BodyKey auth type")),},+ Connector::Worldpayraft => match auth {+ ConnectorAuthType::BodyKey { api_key, key1 } => Ok(Self::Worldpayraft {+ license: api_key.clone(),+ merchant_id: key1.clone(),+ base_url: None,+ }),+ _ => Err(err("Worldpayraft requires BodyKey auth type")),+ },Connector::Interpayments => match auth {ConnectorAuthType::HeaderKey { api_key } => Ok(Self::Interpayments {api_key: api_key.clone(),diff --git a/crates/router/src/types/api/connector_mapping.rs b/crates/router/src/types/api/connector_mapping.rsindex 76d5223a52..1188beee12 100644--- a/crates/router/src/types/api/connector_mapping.rs+++ b/crates/router/src/types/api/connector_mapping.rs@@ -1,7 +1,7 @@use std::str::FromStr;use error_stack::{report, ResultExt};-use hyperswitch_connectors::connectors::{Citigate, Payconex, Paytm, Phonepe};+use hyperswitch_connectors::connectors::{Citigate, Payconex, Paytm, Phonepe, Worldpayraft};use crate::{configs::settings::Connectors,@@ -534,6 +534,9 @@ impl ConnectorData {enums::Connector::Paytm => Ok(ConnectorEnum::Old(Box::new(Paytm::new()))),enums::Connector::Payconex => Ok(ConnectorEnum::Old(Box::new(Payconex::new()))),enums::Connector::Citigate => Ok(ConnectorEnum::Old(Box::new(Citigate::new()))),+ enums::Connector::Worldpayraft => {+ Ok(ConnectorEnum::Old(Box::new(Worldpayraft::new())))+ }},Err(_) => Err(report!(errors::ConnectorError::InvalidConnectorName).attach_printable(format!("invalid connector name: {connector_name}")))diff --git a/crates/router/src/types/api/feature_matrix.rs b/crates/router/src/types/api/feature_matrix.rsindex d4b51772fe..ecbac67e1a 100644--- a/crates/router/src/types/api/feature_matrix.rs+++ b/crates/router/src/types/api/feature_matrix.rs@@ -293,6 +293,9 @@ impl FeatureMatrixConnectorData {enums::Connector::Citigate => {Ok(ConnectorEnum::Old(Box::new(connector::Citigate::new())))}+ enums::Connector::Worldpayraft => {+ Ok(ConnectorEnum::Old(Box::new(connector::Worldpayraft::new())))+ }// "payeezy" => Ok(ConnectorIntegrationEnum::Old(Box::new(&connector::Payeezy)), As psync and rsync are not supported by this connector, it is added as template code for future usage// enums::Connector::Payload => {// Ok(ConnectorEnum::Old(Box::new(connector::Paybload::new())))diff --git a/crates/router/src/types/connector_transformers.rs b/crates/router/src/types/connector_transformers.rsindex 68822c63f7..e32576f80b 100644--- a/crates/router/src/types/connector_transformers.rs+++ b/crates/router/src/types/connector_transformers.rs@@ -199,6 +199,7 @@ impl ForeignTryFrom<api_enums::Connector> for euclid::enums::RoutableConnectorsapi_enums::Connector::Worldline => Self::Worldline,api_enums::Connector::Worldpay => Self::Worldpay,api_enums::Connector::Worldpaymodular => Self::Worldpaymodular,+ api_enums::Connector::Worldpayraft => Self::Worldpayraft,api_enums::Connector::Worldpayvantiv => Self::Worldpayvantiv,api_enums::Connector::Worldpayxml => Self::Worldpayxml,api_enums::Connector::Xendit => Self::Xendit,diff --git a/crates/test_utils/src/connector_auth.rs b/crates/test_utils/src/connector_auth.rsindex 2479faf520..d6508cafbc 100644--- a/crates/test_utils/src/connector_auth.rs+++ b/crates/test_utils/src/connector_auth.rs@@ -153,6 +153,7 @@ pub struct ConnectorAuthentication {// pub wellsfargopayout: Option<HeaderKey>,pub wise: Option<BodyKey>,pub worldpay: Option<BodyKey>,+ pub worldpayraft: Option<BodyKey>,pub worldpaymodular: Option<HeaderKey>,pub worldpayvantiv: Option<HeaderKey>,pub worldpayxml: Option<HeaderKey>,diff --git a/loadtest/config/development.toml b/loadtest/config/development.tomlindex cacd0c6e5f..8c26818b25 100644--- a/loadtest/config/development.toml+++ b/loadtest/config/development.toml@@ -275,6 +275,7 @@ wellsfargopayout.base_url = "https://api-sandbox.wellsfargo.com/"worldline.base_url = "https://eu.sandbox.api-ingenico.com/"worldpay.base_url = "https://try.access.worldpay.com/"worldpaymodular.base_url = "https://try.access.worldpay.com/"+worldpayraft.base_url = "https://ws-cert.vantiv.com/merchant/servicing/apitransactions/NativeRaftApi/v1"worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/online"worldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"