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): [WorldpayWPG] Add 3DS flow for cards (#10442)
Vani Guptae2a6de55d196
diff --git a/config/config.example.toml b/config/config.example.tomlindex ffedbcf2f8..59bcb13782 100644--- a/config/config.example.toml+++ b/config/config.example.toml@@ -332,6 +332,7 @@ worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/oworldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"+worldpayxml.secondary_base_url = "https://secure-test.worldpay.com/shopper/3ds/challenge.html"xendit.base_url = "https://api.xendit.co"zift.base_url = "https://sandbox-secure.zift.io/"zsl.base_url = "https://api.sitoffalb.net/"diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.tomlindex 0d748d4936..fc00bb9adf 100644--- a/config/deployments/integration_test.toml+++ b/config/deployments/integration_test.toml@@ -167,6 +167,7 @@ worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/oworldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"+worldpayxml.secondary_base_url = "https://secure-test.worldpay.com/shopper/3ds/challenge.html"xendit.base_url = "https://api.xendit.co"zift.base_url = "https://sandbox-secure.zift.io/"zen.base_url = "https://api.zen-test.com/"diff --git a/config/deployments/production.toml b/config/deployments/production.tomlindex 6bd0ddf9e4..5d0e1bf584 100644--- a/config/deployments/production.toml+++ b/config/deployments/production.toml@@ -170,6 +170,7 @@ worldpayvantiv.base_url = "https://transact.vantivcnp.com/vap/communicator/onlinworldpayvantiv.secondary_base_url = "https://onlinessr.vantivcnp.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com" # pre-live environmentworldpayxml.base_url = "https://secure.worldpay.com/jsp/merchant/xml/paymentService.jsp"+worldpayxml.secondary_base_url = "https://secure.worldpay.com/shopper/3ds/challenge.html"xendit.base_url = "https://api.xendit.co"zift.base_url = "https://secure.zift.io/"zen.base_url = "https://api.zen.com/"diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.tomlindex 7a0475e4ef..030f85de02 100644--- a/config/deployments/sandbox.toml+++ b/config/deployments/sandbox.toml@@ -170,6 +170,7 @@ worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/oworldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"+worldpayxml.secondary_base_url = "https://secure-test.worldpay.com/shopper/3ds/challenge.html"xendit.base_url = "https://api.xendit.co"zift.base_url = "https://sandbox-secure.zift.io/"zen.base_url = "https://api.zen-test.com/"diff --git a/config/development.toml b/config/development.tomlindex d186483710..63d1f35982 100644--- a/config/development.toml+++ b/config/development.toml@@ -362,6 +362,7 @@ worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/oworldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"+worldpayxml.secondary_base_url = "https://secure-test.worldpay.com/shopper/3ds/challenge.html"xendit.base_url = "https://api.xendit.co"zift.base_url = "https://sandbox-secure.zift.io/"trustpay.base_url = "https://test-tpgw.trustpay.eu/"diff --git a/config/docker_compose.toml b/config/docker_compose.tomlindex 1f4c684534..5ec893d78b 100644--- a/config/docker_compose.toml+++ b/config/docker_compose.toml@@ -258,6 +258,7 @@ worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/oworldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"+worldpayxml.secondary_base_url = "https://secure-test.worldpay.com/shopper/3ds/challenge.html"xendit.base_url = "https://api.xendit.co"zift.base_url = "https://sandbox-secure.zift.io/"zen.base_url = "https://api.zen-test.com/"diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rsindex 5abc36e28a..0c16e59e5f 100644--- a/crates/connector_configs/src/connector.rs+++ b/crates/connector_configs/src/connector.rs@@ -187,6 +187,9 @@ pub struct ConfigMetadata {pub merchant_payment_method_route_id: Option<InputData>,pub site: Option<InputData>,pub purpose_of_payment: Option<InputData>,+ pub organizational_unit_id: Option<InputData>,+ pub issuer_id: Option<InputData>,+ pub jwt_mac_key: Option<InputData>,}#[serde_with::skip_serializing_none]diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.tomlindex 2865f09bf5..f42f128edc 100644--- a/crates/connector_configs/toml/development.toml+++ b/crates/connector_configs/toml/development.toml@@ -6739,6 +6739,26 @@ type = "Text"[[worldpayxml.wallet]]payment_method_type = "google_pay"+[worldpayxml.metadata.organizational_unit_id]+name="organizational_unit_id"+label="Organizational Unit ID"+placeholder="Enter your organizational unit ID for three ds payments"+required=false+type="Text"+[worldpayxml.metadata.issuer_id]+name="issuer_id"+label="Issuer Identifier"+placeholder="Enter your issuer identifier for three ds payments"+required=false+type="Text"+[worldpayxml.metadata.jwt_mac_key]+name="jwt_mac_key"+label="JWT MAC KEY"+placeholder="Enter your JWT MAC Key"+required=false+type="Text"++[[worldpayxml.metadata.google_pay]]name="merchant_name"label="Google Pay Merchant Name"diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.tomlindex dfd4c3a9d3..db9c444944 100644--- a/crates/connector_configs/toml/production.toml+++ b/crates/connector_configs/toml/production.toml@@ -5464,6 +5464,24 @@ options=["PAN_ONLY", "CRYPTOGRAM_3DS"]api_secret = "Merchant Code"api_key = "API Username"key1 = "API Password"+[worldpayxml.metadata.organizational_unit_id]+name="organizational_unit_id"+label="Organizational Unit ID"+placeholder="Enter your organizational unit ID for three ds payments"+required=false+type="Text"+[worldpayxml.metadata.issuer_id]+name="issuer_id"+label="Issuer Identifier"+placeholder="Enter your issuer identifier for three ds payments"+required=false+type="Text"+[worldpayxml.metadata.jwt_mac_key]+name="jwt_mac_key"+label="JWT MAC KEY"+placeholder="Enter your JWT MAC Key"+required=false+type="Text"[worldpayxml_payout][[worldpayxml_payout.wallet]]diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.tomlindex da2c4f6042..0b7059b8c0 100644--- a/crates/connector_configs/toml/sandbox.toml+++ b/crates/connector_configs/toml/sandbox.toml@@ -6791,6 +6791,24 @@ options=["PAN_ONLY", "CRYPTOGRAM_3DS"]api_secret = "Merchant Code"api_key = "API Username"key1 = "API Password"+[worldpayxml.metadata.organizational_unit_id]+name="organizational_unit_id"+label="Organizational Unit ID"+placeholder="Enter your organizational unit ID for three ds payments"+required=false+type="Text"+[worldpayxml.metadata.issuer_id]+name="issuer_id"+label="Issuer Identifier"+placeholder="Enter your issuer identifier for three ds payments"+required=false+type="Text"+[worldpayxml.metadata.jwt_mac_key]+name="jwt_mac_key"+label="JWT MAC KEY"+placeholder="Enter your JWT MAC Key"+required=false+type="Text"[worldpayxml_payout][[worldpayxml_payout.wallet]]diff --git a/crates/diesel_models/src/payment_attempt.rs b/crates/diesel_models/src/payment_attempt.rsindex ce5d72bee6..f25e7e19cd 100644--- a/crates/diesel_models/src/payment_attempt.rs+++ b/crates/diesel_models/src/payment_attempt.rs@@ -4467,6 +4467,9 @@ pub enum RedirectForm {form_fields: std::collections::HashMap<String, String>,collection_id: Option<String>,},+ WorldpayxmlRedirectForm {+ jwt: String,+ },}common_utils::impl_to_sql_from_sql_json!(RedirectForm);diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayxml.rs b/crates/hyperswitch_connectors/src/connectors/worldpayxml.rsindex 9345f91ffa..961b0384cc 100644--- a/crates/hyperswitch_connectors/src/connectors/worldpayxml.rs+++ b/crates/hyperswitch_connectors/src/connectors/worldpayxml.rs@@ -15,13 +15,16 @@ 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},+ payments::{+ Authorize, Capture, CompleteAuthorize, PSync, PaymentMethodToken, Session,+ SetupMandate, Void,+ },refunds::{Execute, RSync},},router_request_types::{- AccessTokenRequestData, PaymentMethodTokenizationData, PaymentsAuthorizeData,- PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,- RefundsData, SetupMandateRequestData,+ AccessTokenRequestData, CompleteAuthorizeData, PaymentMethodTokenizationData,+ PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData,+ PaymentsSyncData, RefundsData, SetupMandateRequestData,},router_response_types::{ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,@@ -29,7 +32,8 @@ use hyperswitch_domain_models::{},types::{PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,- PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData,+ PaymentsCompleteAuthorizeRouterData, PaymentsSyncRouterData, RefundSyncRouterData,+ RefundsRouterData,},};#[cfg(feature = "payouts")]@@ -59,7 +63,7 @@ use transformers as worldpayxml;use crate::{constants::headers,types::ResponseRouterData,- utils::{self},+ utils::{self, ForeignTryFrom},};#[derive(Clone)]@@ -87,6 +91,7 @@ impl api::Refund for Worldpayxml {}impl api::RefundExecute for Worldpayxml {}impl api::RefundSync for Worldpayxml {}impl api::PaymentToken for Worldpayxml {}+impl api::PaymentsCompleteAuthorize for Worldpayxml {}impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>for Worldpayxml@@ -309,15 +314,19 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseDataevent_builder: Option<&mut ConnectorEvent>,res: Response,) -> CustomResult<PaymentsAuthorizeRouterData, errors::ConnectorError> {+ let header = res.headers;let response: worldpayxml::PaymentService =utils::deserialize_xml_to_struct(&res.response)?;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,- })+ RouterData::foreign_try_from((+ ResponseRouterData {+ response,+ data: data.clone(),+ http_code: res.status_code,+ },+ header,+ ))}fn get_error_response(@@ -774,6 +783,104 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Worldpayx}}+impl ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData>+ for Worldpayxml+{+ fn get_headers(+ &self,+ req: &PaymentsCompleteAuthorizeRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {+ let mut header = self.build_headers(req, connectors)?;++ let cookie = worldpayxml::get_cookie_from_metadata(req.request.connector_meta.clone())?;++ let mut cookie = vec![(+ worldpayxml::worldpayxml_constants::COOKIE.to_string(),+ Mask::into_masked(cookie),+ )];++ header.append(&mut cookie);+ Ok(header)+ }++ fn get_content_type(&self) -> &'static str {+ self.common_get_content_type()+ }++ fn get_url(+ &self,+ _req: &PaymentsCompleteAuthorizeRouterData,+ connectors: &Connectors,+ ) -> CustomResult<String, errors::ConnectorError> {+ Ok(self.base_url(connectors).to_owned())+ }++ fn get_request_body(+ &self,+ req: &PaymentsCompleteAuthorizeRouterData,+ _connectors: &Connectors,+ ) -> CustomResult<RequestContent, errors::ConnectorError> {+ let connector_req_object = worldpayxml::PaymentService::try_from(req)?;++ let connector_req = utils::XmlSerializer::serialize_to_xml_bytes(+ &connector_req_object,+ worldpayxml::worldpayxml_constants::XML_VERSION,+ Some(worldpayxml::worldpayxml_constants::XML_ENCODING),+ None,+ Some(worldpayxml::worldpayxml_constants::WORLDPAYXML_DOC_TYPE),+ )?;+ Ok(RequestContent::RawBytes(connector_req))+ }++ fn build_request(+ &self,+ req: &PaymentsCompleteAuthorizeRouterData,+ connectors: &Connectors,+ ) -> CustomResult<Option<Request>, errors::ConnectorError> {+ Ok(Some(+ RequestBuilder::new()+ .method(Method::Post)+ .url(&types::PaymentsCompleteAuthorizeType::get_url(+ self, req, connectors,+ )?)+ .attach_default_headers()+ .headers(types::PaymentsCompleteAuthorizeType::get_headers(+ self, req, connectors,+ )?)+ .set_body(types::PaymentsCompleteAuthorizeType::get_request_body(+ self, req, connectors,+ )?)+ .build(),+ ))+ }++ fn handle_response(+ &self,+ data: &PaymentsCompleteAuthorizeRouterData,+ event_builder: Option<&mut ConnectorEvent>,+ res: Response,+ ) -> CustomResult<PaymentsCompleteAuthorizeRouterData, errors::ConnectorError> {+ let response: worldpayxml::PaymentService =+ utils::deserialize_xml_to_struct(&res.response)?;+ 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 api::Payouts for Worldpayxml {}#[cfg(feature = "payouts")]impl api::PayoutFulfill for Worldpayxml {}diff --git a/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rsindex 830d11a120..37d85b366c 100644--- a/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/worldpayxml/transformers.rs@@ -7,6 +7,7 @@ use common_enums::CardNetwork;use common_utils::pii;use common_utils::types::StringMinorUnit;use error_stack::ResultExt;+use http::HeaderMap;#[cfg(feature = "payouts")]use hyperswitch_domain_models::{address::Address,@@ -18,16 +19,21 @@ use hyperswitch_domain_models::{payment_method_data::{Card, GooglePayWalletData, PaymentMethodData, WalletData},router_data::{ConnectorAuthType, ErrorResponse, RouterData},router_flow_types::refunds::{Execute, RSync},- router_request_types::{PaymentsAuthorizeData, PaymentsSyncData, ResponseId},- router_response_types::{PaymentsResponseData, RefundsResponseData},+ router_request_types::{+ CompleteAuthorizeData, PaymentsAuthorizeData, PaymentsSyncData, ResponseId,+ },+ router_response_types::{PaymentsResponseData, RedirectForm, RefundsResponseData},types::{PaymentsAuthorizeRouterData, PaymentsCancelRouterData, PaymentsCaptureRouterData,- PaymentsSyncRouterData, RefundSyncRouterData, RefundsRouterData,+ PaymentsCompleteAuthorizeRouterData, PaymentsSyncRouterData, RefundSyncRouterData,+ RefundsRouterData,},};use hyperswitch_interfaces::{consts, errors};+use josekit;use masking::Secret;use serde::{Deserialize, Serialize};+use serde_json::{json, Value};#[cfg(feature = "payouts")]use crate::types::PayoutsResponseRouterData;@@ -37,7 +43,8 @@ use crate::{RefundsResponseRouterData, ResponseRouterData,},utils::{- self as connector_utils, AddressDetailsData, CardData, PaymentsAuthorizeRequestData,+ self as connector_utils, AddressDetailsData, CardData, ForeignTryFrom,+ PaymentsAuthorizeRequestData, PaymentsCompleteAuthorizeRequestData,PaymentsSyncRequestData, RouterData as _,},};@@ -62,6 +69,7 @@ pub mod worldpayxml_constants {pub const XML_ENCODING: &str = "UTF-8";pub const WORLDPAYXML_DOC_TYPE: &str = r#"paymentService PUBLIC "-//Worldpay//DTD Worldpay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd""#;pub const MAX_PAYMENT_REFERENCE_ID_LENGTH: usize = 64;+ pub const COOKIE: &str = "cookie";}#[derive(Debug, Serialize, Deserialize)]@@ -189,13 +197,32 @@ pub struct WorldpayXmlErrorResponse {}#[derive(Debug, Deserialize, Serialize)]+#[serde(rename_all = "camelCase")]struct OrderStatus {#[serde(rename = "@orderCode")]order_code: String,+ challenge_required: Option<ChallengeRequired>,payment: Option<Payment>,error: Option<WorldpayXmlErrorResponse>,}+#[derive(Debug, Deserialize, Serialize)]+struct ChallengeRequired {+ #[serde(rename = "threeDSChallengeDetails")]+ three_ds_challenge_details: Option<ThreeDSChallengeDetails>,+}++#[derive(Debug, Deserialize, Serialize)]+struct ThreeDSChallengeDetails {+ #[serde(rename = "threeDSVersion")]+ three_ds_version: Option<String>,+ #[serde(rename = "acsURL")]+ acs_url: Option<String>,+ #[serde(rename = "transactionId3DS")]+ transaction_id_3ds: Option<String>,+ payload: Option<String>,+}+#[derive(Debug, Deserialize, Serialize)]#[serde(rename_all = "camelCase")]pub struct Payment {@@ -220,6 +247,8 @@ pub struct Payment {aav_telephone_result_code: Option<ResultCode>,#[serde(rename = "AAVEmailResultCode")]aav_email_result_code: Option<ResultCode>,+ #[serde(rename = "ThreeDSecureResult")]+ three_d_secure_result: Option<ResultCode>,issuer_country_code: Option<String>,issuer_name: Option<String>,balance: Option<Vec<Balance>>,@@ -305,15 +334,40 @@ struct Order {order_code: String,#[serde(skip_serializing_if = "Option::is_none", rename = "@captureDelay")]capture_delay: Option<AutoCapture>,- description: String,- amount: WorldpayXmlAmount,- payment_details: PaymentDetails,+ #[serde(skip_serializing_if = "Option::is_none")]+ description: Option<String>,+ #[serde(skip_serializing_if = "Option::is_none")]+ amount: Option<WorldpayXmlAmount>,+ #[serde(skip_serializing_if = "Option::is_none")]+ payment_details: Option<PaymentDetails>,#[serde(skip_serializing_if = "Option::is_none")]shopper: Option<WorldpayxmlShopper>,#[serde(skip_serializing_if = "Option::is_none")]shipping_address: Option<WorldpayxmlPayinAddress>,#[serde(skip_serializing_if = "Option::is_none")]billing_address: Option<WorldpayxmlPayinAddress>,+ #[serde(skip_serializing_if = "Option::is_none", rename = "additional3DSData")]+ additional_threeds_data: Option<AdditionalThreeDSData>,+ #[serde(skip_serializing_if = "Option::is_none", rename = "info3DSecure")]+ info_threed_secure: Option<Info3DSecure>,+ #[serde(skip_serializing_if = "Option::is_none")]+ session: Option<CompleteAuthSession>,+}++#[derive(Debug, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+struct Info3DSecure {+ completed_authentication: CompletedAuthentication,+}++#[derive(Debug, Serialize, Deserialize)]+struct CompletedAuthentication {}++#[derive(Debug, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+struct CompleteAuthSession {+ #[serde(rename = "@id")]+ id: Secret<String>,}#[derive(Debug, Clone, Serialize, Deserialize)]@@ -377,6 +431,26 @@ struct WorldpayxmlAddressData {country_code: common_enums::CountryAlpha2,}+#[derive(Debug, Serialize, Deserialize)]+struct AdditionalThreeDSData {+ #[serde(rename = "@dfReferenceId")]+ df_reference_id: Option<String>,+ #[serde(rename = "@javaScriptEnabled")]+ javascript_enabled: bool,+ #[serde(rename = "@deviceChannel")]+ device_channel: String,+ #[serde(rename = "@challengePreference")]+ challenge_preference: ChallengePreference,+}++#[derive(Debug, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+enum ChallengePreference {+ NoChallengeRequested,+ ChallengeRequested,+ ChallengeMandated,+}+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]#[serde(rename_all = "UPPERCASE")]enum AutoCapture {@@ -402,6 +476,16 @@ struct PaymentDetails {action: Option<Action>,#[serde(flatten)]payment_method: PaymentMethod,+ #[serde(skip_serializing_if = "Option::is_none")]+ session: Option<Session>,+}++#[derive(Debug, Serialize, Deserialize)]+struct Session {+ #[serde(rename = "@id")]+ id: String,+ #[serde(rename = "@shopperIPAddress")]+ shopper_ip_address: Secret<String, pii::IpAddress>,}#[derive(Debug, Serialize, Deserialize)]@@ -501,6 +585,13 @@ pub struct WorldpayxmlPayoutConnectorMetadataObject {pub purpose_of_payment: Option<String>,}+#[derive(Debug, Default, Serialize, Deserialize)]+pub struct WorldpayxmlConnectorMetadataObject {+ pub issuer_id: Option<String>,+ pub organizational_unit_id: Option<String>,+ pub jwt_mac_key: Option<String>,+}+#[derive(Debug, Serialize, Deserialize)]#[serde(rename_all = "SCREAMING_SNAKE_CASE")]enum Action {@@ -516,10 +607,14 @@ pub enum WorldpayxmlSyncResponse {Payment(Box<PaymentService>),}-impl TryFrom<(&Card, Option<enums::CaptureMethod>)> for PaymentDetails {+impl TryFrom<(&Card, Option<enums::CaptureMethod>, Option<Session>)> for PaymentDetails {type Error = error_stack::Report<errors::ConnectorError>;fn try_from(- (card_data, capture_method): (&Card, Option<enums::CaptureMethod>),+ (card_data, capture_method, session): (+ &Card,+ Option<enums::CaptureMethod>,+ Option<Session>,+ ),) -> Result<Self, Self::Error> {Ok(Self {action: if connector_utils::is_manual_capture(capture_method) {@@ -540,6 +635,7 @@ impl TryFrom<(&Card, Option<enums::CaptureMethod>)> for PaymentDetails {card_address: None,purpose_of_payment_code: None,}),+ session,})}}@@ -571,6 +667,7 @@ impl TryFrom<(&GooglePayWalletData, Option<enums::CaptureMethod>)> for PaymentDesignature: parsed_token.signature,signed_message: parsed_token.signed_message.clone(),}),+ session: None,})}}@@ -618,14 +715,19 @@ fn get_address_details(data: &Address) -> Option<WorldpayxmlPayinAddress> {}}-fn get_shopper_details(item: &PaymentsAuthorizeRouterData) -> Option<WorldpayxmlShopper> {+fn get_shopper_details(+ item: &PaymentsAuthorizeRouterData,+ accept_header: Option<String>,+ user_agent_header: Option<String>,+) -> Result<Option<WorldpayxmlShopper>, errors::ConnectorError> {let shopper_email = item.request.email.clone();let browser_info = item.request.browser_info+ .clone().as_ref().map(|browser_info| WPGBrowserData {- accept_header: browser_info.accept_header.clone(),+ accept_header,http_accept_language: browser_info.accept_language.clone(),http_referer: browser_info.referer.clone(),browser_language: browser_info.language.clone(),@@ -634,17 +736,17 @@ fn get_shopper_details(item: &PaymentsAuthorizeRouterData) -> Option<Worldpayxmlbrowser_colour_depth: browser_info.color_depth,browser_screen_height: browser_info.screen_height,browser_screen_width: browser_info.screen_width,- user_agent_header: browser_info.user_agent.clone(),+ user_agent_header,time_zone: browser_info.time_zone,});if shopper_email.is_some() || browser_info.is_some() {- Some(WorldpayxmlShopper {+ Ok(Some(WorldpayxmlShopper {shopper_email_address: shopper_email,browser: browser_info,- })+ }))} else {- None+ Ok(None)}}@@ -653,13 +755,6 @@ impl TryFrom<&WorldpayxmlRouterData<&PaymentsAuthorizeRouterData>> for PaymentSefn try_from(item: &WorldpayxmlRouterData<&PaymentsAuthorizeRouterData>,) -> Result<Self, Self::Error> {- if item.router_data.is_three_ds() {- Err(errors::ConnectorError::NotSupported {- message: "Card 3DS".to_string(),- connector: "Worldpayxml",- })?- };-let auth = WorldpayxmlAuthType::try_from(&item.router_data.connector_auth_type).change_context(errors::ConnectorError::FailedToObtainAuthType)?;@@ -686,34 +781,83 @@ impl TryFrom<&WorldpayxmlRouterData<&PaymentsAuthorizeRouterData>> for PaymentSefield_name: "description",},)?;++ let is_three_ds = item.router_data.is_three_ds();+ let (additional_threeds_data, session, accept_header, user_agent_header) =+ if is_three_ds {+ let additional_threeds_data = Some(AdditionalThreeDSData {+ df_reference_id: None,+ javascript_enabled: false,+ device_channel: "Browser".to_string(),+ challenge_preference: ChallengePreference::ChallengeRequested,+ });+ let browser_info = item.router_data.request.get_browser_info()?;+ let accept_header = browser_info.accept_header.ok_or(+ errors::ConnectorError::MissingRequiredField {+ field_name: "browser_info.accept_header",+ },+ )?;+ let user_agent_header = browser_info.user_agent.ok_or(+ errors::ConnectorError::MissingRequiredField {+ field_name: "browser_info.user_agent",+ },+ )?;++ let session = Some(Session {+ id: item.router_data.connector_request_reference_id.clone(),+ shopper_ip_address: item.router_data.request.get_ip_address()?,+ });++ (+ additional_threeds_data,+ session,+ Some(accept_header),+ Some(user_agent_header),+ )+ } else {+ let accept_header = item+ .router_data+ .request+ .browser_info+ .as_ref()+ .and_then(|info| info.accept_header.clone());+ let user_agent_header = item+ .router_data+ .request+ .browser_info+ .as_ref()+ .and_then(|info| info.user_agent.clone());++ (None, None, accept_header, user_agent_header)+ };+let exponent = item.router_data.request.currency.number_of_digits_after_decimal_point().to_string();-let amount = WorldpayXmlAmount {currency_code: item.router_data.request.currency.to_owned(),exponent,value: item.amount.to_owned(),};-- let shopper = get_shopper_details(item.router_data);+ let shopper = get_shopper_details(item.router_data, accept_header, user_agent_header)?;let billing_address = item.router_data.get_optional_billing().and_then(get_address_details);-let shipping_address = item.router_data.get_optional_shipping().and_then(get_address_details);let payment_details = match item.router_data.request.payment_method_data.clone() {- PaymentMethodData::Card(req_card) => {- PaymentDetails::try_from((&req_card, item.router_data.request.capture_method))?- }+ PaymentMethodData::Card(req_card) => PaymentDetails::try_from((+ &req_card,+ item.router_data.request.capture_method,+ session,+ ))?,PaymentMethodData::Wallet(WalletData::GooglePay(google_pay_data)) => {PaymentDetails::try_from((&google_pay_data,@@ -729,12 +873,15 @@ impl TryFrom<&WorldpayxmlRouterData<&PaymentsAuthorizeRouterData>> for PaymentSeorder: Order {order_code,capture_delay,- description,- amount,- payment_details,+ description: Some(description),+ amount: Some(amount),+ payment_details: Some(payment_details),shopper,- billing_address,shipping_address,+ billing_address,+ additional_threeds_data,+ info_threed_secure: None,+ session: None,},});@@ -1123,12 +1270,341 @@ impl TryFrom<&PaymentsSyncRouterData> for PaymentService {}}-impl<F> TryFrom<ResponseRouterData<F, PaymentService, PaymentsAuthorizeData, PaymentsResponseData>>- for RouterData<F, PaymentsAuthorizeData, PaymentsResponseData>+#[derive(Debug, Deserialize, Serialize)]+struct Payload {+ #[serde(rename = "ACSUrl")]+ acs_url: String,+ #[serde(rename = "Payload")]+ payload: String,+ #[serde(rename = "TransactionId")]+ transaction_id: String,+}++#[derive(Debug, Deserialize, Serialize)]+struct ChallengeJwt {+ jti: String,+ iat: u64,+ iss: String,+ #[serde(rename = "OrgUnitId")]+ org_unit_id: String,+ #[serde(rename = "ReturnUrl")]+ return_url: String,+ #[serde(rename = "Payload")]+ payload: Payload,+ #[serde(rename = "ObjectifyPayload")]+ objectify_payload: bool,+}++pub fn get_cookie_from_metadata(metadata: Option<Value>) -> Result<String, errors::ConnectorError> {+ let value = metadata+ .as_ref()+ .ok_or_else(|| errors::ConnectorError::MissingRequiredField {+ field_name: "metadata",+ })?;++ let cookie = value+ .get("cookie")+ .and_then(|v| v.as_str())+ .ok_or_else(|| errors::ConnectorError::MissingRequiredField {+ field_name: "metadata.cookie",+ })?;++ Ok(cookie.to_string())+}++fn to_jwt_payload(+ challenge: &ChallengeJwt,+) -> common_utils::errors::CustomResult<josekit::jwt::JwtPayload, errors::ConnectorError> {+ let json_str = serde_json::to_string(challenge)+ .change_context(errors::ConnectorError::ProcessingStepFailed(None))?;++ let parsed: serde_json::Map<String, Value> = serde_json::from_str(&json_str)+ .change_context(errors::ConnectorError::ProcessingStepFailed(None))?;++ let jwt_payload = josekit::jwt::JwtPayload::from_map(parsed)+ .change_context(errors::ConnectorError::ProcessingStepFailed(None))?;++ Ok(jwt_payload)+}++fn generate_challenge_jwt(+ acs_url: String,+ payload: String,+ transaction_id: String,+ return_url: String,+ metadata_for_jwt: WorldpayxmlConnectorMetadataObject,+) -> Result<String, errors::ConnectorError> {+ let iat: u64 = chrono::Utc::now()+ .timestamp()+ .try_into()+ .map_err(|_| errors::ConnectorError::ResponseDeserializationFailed)?;++ let iss = metadata_for_jwt+ .issuer_id+ .ok_or(errors::ConnectorError::MissingRequiredField {+ field_name: "connector_metadata.issuer_id",+ })?;++ let org_unit_id = metadata_for_jwt.organizational_unit_id.ok_or(+ errors::ConnectorError::MissingRequiredField {+ field_name: "connector_metadata.organizational_unit_id",+ },+ )?;++ let secret = metadata_for_jwt.jwt_mac_key.as_deref().ok_or(+ errors::ConnectorError::MissingRequiredField {+ field_name: "connector_metadata.jwt_mac_key",+ },+ )?;++ let payload_json = ChallengeJwt {+ jti: uuid::Uuid::new_v4().to_string(),+ iat,+ iss,+ org_unit_id,+ return_url,+ payload: Payload {+ acs_url,+ payload,+ transaction_id,+ },+ objectify_payload: true,+ };++ let payload_json = to_jwt_payload(&payload_json)+ .map_err(|_| errors::ConnectorError::ProcessingStepFailed(None))?;++ let hmac_signer = josekit::jws::alg::hmac::HmacJwsAlgorithm::Hs256+ .signer_from_bytes(secret.as_bytes())+ .map_err(|_| errors::ConnectorError::ProcessingStepFailed(None))?;++ let mut header = josekit::jws::JwsHeader::new();+ header.set_algorithm("HS256");++ let jwt = josekit::jwt::encode_with_signer(&payload_json, &header, &hmac_signer)+ .map_err(|_| errors::ConnectorError::RequestEncodingFailed)?;++ Ok(jwt)+}++impl<F>+ ForeignTryFrom<(+ ResponseRouterData<F, PaymentService, PaymentsAuthorizeData, PaymentsResponseData>,+ Option<HeaderMap>,+ )> for RouterData<F, PaymentsAuthorizeData, PaymentsResponseData>+{+ type Error = error_stack::Report<errors::ConnectorError>;+ fn foreign_try_from(+ (item, header): (+ ResponseRouterData<F, PaymentService, PaymentsAuthorizeData, PaymentsResponseData>,+ Option<HeaderMap>,+ ),+ ) -> Result<Self, Self::Error> {+ let is_auto_capture = item.data.request.is_auto_capture()?;+ let reply = item+ .response+ .reply+ .ok_or(errors::ConnectorError::UnexpectedResponseError(+ bytes::Bytes::from("Missing reply data".to_string()),+ ))?;++ validate_reply(&reply)?;++ if let Some(order_status) = reply.order_status {+ validate_order_status(&order_status)?;++ if let Some(payment_data) = order_status.payment {+ let status = get_attempt_status(is_auto_capture, payment_data.last_event, None)?;++ let response = process_payment_response(+ status,+ &payment_data,+ item.http_code,+ order_status.order_code.clone(),+ )+ .map_err(|err| *err);+ Ok(Self {+ status,+ response,+ ..item.data+ })+ } else if let Some(challenge_required) = order_status.challenge_required {+ let acs_url = challenge_required+ .three_ds_challenge_details+ .as_ref()+ .and_then(|details| details.acs_url.clone())+ .ok_or(errors::ConnectorError::UnexpectedResponseError(+ bytes::Bytes::from("Missing acs_url in challenge details".to_string()),+ ))?;+ let payload = challenge_required+ .three_ds_challenge_details+ .as_ref()+ .and_then(|details| details.payload.clone())+ .ok_or(errors::ConnectorError::UnexpectedResponseError(+ bytes::Bytes::from("Missing payload in challenge details".to_string()),+ ))?;+ let transaction_id = challenge_required+ .three_ds_challenge_details+ .as_ref()+ .and_then(|details| details.transaction_id_3ds.clone())+ .ok_or(errors::ConnectorError::UnexpectedResponseError(+ bytes::Bytes::from(+ "Missing transaction_id_3ds in challenge details".to_string(),+ ),+ ))?;+ let return_url = item.data.request.complete_authorize_url.clone().ok_or(+ errors::ConnectorError::MissingRequiredField {+ field_name: "return_url",+ },+ )?;++ let metadata_for_jwt = WorldpayxmlConnectorMetadataObject::try_from(+ item.data.connector_meta_data.as_ref(),+ )?;++ let jwt = generate_challenge_jwt(+ acs_url,+ payload,+ transaction_id,+ return_url,+ metadata_for_jwt,+ )?;++ let redirection_data = RedirectForm::WorldpayxmlRedirectForm { jwt };++ let cookie = header.and_then(|header| {+ header+ .get_all("set-cookie")+ .iter()+ .filter_map(|value| value.to_str().ok())+ .find(|cookie| cookie.trim_start().starts_with("machine="))+ .map(|cookie| cookie.to_string())+ });++ let metadata = cookie.map(|value| json!({ "cookie": value }));++ let status = common_enums::AttemptStatus::AuthenticationPending;+ let response = Ok(PaymentsResponseData::TransactionResponse {+ resource_id: ResponseId::ConnectorTransactionId(+ order_status.order_code.clone(),+ ),+ redirection_data: Box::new(Some(redirection_data)),+ mandate_reference: Box::new(None),+ connector_metadata: metadata,+ network_txn_id: None,+ connector_response_reference_id: Some(order_status.order_code.clone()),+ incremental_authorization_allowed: None,+ charges: None,+ });++ Ok(Self {+ status,+ response,+ ..item.data+ })+ } else {+ let error =+ order_status.error+ .ok_or(errors::ConnectorError::UnexpectedResponseError(+ bytes::Bytes::from("Either order_status.payment or order_status.error must be present in the response".to_string()),+ ))?;++ Ok(Self {+ status: common_enums::AttemptStatus::Failure,+ response: Err(ErrorResponse {+ code: error.code,+ message: error.message.clone(),+ reason: Some(error.message.clone()),+ status_code: item.http_code,+ attempt_status: None,+ connector_transaction_id: Some(order_status.order_code),+ network_advice_code: None,+ network_decline_code: None,+ network_error_message: None,+ connector_metadata: None,+ }),+ ..item.data+ })+ }+ } else {+ let error = reply+ .error+ .ok_or(errors::ConnectorError::UnexpectedResponseError(+ bytes::Bytes::from("Missing reply.error".to_string()),+ ))?;+ Ok(Self {+ status: common_enums::AttemptStatus::Failure,+ response: Err(ErrorResponse {+ code: error.code,+ message: error.message.clone(),+ reason: Some(error.message.clone()),+ status_code: item.http_code,+ attempt_status: None,+ connector_transaction_id: None,+ network_advice_code: None,+ network_decline_code: None,+ network_error_message: None,+ connector_metadata: None,+ }),+ ..item.data+ })+ }+ }+}++impl TryFrom<&PaymentsCompleteAuthorizeRouterData> for PaymentService {+ type Error = error_stack::Report<errors::ConnectorError>;+ fn try_from(item: &PaymentsCompleteAuthorizeRouterData) -> Result<Self, Self::Error> {+ let auth = WorldpayxmlAuthType::try_from(&item.connector_auth_type)+ .change_context(errors::ConnectorError::FailedToObtainAuthType)?;++ let info_threed_secure = Some(Info3DSecure {+ completed_authentication: CompletedAuthentication {},+ });++ let code = item.request.connector_transaction_id.clone().ok_or(+ errors::ConnectorError::MissingRequiredField {+ field_name: "connector_transaction_id",+ },+ )?;++ let session = Some(CompleteAuthSession {+ id: Secret::new(code.clone()),+ });++ let submit = Some(Submit {+ order: Order {+ order_code: code,+ capture_delay: None,+ description: None,+ amount: None,+ payment_details: None,+ shopper: None,+ shipping_address: None,+ billing_address: None,+ additional_threeds_data: None,+ info_threed_secure,+ session,+ },+ });++ Ok(Self {+ version: worldpayxml_constants::WORLDPAYXML_VERSION.to_string(),+ merchant_code: auth.merchant_code.clone(),+ submit,+ reply: None,+ inquiry: None,+ modify: None,+ })+ }+}++impl<F> TryFrom<ResponseRouterData<F, PaymentService, CompleteAuthorizeData, PaymentsResponseData>>+ for RouterData<F, CompleteAuthorizeData, PaymentsResponseData>{type Error = error_stack::Report<errors::ConnectorError>;fn try_from(- item: ResponseRouterData<F, PaymentService, PaymentsAuthorizeData, PaymentsResponseData>,+ item: ResponseRouterData<F, PaymentService, CompleteAuthorizeData, PaymentsResponseData>,) -> Result<Self, Self::Error> {let is_auto_capture = item.data.request.is_auto_capture()?;let reply = item@@ -1526,6 +2002,7 @@ impl TryFrom<(ApplePayDecrypt, Option<CardAddress>, Option<String>)> for PaymentOk(Self {action: Some(Action::Refund),payment_method,+ session: None,})}}@@ -1573,6 +2050,7 @@ impl TryFrom<(CardPayout, Option<CardAddress>, Option<String>)> for PaymentDetaiOk(Self {action: Some(Action::Refund),payment_method,+ session: None,})}}@@ -1590,6 +2068,18 @@ impl TryFrom<Option<&pii::SecretSerdeValue>> for WorldpayxmlPayoutConnectorMetad}}+impl TryFrom<Option<&pii::SecretSerdeValue>> for WorldpayxmlConnectorMetadataObject {+ type Error = error_stack::Report<errors::ConnectorError>;+ fn try_from(meta_data: Option<&pii::SecretSerdeValue>) -> Result<Self, Self::Error> {+ let metadata: Self =+ connector_utils::to_connector_meta_from_secret::<Self>(meta_data.cloned())+ .change_context(errors::ConnectorError::InvalidConnectorConfig {+ config: "metadata",+ })?;+ Ok(metadata)+ }+}+#[cfg(feature = "payouts")]impl TryFrom<&WorldpayxmlRouterData<&PayoutsRouterData<PoFulfill>>> for PaymentService {type Error = error_stack::Report<errors::ConnectorError>;@@ -1675,10 +2165,13 @@ impl TryFrom<&WorldpayxmlRouterData<&PayoutsRouterData<PoFulfill>>> for PaymentSorder: Order {order_code,capture_delay: None,- description,- amount,- payment_details,+ description: Some(description),+ amount: Some(amount),+ payment_details: Some(payment_details),shopper: None,+ additional_threeds_data: None,+ info_threed_secure: None,+ session: None,billing_address: None,shipping_address: None,},@@ -1991,7 +2484,9 @@ fn validate_reply(reply: &Reply) -> Result<(), errors::ConnectorError> {fn validate_order_status(order_status: &OrderStatus) -> Result<(), errors::ConnectorError> {if (order_status.payment.is_some() && order_status.error.is_some())- || (order_status.payment.is_none() && order_status.error.is_none())+ || (order_status.payment.is_none()+ && order_status.error.is_none()+ && order_status.challenge_required.is_none()){Err(errors::ConnectorError::UnexpectedResponseError(bytes::Bytes::from(@@ -2074,10 +2569,10 @@ pub fn map_purpose_code(value: Option<String>) -> Option<String> {impl WorldpayxmlAddress {fn is_empty(&self) -> bool {self.last_name.is_none()- && self.address1.is_none()- && self.postal_code.is_none()- && self.city.is_none()- && self.country_code.is_none()+ || self.address1.is_none()+ || self.postal_code.is_none()+ || self.city.is_none()+ || self.country_code.is_none()}fn is_empty_option(addr: &Option<Self>) -> bool {diff --git a/crates/hyperswitch_connectors/src/default_implementations.rs b/crates/hyperswitch_connectors/src/default_implementations.rsindex 9f4459d35c..c2e5ed00e0 100644--- a/crates/hyperswitch_connectors/src/default_implementations.rs+++ b/crates/hyperswitch_connectors/src/default_implementations.rs@@ -1334,7 +1334,6 @@ default_imp_for_complete_authorize!(connectors::Wellsfargopayout,connectors::Worldline,connectors::Worldpayvantiv,- connectors::Worldpayxml,connectors::Volt,connectors::Xendit,connectors::Zift,diff --git a/crates/hyperswitch_domain_models/src/connector_endpoints.rs b/crates/hyperswitch_domain_models/src/connector_endpoints.rsindex d96737411f..8b033018c8 100644--- a/crates/hyperswitch_domain_models/src/connector_endpoints.rs+++ b/crates/hyperswitch_domain_models/src/connector_endpoints.rs@@ -145,7 +145,7 @@ pub struct Connectors {pub worldline: ConnectorParams,pub worldpay: ConnectorParams,pub worldpayvantiv: ConnectorParamsWithThreeUrls,- pub worldpayxml: ConnectorParams,+ pub worldpayxml: ConnectorParamsWithSecondaryBaseUrl,pub xendit: ConnectorParams,pub zift: ConnectorParams,pub zen: ConnectorParams,diff --git a/crates/hyperswitch_domain_models/src/router_response_types.rs b/crates/hyperswitch_domain_models/src/router_response_types.rsindex 290176e500..28988001c8 100644--- a/crates/hyperswitch_domain_models/src/router_response_types.rs+++ b/crates/hyperswitch_domain_models/src/router_response_types.rs@@ -359,6 +359,9 @@ pub enum RedirectForm {form_fields: HashMap<String, String>,collection_id: Option<String>,},+ WorldpayxmlRedirectForm {+ jwt: String,+ },}impl From<(url::Url, Method)> for RedirectForm {@@ -474,6 +477,7 @@ impl From<RedirectForm> for diesel_models::payment_attempt::RedirectForm {form_fields,collection_id,},+ RedirectForm::WorldpayxmlRedirectForm { jwt } => Self::WorldpayxmlRedirectForm { jwt },}}}@@ -574,6 +578,9 @@ impl From<diesel_models::payment_attempt::RedirectForm> for RedirectForm {form_fields,collection_id,},+ diesel_models::payment_attempt::RedirectForm::WorldpayxmlRedirectForm { jwt } => {+ Self::WorldpayxmlRedirectForm { jwt }+ }}}}diff --git a/crates/router/src/services/api.rs b/crates/router/src/services/api.rsindex f3565004a6..f1cd8e3eab 100644--- a/crates/router/src/services/api.rs+++ b/crates/router/src/services/api.rs@@ -1674,6 +1674,56 @@ pub fn build_redirection_form(}}},+ RedirectForm::WorldpayxmlRedirectForm { jwt } => {+ let base_url = config.connectors.worldpayxml.secondary_base_url;+ maud::html! {+ (maud::DOCTYPE)+ html {+ head {+ meta name="viewport" content="width=device-width, initial-scale=1";+ }+ body style="background-color: #ffffff; padding: 20px; font-family: Arial, Helvetica, Sans-Serif;" {++ div id="loader1" class="lottie" style="height: 150px; display: block; position: relative; margin-top: 150px; margin-left: auto; margin-right: auto;" { "" }++ (PreEscaped(r#"<script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.4/lottie.min.js"></script>"#))++ (PreEscaped(r#"+ <script>+ var anime = bodymovin.loadAnimation({+ container: document.getElementById('loader1'),+ renderer: 'svg',+ loop: true,+ autoplay: true,+ name: 'hyperswitch loader',+ animationData: {"v":"4.8.0","meta":{"g":"LottieFiles AE 3.1.1","a":"","k":"","d":"","tc":""},"fr":29.9700012207031,"ip":0,"op":31.0000012626559,"w":400,"h":250,"nm":"loader_shape","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"circle 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[278.25,202.671,0],"ix":2},"a":{"a":0,"k":[23.72,23.72,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[12.935,0],[0,-12.936],[-12.935,0],[0,12.935]],"o":[[-12.952,0],[0,12.935],[12.935,0],[0,-12.936]],"v":[[0,-23.471],[-23.47,0.001],[0,23.471],[23.47,0.001]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.427451010311,0.976470648074,1],"ix":4},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[10]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":19.99,"s":[100]},{"t":29.9800012211104,"s":[10]}],"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[23.72,23.721],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":48.0000019550801,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"square 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[196.25,201.271,0],"ix":2},"a":{"a":0,"k":[22.028,22.03,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[1.914,0],[0,0],[0,-1.914],[0,0],[-1.914,0],[0,0],[0,1.914],[0,0]],"o":[[0,0],[-1.914,0],[0,0],[0,1.914],[0,0],[1.914,0],[0,0],[0,-1.914]],"v":[[18.313,-21.779],[-18.312,-21.779],[-21.779,-18.313],[-21.779,18.314],[-18.312,21.779],[18.313,21.779],[21.779,18.314],[21.779,-18.313]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.427451010311,0.976470648074,1],"ix":4},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":5,"s":[10]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":14.99,"s":[100]},{"t":24.9800010174563,"s":[10]}],"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[22.028,22.029],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":47.0000019143492,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Triangle 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[116.25,200.703,0],"ix":2},"a":{"a":0,"k":[27.11,21.243,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0.558,-0.879],[0,0],[-1.133,0],[0,0],[0.609,0.947],[0,0]],"o":[[-0.558,-0.879],[0,0],[-0.609,0.947],[0,0],[1.133,0],[0,0],[0,0]],"v":[[1.209,-20.114],[-1.192,-20.114],[-26.251,18.795],[-25.051,20.993],[25.051,20.993],[26.251,18.795],[1.192,-20.114]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.427451010311,0.976470648074,1],"ix":4},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[10]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":9.99,"s":[100]},{"t":19.9800008138021,"s":[10]}],"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[27.11,21.243],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":48.0000019550801,"st":0,"bm":0}],"markers":[]}+ })+ </script>+ "#))++ h3 style="text-align: center;" { "Please wait while we process your payment..." }++ // (PreEscaped(r#"+ // <iframe id="challengeFrame" name="challengeFrame"; width: 400px; height: 400px;"></iframe>+ // "#))++ (PreEscaped(format!(r#"<form id="challengeForm" method="POST" action={base_url}>+ <input type="hidden" name="JWT" value="{jwt}">+ </form>"#)))++ (PreEscaped(format!("<script>+ {logging_template}+ window.onload = function() {{+ var challengeFormSetup = document.querySelector('#challengeForm');+ if (challengeFormSetup) {{+ challengeFormSetup.submit();+ }}+ }}+ </script>")))+ }+ }+ }+ }}}diff --git a/loadtest/config/development.toml b/loadtest/config/development.tomlindex 77f69c4cd7..9a1e5c94b3 100644--- a/loadtest/config/development.toml+++ b/loadtest/config/development.toml@@ -223,6 +223,7 @@ worldpayvantiv.base_url = "https://transact.vantivprelive.com/vap/communicator/oworldpayvantiv.secondary_base_url = "https://onlinessr.vantivprelive.com"worldpayvantiv.third_base_url = "https://services.vantivprelive.com"worldpayxml.base_url = "https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp"+worldpayxml.secondary_base_url = "https://secure-test.worldpay.com/shopper/3ds/challenge.html"xendit.base_url = "https://api.xendit.co"zift.base_url = "https://sandbox-secure.zift.io/"wise.base_url = "https://api.sandbox.transferwise.tech/"