Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

feat(connectors): fiuu,novalnet,worldpay - extend NTI flows (#6946)

Kashifd6b0660569eb
diff --git a/config/config.example.toml b/config/config.example.toml
index 821e854c9f..c860420da3 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -802,7 +802,7 @@ check_token_status_url= "" # base url to check token status from token servic
connector_list = "cybersource" # Supported connectors for network tokenization
[network_transaction_id_supported_connectors]
-connector_list = "stripe,adyen,cybersource" # Supported connectors for network transaction id
+connector_list = "adyen,cybersource,novalnet,stripe,worldpay" # Supported connectors for network transaction id
[grpc_client.dynamic_routing_client] # Dynamic Routing Client Configuration
host = "localhost" # Client Host
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index 6283382258..b6e487e5a3 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -191,7 +191,7 @@ card.credit = { connector_list = "cybersource" } # Update Mandate sup
card.debit = { connector_list = "cybersource" } # Update Mandate supported payment method type and connector for card
[network_transaction_id_supported_connectors]
-connector_list = "stripe,adyen,cybersource"
+connector_list = "adyen,cybersource,novalnet,stripe,worldpay"
[payouts]
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index fcfadb339d..7242f26367 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -191,7 +191,7 @@ card.credit = { connector_list = "cybersource" } # Update Mandate sup
card.debit = { connector_list = "cybersource" } # Update Mandate supported payment method type and connector for card
[network_transaction_id_supported_connectors]
-connector_list = "stripe,adyen,cybersource"
+connector_list = "adyen,cybersource,novalnet,stripe,worldpay"
[payouts]
diff --git a/config/development.toml b/config/development.toml
index 08520a2a85..a32102aeeb 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -653,7 +653,7 @@ card.credit = { connector_list = "cybersource" }
card.debit = { connector_list = "cybersource" }
[network_transaction_id_supported_connectors]
-connector_list = "stripe,adyen,cybersource"
+connector_list = "adyen,cybersource,novalnet,stripe,worldpay"
[connector_request_reference_id_config]
merchant_ids_send_payment_id_as_connector_request_id = []
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 6f95380d2d..cfdf4b0e0c 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -540,7 +540,7 @@ card.credit = { connector_list = "cybersource" }
card.debit = { connector_list = "cybersource" }
[network_transaction_id_supported_connectors]
-connector_list = "stripe,adyen,cybersource"
+connector_list = "adyen,cybersource,novalnet,stripe,worldpay"
[connector_customer]
connector_list = "gocardless,stax,stripe"
diff --git a/crates/hyperswitch_connectors/src/connectors/fiuu.rs b/crates/hyperswitch_connectors/src/connectors/fiuu.rs
index 3ea8793d9f..70bca41582 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiuu.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiuu.rs
@@ -254,16 +254,23 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
req: &PaymentsAuthorizeRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
- let url = if req.request.off_session == Some(true) {
- format!(
+ let optional_is_mit_flow = req.request.off_session;
+ let optional_is_nti_flow = req
+ .request
+ .mandate_id
+ .as_ref()
+ .map(|mandate_id| mandate_id.is_network_transaction_id_flow());
+ let url = match (optional_is_mit_flow, optional_is_nti_flow) {
+ (Some(true), Some(false)) => format!(
"{}/RMS/API/Recurring/input_v7.php",
self.base_url(connectors)
- )
- } else {
- format!(
- "{}RMS/API/Direct/1.4.0/index.php",
- self.base_url(connectors)
- )
+ ),
+ _ => {
+ format!(
+ "{}RMS/API/Direct/1.4.0/index.php",
+ self.base_url(connectors)
+ )
+ }
};
Ok(url)
}
@@ -280,14 +287,24 @@ impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData
)?;
let connector_router_data = fiuu::FiuuRouterData::from((amount, req));
- let connector_req = if req.request.off_session == Some(true) {
- let recurring_request = fiuu::FiuuMandateRequest::try_from(&connector_router_data)?;
- build_form_from_struct(recurring_request)
- .change_context(errors::ConnectorError::ParsingFailed)?
- } else {
- let payment_request = fiuu::FiuuPaymentRequest::try_from(&connector_router_data)?;
- build_form_from_struct(payment_request)
- .change_context(errors::ConnectorError::ParsingFailed)?
+ let optional_is_mit_flow = req.request.off_session;
+ let optional_is_nti_flow = req
+ .request
+ .mandate_id
+ .as_ref()
+ .map(|mandate_id| mandate_id.is_network_transaction_id_flow());
+
+ let connector_req = match (optional_is_mit_flow, optional_is_nti_flow) {
+ (Some(true), Some(false)) => {
+ let recurring_request = fiuu::FiuuMandateRequest::try_from(&connector_router_data)?;
+ build_form_from_struct(recurring_request)
+ .change_context(errors::ConnectorError::ParsingFailed)?
+ }
+ _ => {
+ let payment_request = fiuu::FiuuPaymentRequest::try_from(&connector_router_data)?;
+ build_form_from_struct(payment_request)
+ .change_context(errors::ConnectorError::ParsingFailed)?
+ }
};
Ok(RequestContent::FormData(connector_req))
}
diff --git a/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs b/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
index e914454e55..51fc23eee4 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
@@ -14,8 +14,8 @@ use common_utils::{
use error_stack::{Report, ResultExt};
use hyperswitch_domain_models::{
payment_method_data::{
- BankRedirectData, Card, GooglePayWalletData, PaymentMethodData, RealTimePaymentData,
- WalletData,
+ BankRedirectData, Card, CardDetailsForNetworkTransactionId, GooglePayWalletData,
+ PaymentMethodData, RealTimePaymentData, WalletData,
},
router_data::{
ApplePayPredecryptData, ConnectorAuthType, ErrorResponse, PaymentMethodToken, RouterData,
@@ -287,6 +287,7 @@ pub struct FiuuPaymentRequest {
pub enum FiuuPaymentMethodData {
FiuuQRData(Box<FiuuQRData>),
FiuuCardData(Box<FiuuCardData>),
+ FiuuCardWithNTI(Box<FiuuCardWithNTI>),
FiuuFpxData(Box<FiuuFPXData>),
FiuuGooglePayData(Box<FiuuGooglePayData>),
FiuuApplePayData(Box<FiuuApplePayData>),
@@ -322,6 +323,18 @@ pub struct FiuuCardData {
customer_email: Option<Email>,
}
+#[derive(Serialize, Debug, Clone)]
+#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
+pub struct FiuuCardWithNTI {
+ #[serde(rename = "TxnChannel")]
+ txn_channel: TxnChannel,
+ cc_pan: CardNumber,
+ cc_month: Secret<String>,
+ cc_year: Secret<String>,
+ #[serde(rename = "OriginalSchemeID")]
+ original_scheme_id: Secret<String>,
+}
+
#[derive(Serialize, Debug, Clone)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub struct FiuuApplePayData {
@@ -412,125 +425,150 @@ impl TryFrom<&FiuuRouterData<&PaymentsAuthorizeRouterData>> for FiuuPaymentReque
Url::parse(&item.router_data.request.get_webhook_url()?)
.change_context(errors::ConnectorError::RequestEncodingFailed)?,
);
- let payment_method_data = match item.router_data.request.payment_method_data {
- PaymentMethodData::Card(ref card) => {
- FiuuPaymentMethodData::try_from((card, item.router_data))
- }
- PaymentMethodData::RealTimePayment(ref real_time_payment_data) => {
- match *real_time_payment_data.clone() {
- RealTimePaymentData::DuitNow {} => {
- Ok(FiuuPaymentMethodData::FiuuQRData(Box::new(FiuuQRData {
- txn_channel: TxnChannel::RppDuitNowQr,
+ let payment_method_data = match item
+ .router_data
+ .request
+ .mandate_id
+ .clone()
+ .and_then(|mandate_id| mandate_id.mandate_reference_id)
+ {
+ None => match item.router_data.request.payment_method_data {
+ PaymentMethodData::Card(ref card) => {
+ FiuuPaymentMethodData::try_from((card, item.router_data))
+ }
+ PaymentMethodData::RealTimePayment(ref real_time_payment_data) => {
+ match *real_time_payment_data.clone() {
+ RealTimePaymentData::DuitNow {} => {
+ Ok(FiuuPaymentMethodData::FiuuQRData(Box::new(FiuuQRData {
+ txn_channel: TxnChannel::RppDuitNowQr,
+ })))
+ }
+ RealTimePaymentData::Fps {}
+ | RealTimePaymentData::PromptPay {}
+ | RealTimePaymentData::VietQr {} => {
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("fiuu"),
+ )
+ .into())
+ }
+ }
+ }
+ PaymentMethodData::BankRedirect(ref bank_redirect_data) => match bank_redirect_data
+ {
+ BankRedirectData::OnlineBankingFpx { ref issuer } => {
+ Ok(FiuuPaymentMethodData::FiuuFpxData(Box::new(FiuuFPXData {
+ txn_channel: FPXTxnChannel::try_from(*issuer)?,
+ non_3ds,
})))
}
- RealTimePaymentData::Fps {}
- | RealTimePaymentData::PromptPay {}
- | RealTimePaymentData::VietQr {} => {
+ BankRedirectData::BancontactCard { .. }
+ | BankRedirectData::Bizum {}
+ | BankRedirectData::Blik { .. }
+ | BankRedirectData::Eps { .. }
+ | BankRedirectData::Giropay { .. }
+ | BankRedirectData::Ideal { .. }
+ | BankRedirectData::Interac { .. }
+ | BankRedirectData::OnlineBankingCzechRepublic { .. }
+ | BankRedirectData::OnlineBankingFinland { .. }
+ | BankRedirectData::OnlineBankingPoland { .. }
+ | BankRedirectData::OnlineBankingSlovakia { .. }
+ | BankRedirectData::OpenBankingUk { .. }
+ | BankRedirectData::Przelewy24 { .. }
+ | BankRedirectData::Sofort { .. }
+ | BankRedirectData::Trustly { .. }
+ | BankRedirectData::OnlineBankingThailand { .. }
+ | BankRedirectData::LocalBankRedirect {} => {
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("fiuu"),
)
.into())
}
- }
- }
- PaymentMethodData::BankRedirect(ref bank_redirect_data) => match bank_redirect_data {
- BankRedirectData::OnlineBankingFpx { ref issuer } => {
- Ok(FiuuPaymentMethodData::FiuuFpxData(Box::new(FiuuFPXData {
- txn_channel: FPXTxnChannel::try_from(*issuer)?,
- non_3ds,
- })))
- }
- BankRedirectData::BancontactCard { .. }
- | BankRedirectData::Bizum {}
- | BankRedirectData::Blik { .. }
- | BankRedirectData::Eps { .. }
- | BankRedirectData::Giropay { .. }
- | BankRedirectData::Ideal { .. }
- | BankRedirectData::Interac { .. }
- | BankRedirectData::OnlineBankingCzechRepublic { .. }
- | BankRedirectData::OnlineBankingFinland { .. }
- | BankRedirectData::OnlineBankingPoland { .. }
- | BankRedirectData::OnlineBankingSlovakia { .. }
- | BankRedirectData::OpenBankingUk { .. }
- | BankRedirectData::Przelewy24 { .. }
- | BankRedirectData::Sofort { .. }
- | BankRedirectData::Trustly { .. }
- | BankRedirectData::OnlineBankingThailand { .. }
- | BankRedirectData::LocalBankRedirect {} => {
+ },
+ PaymentMethodData::Wallet(ref wallet_data) => match wallet_data {
+ WalletData::GooglePay(google_pay_data) => {
+ FiuuPaymentMethodData::try_from(google_pay_data)
+ }
+ WalletData::ApplePay(_apple_pay_data) => {
+ let payment_method_token = item.router_data.get_payment_method_token()?;
+ match payment_method_token {
+ PaymentMethodToken::Token(_) => {
+ Err(unimplemented_payment_method!("Apple Pay", "Manual", "Fiuu"))?
+ }
+ PaymentMethodToken::ApplePayDecrypt(decrypt_data) => {
+ FiuuPaymentMethodData::try_from(decrypt_data)
+ }
+ PaymentMethodToken::PazeDecrypt(_) => {
+ Err(unimplemented_payment_method!("Paze", "Fiuu"))?
+ }
+ }
+ }
+ WalletData::AliPayQr(_)
+ | WalletData::AliPayRedirect(_)
+ | WalletData::AliPayHkRedirect(_)
+ | WalletData::MomoRedirect(_)
+ | WalletData::KakaoPayRedirect(_)
+ | WalletData::GoPayRedirect(_)
+ | WalletData::GcashRedirect(_)
+ | WalletData::ApplePayRedirect(_)
+ | WalletData::ApplePayThirdPartySdk(_)
+ | WalletData::DanaRedirect {}
+ | WalletData::GooglePayRedirect(_)
+ | WalletData::GooglePayThirdPartySdk(_)
+ | WalletData::MbWayRedirect(_)
+ | WalletData::MobilePayRedirect(_)
+ | WalletData::PaypalRedirect(_)
+ | WalletData::PaypalSdk(_)
+ | WalletData::Paze(_)
+ | WalletData::SamsungPay(_)
+ | WalletData::TwintRedirect {}
+ | WalletData::VippsRedirect {}
+ | WalletData::TouchNGoRedirect(_)
+ | WalletData::WeChatPayRedirect(_)
+ | WalletData::WeChatPayQr(_)
+ | WalletData::CashappQr(_)
+ | WalletData::SwishQr(_)
+ | WalletData::Mifinity(_) => Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("fiuu"),
+ )
+ .into()),
+ },
+ PaymentMethodData::CardRedirect(_)
+ | PaymentMethodData::PayLater(_)
+ | PaymentMethodData::BankDebit(_)
+ | PaymentMethodData::BankTransfer(_)
+ | PaymentMethodData::Crypto(_)
+ | PaymentMethodData::MandatePayment
+ | PaymentMethodData::MobilePayment(_)
+ | PaymentMethodData::Reward
+ | PaymentMethodData::Upi(_)
+ | PaymentMethodData::Voucher(_)
+ | PaymentMethodData::GiftCard(_)
+ | PaymentMethodData::CardToken(_)
+ | PaymentMethodData::OpenBanking(_)
+ | PaymentMethodData::NetworkToken(_)
+ | PaymentMethodData::CardDetailsForNetworkTransactionId(_) => {
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("fiuu"),
)
.into())
}
},
- PaymentMethodData::Wallet(ref wallet_data) => match wallet_data {
- WalletData::GooglePay(google_pay_data) => {
- FiuuPaymentMethodData::try_from(google_pay_data)
- }
- WalletData::ApplePay(_apple_pay_data) => {
- let payment_method_token = item.router_data.get_payment_method_token()?;
- match payment_method_token {
- PaymentMethodToken::Token(_) => {
- Err(unimplemented_payment_method!("Apple Pay", "Manual", "Fiuu"))?
- }
- PaymentMethodToken::ApplePayDecrypt(decrypt_data) => {
- FiuuPaymentMethodData::try_from(decrypt_data)
- }
- PaymentMethodToken::PazeDecrypt(_) => {
- Err(unimplemented_payment_method!("Paze", "Fiuu"))?
- }
+ // Card payments using network transaction ID
+ Some(payments::MandateReferenceId::NetworkMandateId(network_transaction_id)) => {
+ match item.router_data.request.payment_method_data {
+ PaymentMethodData::CardDetailsForNetworkTransactionId(ref raw_card_details) => {
+ FiuuPaymentMethodData::try_from((raw_card_details, network_transaction_id))
}
+ _ => Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("fiuu"),
+ )
+ .into()),
}
- WalletData::AliPayQr(_)
- | WalletData::AliPayRedirect(_)
- | WalletData::AliPayHkRedirect(_)
- | WalletData::MomoRedirect(_)
- | WalletData::KakaoPayRedirect(_)
- | WalletData::GoPayRedirect(_)
- | WalletData::GcashRedirect(_)
- | WalletData::ApplePayRedirect(_)
- | WalletData::ApplePayThirdPartySdk(_)
- | WalletData::DanaRedirect {}
- | WalletData::GooglePayRedirect(_)
- | WalletData::GooglePayThirdPartySdk(_)
- | WalletData::MbWayRedirect(_)
- | WalletData::MobilePayRedirect(_)
- | WalletData::PaypalRedirect(_)
- | WalletData::PaypalSdk(_)
- | WalletData::Paze(_)
- | WalletData::SamsungPay(_)
- | WalletData::TwintRedirect {}
- | WalletData::VippsRedirect {}
- | WalletData::TouchNGoRedirect(_)
- | WalletData::WeChatPayRedirect(_)
- | WalletData::WeChatPayQr(_)
- | WalletData::CashappQr(_)
- | WalletData::SwishQr(_)
- | WalletData::Mifinity(_) => Err(errors::ConnectorError::NotImplemented(
- utils::get_unimplemented_payment_method_error_message("fiuu"),
- )
- .into()),
- },
- PaymentMethodData::CardRedirect(_)
- | PaymentMethodData::PayLater(_)
- | PaymentMethodData::BankDebit(_)
- | PaymentMethodData::BankTransfer(_)
- | PaymentMethodData::Crypto(_)
- | PaymentMethodData::MandatePayment
- | PaymentMethodData::MobilePayment(_)
- | PaymentMethodData::Reward
- | PaymentMethodData::Upi(_)
- | PaymentMethodData::Voucher(_)
- | PaymentMethodData::GiftCard(_)
- | PaymentMethodData::CardToken(_)
- | PaymentMethodData::OpenBanking(_)
- | PaymentMethodData::NetworkToken(_)
- | PaymentMethodData::CardDetailsForNetworkTransactionId(_) => {
- Err(errors::ConnectorError::NotImplemented(
- utils::get_unimplemented_payment_method_error_message("fiuu"),
- )
- .into())
}
+ _ => Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("fiuu"),
+ )
+ .into()),
}?;
Ok(Self {
@@ -556,7 +594,7 @@ impl TryFrom<(&Card, &PaymentsAuthorizeRouterData)> for FiuuPaymentMethodData {
if item.request.is_customer_initiated_mandate_payment() {
(Some(1), Some(item.get_billing_email()?))
} else {
- (None, None)
+ (Some(3), None)
};
let non_3ds = match item.is_three_ds() {
false => 1,
@@ -575,6 +613,21 @@ impl TryFrom<(&Card, &PaymentsAuthorizeRouterData)> for FiuuPaymentMethodData {
}
}
+impl TryFrom<(&CardDetailsForNetworkTransactionId, String)> for FiuuPaymentMethodData {
+ type Error = Report<errors::ConnectorError>;
+ fn try_from(
+ (raw_card_data, network_transaction_id): (&CardDetailsForNetworkTransactionId, String),
+ ) -> Result<Self, Self::Error> {
+ Ok(Self::FiuuCardWithNTI(Box::new(FiuuCardWithNTI {
+ txn_channel: TxnChannel::Creditan,
+ cc_pan: raw_card_data.card_number.clone(),
+ cc_month: raw_card_data.card_exp_month.clone(),
+ cc_year: raw_card_data.card_exp_year.clone(),
+ original_scheme_id: Secret::new(network_transaction_id),
+ })))
+ }
+}
+
impl TryFrom<&GooglePayWalletData> for FiuuPaymentMethodData {
type Error = Report<errors::ConnectorError>;
fn try_from(data: &GooglePayWalletData) -> Result<Self, Self::Error> {
@@ -1092,6 +1145,8 @@ pub struct FiuuPaymentSyncResponse {
error_desc: String,
#[serde(rename = "miscellaneous")]
miscellaneous: Option<HashMap<String, Secret<String>>>,
+ #[serde(rename = "SchemeTransactionID")]
+ scheme_transaction_id: Option<Secret<String>>,
}
#[derive(Debug, Serialize, Deserialize, Display, Clone, PartialEq)]
@@ -1183,7 +1238,10 @@ impl TryFrom<PaymentsSyncResponseRouterData<FiuuPaymentResponse>> for PaymentsSy
redirection_data: Box::new(None),
mandate_reference: Box::new(None),
connector_metadata: None,
- network_txn_id: None,
+ network_txn_id: response
+ .scheme_transaction_id
+ .as_ref()
+ .map(|id| id.clone().expose()),
connector_response_reference_id: None,
incremental_authorization_allowed: None,
charge_id: None,
diff --git a/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs b/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
index d62d3d2a75..6d3199ecf1 100644
--- a/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
@@ -102,6 +102,13 @@ pub struct NovalnetCard {
card_holder: Secret<String>,
}
+#[derive(Default, Debug, Clone, Serialize, Deserialize)]
+pub struct NovalnetRawCardDetails {
+ card_number: CardNumber,
+ card_expiry_month: Secret<String>,
+ card_expiry_year: Secret<String>,
+}
+
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct NovalnetMandate {
token: Secret<String>,
@@ -121,6 +128,7 @@ pub struct NovalnetApplePay {
#[serde(untagged)]
pub enum NovalNetPaymentData {
Card(NovalnetCard),
+ RawCardForNTI(NovalnetRawCardDetails),
GooglePay(NovalnetGooglePay),
ApplePay(NovalnetApplePay),
MandatePayment(NovalnetMandate),
@@ -151,6 +159,7 @@ pub struct NovalnetPaymentsRequestTransaction {
error_return_url: Option<String>,
enforce_3d: Option<i8>, //NOTE: Needed for CREDITCARD, GOOGLEPAY
create_token: Option<i8>,
+ scheme_tid: Option<Secret<String>>, // Card network's transaction ID
}
#[derive(Debug, Serialize, Clone)]
@@ -261,6 +270,7 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym
payment_data: Some(novalnet_card),
enforce_3d,
create_token,
+ scheme_tid: None,
};
Ok(Self {
@@ -292,6 +302,7 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym
payment_data: Some(novalnet_google_pay),
enforce_3d,
create_token,
+ scheme_tid: None,
};
Ok(Self {
@@ -317,6 +328,7 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym
})),
enforce_3d: None,
create_token,
+ scheme_tid: None,
};
Ok(Self {
@@ -358,6 +370,7 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym
payment_data: None,
enforce_3d: None,
create_token,
+ scheme_tid: None,
};
Ok(Self {
merchant,
@@ -416,6 +429,7 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym
payment_data: Some(novalnet_mandate_data),
enforce_3d,
create_token: None,
+ scheme_tid: None,
};
Ok(Self {
@@ -425,6 +439,44 @@ impl TryFrom<&NovalnetRouterData<&PaymentsAuthorizeRouterData>> for NovalnetPaym
custom,
})
}
+ Some(api_models::payments::MandateReferenceId::NetworkMandateId(
+ network_transaction_id,
+ )) => match item.router_data.request.payment_method_data {
+ PaymentMethodData::CardDetailsForNetworkTransactionId(ref raw_card_details) => {
+ let novalnet_card =
+ NovalNetPaymentData::RawCardForNTI(NovalnetRawCardDetails {
+ card_number: raw_card_details.card_number.clone(),
+ card_expiry_month: raw_card_details.card_exp_month.clone(),
+ card_expiry_year: raw_card_details.card_exp_year.clone(),
+ });
+
+ let transaction = NovalnetPaymentsRequestTransaction {
+ test_mode,
+ payment_type: NovalNetPaymentTypes::CREDITCARD,
+ amount: NovalNetAmount::StringMinor(item.amount.clone()),
+ currency: item.router_data.request.currency,
+ order_no: item.router_data.connector_request_reference_id.clone(),
+ hook_url: Some(hook_url),
+ return_url: Some(return_url.clone()),
+ error_return_url: Some(return_url.clone()),
+ payment_data: Some(novalnet_card),
+ enforce_3d,
+ create_token,
+ scheme_tid: Some(network_transaction_id.into()),
+ };
+
+ Ok(Self {
+ merchant,
+ transaction,
+ customer,
+ custom,
+ })
+ }
+ _ => Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("novalnet"),
+ )
+ .into()),
+ },
_ => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("novalnet"),
)
@@ -1466,6 +1518,7 @@ impl TryFrom<&SetupMandateRouterData> for NovalnetPaymentsRequest {
payment_data: Some(novalnet_card),
enforce_3d,
create_token,
+ scheme_tid: None,
};
Ok(Self {
@@ -1495,6 +1548,7 @@ impl TryFrom<&SetupMandateRouterData> for NovalnetPaymentsRequest {
payment_data: Some(novalnet_google_pay),
enforce_3d,
create_token,
+ scheme_tid: None,
};
Ok(Self {
@@ -1519,6 +1573,7 @@ impl TryFrom<&SetupMandateRouterData> for NovalnetPaymentsRequest {
})),
enforce_3d: None,
create_token,
+ scheme_tid: None,
};
Ok(Self {
@@ -1559,7 +1614,9 @@ impl TryFrom<&SetupMandateRouterData> for NovalnetPaymentsRequest {
payment_data: None,
enforce_3d: None,
create_token,
+ scheme_tid: None,
};
+
Ok(Self {
merchant,
transaction,
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay.rs b/crates/hyperswitch_connectors/src/connectors/worldpay.rs
index 07e4c178f9..104e854e6f 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay.rs
@@ -1199,6 +1199,42 @@ impl IncomingWebhook for Worldpay {
let psync_body = WorldpayEventResponse::try_from(body)?;
Ok(Box::new(psync_body))
}
+
+ fn get_mandate_details(
+ &self,
+ request: &IncomingWebhookRequestDetails<'_>,
+ ) -> CustomResult<
+ Option<hyperswitch_domain_models::router_flow_types::ConnectorMandateDetails>,
+ errors::ConnectorError,
+ > {
+ let body: WorldpayWebhookTransactionId = request
+ .body
+ .parse_struct("WorldpayWebhookTransactionId")
+ .change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?;
+ let mandate_reference = body.event_details.token.map(|mandate_token| {
+ hyperswitch_domain_models::router_flow_types::ConnectorMandateDetails {
+ connector_mandate_id: mandate_token.href,
+ }
+ });
+ Ok(mandate_reference)
+ }
+
+ fn get_network_txn_id(
+ &self,
+ request: &IncomingWebhookRequestDetails<'_>,
+ ) -> CustomResult<
+ Option<hyperswitch_domain_models::router_flow_types::ConnectorNetworkTxnId>,
+ errors::ConnectorError,
+ > {
+ let body: WorldpayWebhookTransactionId = request
+ .body
+ .parse_struct("WorldpayWebhookTransactionId")
+ .change_context(errors::ConnectorError::WebhookReferenceIdNotFound)?;
+ let optional_network_txn_id = body.event_details.scheme_reference.map(|network_txn_id| {
+ hyperswitch_domain_models::router_flow_types::ConnectorNetworkTxnId::new(network_txn_id)
+ });
+ Ok(optional_network_txn_id)
+ }
}
impl ConnectorRedirectResponse for Worldpay {
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs
index 884caa9e84..52ae2c4f16 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/requests.rs
@@ -52,18 +52,22 @@ pub enum TokenCreationType {
Worldpay,
}
+#[serde_with::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CustomerAgreement {
#[serde(rename = "type")]
pub agreement_type: CustomerAgreementType,
- pub stored_card_usage: StoredCardUsageType,
+ pub stored_card_usage: Option<StoredCardUsageType>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub scheme_reference: Option<Secret<String>>,
}
#[derive(Clone, Debug, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum CustomerAgreementType {
Subscription,
+ Unscheduled,
}
#[derive(Clone, Debug, PartialEq, Serialize)]
@@ -78,6 +82,7 @@ pub enum StoredCardUsageType {
pub enum PaymentInstrument {
Card(CardPayment),
CardToken(CardToken),
+ RawCardForNTI(RawCardDetails),
Googlepay(WalletPayment),
Applepay(WalletPayment),
}
@@ -85,15 +90,22 @@ pub enum PaymentInstrument {
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CardPayment {
- #[serde(rename = "type")]
- pub payment_type: PaymentType,
+ #[serde(flatten)]
+ pub raw_card_details: RawCardDetails,
+ pub cvc: Secret<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card_holder_name: Option<Secret<String>>,
- pub card_number: cards::CardNumber,
- pub expiry_date: ExpiryDate,
#[serde(skip_serializing_if = "Option::is_none")]
pub billing_address: Option<BillingAddress>,
- pub cvc: Secret<String>,
+}
+
+#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct RawCardDetails {
+ #[serde(rename = "type")]
+ pub payment_type: PaymentType,
+ pub card_number: cards::CardNumber,
+ pub expiry_date: ExpiryDate,
}
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs
index 5e9fb03042..b4d6a37040 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs
@@ -43,6 +43,8 @@ pub struct AuthorizedResponse {
pub fraud: Option<Fraud>,
/// Mandate's token
pub token: Option<MandateToken>,
+ /// Network transaction ID
+ pub scheme_reference: Option<Secret<String>>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
@@ -429,9 +431,13 @@ pub struct WorldpayWebhookTransactionId {
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EventDetails {
- pub transaction_reference: String,
#[serde(rename = "type")]
pub event_type: EventType,
+ pub transaction_reference: String,
+ /// Mandate's token
+ pub token: Option<MandateToken>,
+ /// Network transaction ID
+ pub scheme_reference: Option<Secret<String>>,
}
#[derive(Debug, Serialize, Deserialize)]
diff --git a/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs
index ec23b520a2..cd028e81ef 100644
--- a/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/worldpay/transformers.rs
@@ -76,12 +76,14 @@ fn fetch_payment_instrument(
) -> CustomResult<PaymentInstrument, errors::ConnectorError> {
match payment_method {
PaymentMethodData::Card(card) => Ok(PaymentInstrument::Card(CardPayment {
- payment_type: PaymentType::Plain,
- expiry_date: ExpiryDate {
- month: card.get_expiry_month_as_i8()?,
- year: card.get_expiry_year_as_4_digit_i32()?,
+ raw_card_details: RawCardDetails {
+ payment_type: PaymentType::Plain,
+ expiry_date: ExpiryDate {
+ month: card.get_expiry_month_as_i8()?,
+ year: card.get_expiry_year_as_4_digit_i32()?,
+ },
+ card_number: card.card_number,
},
- card_number: card.card_number,
cvc: card.card_cvc,
card_holder_name: billing_address.and_then(|address| address.get_optional_full_name()),
billing_address: if let Some(address) =
@@ -107,6 +109,16 @@ fn fetch_payment_instrument(
None
},
})),
+ PaymentMethodData::CardDetailsForNetworkTransactionId(raw_card_details) => {
+ Ok(PaymentInstrument::RawCardForNTI(RawCardDetails {
+ payment_type: PaymentType::Plain,
+ expiry_date: ExpiryDate {
+ month: raw_card_details.get_expiry_month_as_i8()?,
+ year: raw_card_details.get_expiry_year_as_4_digit_i32()?,
+ },
+ card_number: raw_card_details.card_number,
+ }))
+ }
PaymentMethodData::MandatePayment => mandate_ids
.and_then(|mandate_ids| {
mandate_ids
@@ -185,13 +197,10 @@ fn fetch_payment_instrument(
| PaymentMethodData::GiftCard(_)
| PaymentMethodData::OpenBanking(_)
| PaymentMethodData::CardToken(_)
- | PaymentMethodData::NetworkToken(_)
- | PaymentMethodData::CardDetailsForNetworkTransactionId(_) => {
- Err(errors::ConnectorError::NotImplemented(
- utils::get_unimplemented_payment_method_error_message("worldpay"),
- )
- .into())
- }
+ | PaymentMethodData::NetworkToken(_) => Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("worldpay"),
+ )
+ .into()),
}
}
@@ -439,6 +448,7 @@ fn get_token_and_agreement(
payment_method_data: &PaymentMethodData,
setup_future_usage: Option<enums::FutureUsage>,
off_session: Option<bool>,
+ mandate_ids: Option<MandateIds>,
) -> (Option<TokenCreation>, Option<CustomerAgreement>) {
match (payment_method_data, setup_future_usage, off_session) {
// CIT
@@ -448,7 +458,8 @@ fn get_token_and_agreement(
}),
Some(CustomerAgreement {
agreement_type: CustomerAgreementType::Subscription,
- stored_card_usage: StoredCardUsageType::First,
+ stored_card_usage: Some(StoredCardUsageType::First),
+ scheme_reference: None,
}),
),
// MIT
@@ -456,7 +467,26 @@ fn get_token_and_agreement(
None,
Some(CustomerAgreement {
agreement_type: CustomerAgreementType::Subscription,
- stored_card_usage: StoredCardUsageType::Subsequent,
+ stored_card_usage: Some(StoredCardUsageType::Subsequent),
+ scheme_reference: None,
+ }),
+ ),
+ // NTI with raw card data
+ (PaymentMethodData::CardDetailsForNetworkTransactionId(_), _, _) => (
+ None,
+ mandate_ids.and_then(|mandate_ids| {
+ mandate_ids
+ .mandate_reference_id
+ .and_then(|mandate_id| match mandate_id {
+ MandateReferenceId::NetworkMandateId(network_transaction_id) => {
+ Some(CustomerAgreement {
+ agreement_type: CustomerAgreementType::Unscheduled,
+ scheme_reference: Some(network_transaction_id.into()),
+ stored_card_usage: None,
+ })
+ }
+ _ => None,
+ })
}),
),
_ => (None, None),
@@ -487,6 +517,7 @@ impl<T: WorldpayPaymentsRequestData> TryFrom<(&WorldpayRouterData<&T>, &Secret<S
item.router_data.get_payment_method_data(),
item.router_data.get_setup_future_usage(),
item.router_data.get_off_session(),
+ item.router_data.get_mandate_id(),
);
Ok(Self {
@@ -646,7 +677,7 @@ impl<F, T>
),
) -> Result<Self, Self::Error> {
let (router_data, optional_correlation_id) = item;
- let (description, redirection_data, mandate_reference, error) = router_data
+ let (description, redirection_data, mandate_reference, network_txn_id, error) = router_data
.response
.other_fields
.as_ref()
@@ -660,6 +691,7 @@ impl<F, T>
mandate_metadata: None,
connector_mandate_request_reference_id: None,
}),
+ res.scheme_reference.clone(),
None,
),
WorldpayPaymentResponseFields::DDCResponse(res) => (
@@ -681,6 +713,7 @@ impl<F, T>
}),
None,
None,
+ None,
),
WorldpayPaymentResponseFields::ThreeDsChallenged(res) => (
None,
@@ -694,16 +727,18 @@ impl<F, T>
}),
None,
None,
+ None,
),
WorldpayPaymentResponseFields::RefusedResponse(res) => (
None,
None,
None,
+ None,
Some((res.refusal_code.clone(), res.refusal_description.clone())),
),
- WorldpayPaymentResponseFields::FraudHighRisk(_) => (None, None, None, None),
+ WorldpayPaymentResponseFields::FraudHighRisk(_) => (None, None, None, None, None),
})
- .unwrap_or((None, None, None, None));
+ .unwrap_or((None, None, None, None, None));
let worldpay_status = router_data.response.outcome.clone();
let optional_error_message = match worldpay_status {
PaymentOutcome::ThreeDsAuthenticationFailed => {
@@ -725,7 +760,7 @@ impl<F, T>
redirection_data: Box::new(redirection_data),
mandate_reference: Box::new(mandate_reference),
connector_metadata: None,
- network_txn_id: None,
+ network_txn_id: network_txn_id.map(|id| id.expose()),
connector_response_reference_id: optional_correlation_id.clone(),
incremental_authorization_allowed: None,
charge_id: None,
diff --git a/crates/hyperswitch_connectors/src/utils.rs b/crates/hyperswitch_connectors/src/utils.rs
index 190a4eb256..671aed3637 100644
--- a/crates/hyperswitch_connectors/src/utils.rs
+++ b/crates/hyperswitch_connectors/src/utils.rs
@@ -17,7 +17,7 @@ use common_utils::{
use error_stack::{report, ResultExt};
use hyperswitch_domain_models::{
address::{Address, AddressDetails, PhoneDetails},
- payment_method_data::{self, Card, PaymentMethodData},
+ payment_method_data::{self, Card, CardDetailsForNetworkTransactionId, PaymentMethodData},
router_data::{
ApplePayPredecryptData, ErrorResponse, PaymentMethodToken, RecurringMandatePaymentData,
},
@@ -1040,6 +1040,97 @@ impl CardData for Card {
}
}
+impl CardData for CardDetailsForNetworkTransactionId {
+ fn get_card_expiry_year_2_digit(&self) -> Result<Secret<String>, errors::ConnectorError> {
+ let binding = self.card_exp_year.clone();
+ let year = binding.peek();
+ Ok(Secret::new(
+ year.get(year.len() - 2..)
+ .ok_or(errors::ConnectorError::RequestEncodingFailed)?
+ .to_string(),
+ ))
+ }
+ fn get_card_issuer(&self) -> Result<CardIssuer, Error> {
+ get_card_issuer(self.card_number.peek())
+ }
+ fn get_card_expiry_month_year_2_digit_with_delimiter(
+ &self,
+ delimiter: String,
+ ) -> Result<Secret<String>, errors::ConnectorError> {
+ let year = self.get_card_expiry_year_2_digit()?;
+ Ok(Secret::new(format!(
+ "{}{}{}",
+ self.card_exp_month.peek(),
+ delimiter,
+ year.peek()
+ )))
+ }
+ fn get_expiry_date_as_yyyymm(&self, delimiter: &str) -> Secret<String> {
+ let year = self.get_expiry_year_4_digit();
+ Secret::new(format!(
+ "{}{}{}",
+ year.peek(),
+ delimiter,
+ self.card_exp_month.peek()
+ ))
+ }
+ fn get_expiry_date_as_mmyyyy(&self, delimiter: &str) -> Secret<String> {
+ let year = self.get_expiry_year_4_digit();
+ Secret::new(format!(
+ "{}{}{}",
+ self.card_exp_month.peek(),
+ delimiter,
+ year.peek()
+ ))
+ }
+ fn get_expiry_year_4_digit(&self) -> Secret<String> {
+ let mut year = self.card_exp_year.peek().clone();
+ if year.len() == 2 {
+ year = format!("20{}", year);
+ }
+ Secret::new(year)
+ }
+ fn get_expiry_date_as_yymm(&self) -> Result<Secret<String>, errors::ConnectorError> {
+ let year = self.get_card_expiry_year_2_digit()?.expose();
+ let month = self.card_exp_month.clone().expose();
+ Ok(Secret::new(format!("{year}{month}")))
+ }
+ fn get_expiry_date_as_mmyy(&self) -> Result<Secret<String>, errors::ConnectorError> {
+ let year = self.get_card_expiry_year_2_digit()?.expose();
+ let month = self.card_exp_month.clone().expose();
+ Ok(Secret::new(format!("{month}{year}")))
+ }
+ fn get_expiry_month_as_i8(&self) -> Result<Secret<i8>, Error> {
+ self.card_exp_month
+ .peek()
+ .clone()
+ .parse::<i8>()
+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)
+ .map(Secret::new)
+ }
+ fn get_expiry_year_as_i32(&self) -> Result<Secret<i32>, Error> {
+ self.card_exp_year
+ .peek()
+ .clone()
+ .parse::<i32>()
+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)
+ .map(Secret::new)
+ }
+ fn get_expiry_year_as_4_digit_i32(&self) -> Result<Secret<i32>, Error> {
+ self.get_expiry_year_4_digit()
+ .peek()
+ .clone()
+ .parse::<i32>()
+ .change_context(errors::ConnectorError::ResponseDeserializationFailed)
+ .map(Secret::new)
+ }
+ fn get_cardholder_name(&self) -> Result<Secret<String>, Error> {
+ self.card_holder_name
+ .clone()
+ .ok_or_else(missing_field_err("card.card_holder_name"))
+ }
+}
+
#[track_caller]
fn get_card_issuer(card_number: &str) -> Result<CardIssuer, Error> {
for (k, v) in CARD_REGEX.iter() {
diff --git a/crates/router/locales/en.yml b/crates/router/locales/en.yml
index c85be7ccf4..67eec844fb 100644
--- a/crates/router/locales/en.yml
+++ b/crates/router/locales/en.yml
@@ -7,7 +7,7 @@ payout_link:
status:
title: "Payout Status"
info:
- ref_id: "Ref Id"
+ ref_id: "Reference Id"
error_code: "Error Code"
error_message: "Error Message"
message:
diff --git a/crates/router/src/configs/defaults/payment_connector_required_fields.rs b/crates/router/src/configs/defaults/payment_connector_required_fields.rs
index 1d2be85ba1..d957109bce 100644
--- a/crates/router/src/configs/defaults/payment_connector_required_fields.rs
+++ b/crates/router/src/configs/defaults/payment_connector_required_fields.rs
@@ -67,6 +67,7 @@ impl Default for Mandates {
enums::Connector::Authorizedotnet,
enums::Connector::Globalpay,
enums::Connector::Worldpay,
+ enums::Connector::Fiuu,
enums::Connector::Multisafepay,
enums::Connector::Nexinets,
enums::Connector::Noon,
@@ -88,6 +89,7 @@ impl Default for Mandates {
enums::Connector::Authorizedotnet,
enums::Connector::Globalpay,
enums::Connector::Worldpay,
+ enums::Connector::Fiuu,
enums::Connector::Multisafepay,
enums::Connector::Nexinets,
enums::Connector::Noon,
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js b/cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js
index 996356117a..a707643248 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Fiuu.js
@@ -382,6 +382,21 @@ export const connectorDetails = {
},
},
},
+ PaymentIntentOffSession: {
+ Request: {
+ amount: 6500,
+ authentication_type: "no_three_ds",
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
PaymentMethodIdMandateNo3DSAutoCapture: {
Request: {
payment_method: "card",
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js b/cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js
index 049997c541..1025b47411 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Novalnet.js
@@ -7,22 +7,24 @@ const successfulThreeDSTestCardDetails = {
};
const successfulNo3DSCardDetails = {
- card_number: "4242424242424242",
- card_exp_month: "01",
- card_exp_year: "50",
+ card_number: "4200000000000000",
+ card_exp_month: "03",
+ card_exp_year: "30",
card_holder_name: "joseph Doe",
card_cvc: "123",
};
-const singleUseMandateData = {
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
+const customerAcceptance = {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "127.0.0.1",
+ user_agent: "amet irure esse",
},
+};
+
+const singleUseMandateData = {
+ customer_acceptance: customerAcceptance,
mandate_type: {
single_use: {
amount: 8000,
@@ -260,6 +262,41 @@ export const connectorDetails = {
},
},
},
+ MITAutoCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MITManualCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCaptureOffSession: {
+ Request: {
+ payment_method: "card",
+ payment_method_type: "debit",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ setup_future_usage: "off_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
ZeroAuthPaymentIntent: {
Request: {
amount: 0,
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js b/cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js
index a58bbb22f8..a811cac786 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/WorldPay.js
@@ -56,14 +56,14 @@ const paymentMethodDataNoThreeDsResponse = {
card_extended_bin: null,
card_exp_month: "10",
card_exp_year: "30",
- card_holder_name: null,
+ card_holder_name: "morino",
payment_checks: null,
authentication_data: null,
},
billing: null,
};
-const payment_method_data_3ds = {
+const paymentMethodDataThreeDsResponse = {
card: {
last4: "1091",
card_type: "CREDIT",
@@ -74,7 +74,7 @@ const payment_method_data_3ds = {
card_extended_bin: null,
card_exp_month: "10",
card_exp_year: "30",
- card_holder_name: null,
+ card_holder_name: "morino",
payment_checks: null,
authentication_data: null,
},
@@ -328,7 +328,7 @@ export const connectorDetails = {
body: {
status: "requires_customer_action",
setup_future_usage: "on_session",
- payment_method_data: payment_method_data_3ds,
+ payment_method_data: paymentMethodDataThreeDsResponse,
},
},
},
@@ -349,7 +349,7 @@ export const connectorDetails = {
body: {
status: "requires_customer_action",
setup_future_usage: "on_session",
- payment_method_data: payment_method_data_3ds,
+ payment_method_data: paymentMethodDataThreeDsResponse,
},
},
},
@@ -512,6 +512,73 @@ export const connectorDetails = {
},
},
},
+ PaymentIntentOffSession: {
+ Request: {
+ amount: 6500,
+ authentication_type: "no_three_ds",
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ MITAutoCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MITManualCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ PaymentIntentWithShippingCost: {
+ Request: {
+ currency: "USD",
+ shipping_cost: 50,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ shipping_cost: 50,
+ amount: 6500,
+ },
+ },
+ },
+ PaymentConfirmWithShippingCost: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNoThreeDsCardDetailsRequest,
+ },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ shipping_cost: 50,
+ amount_received: 6550,
+ amount: 6500,
+ net_amount: 6550,
+ },
+ },
+ },
ZeroAuthMandate: {
Request: {
payment_method: "card",
diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml
index b26b5b2e43..e90eb16ab6 100644
--- a/loadtest/config/development.toml
+++ b/loadtest/config/development.toml
@@ -370,7 +370,7 @@ card.credit ={connector_list ="cybersource"}
card.debit = {connector_list ="cybersource"}
[network_transaction_id_supported_connectors]
-connector_list = "stripe,adyen,cybersource"
+connector_list = "adyen,cybersource,novalnet,stripe,worldpay"
[analytics]
source = "sqlx"