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

fix(cypress): fix itaubank, datatrans and facilitapay (#8229)

Pa1NarKe0ea1b483211
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Datatrans.js b/cypress-tests/cypress/e2e/configs/Payment/Datatrans.js
index 57e28b8622..89a8455949 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Datatrans.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Datatrans.js
@@ -1,11 +1,103 @@
+import { customerAcceptance } from "./Commons";
+import { getCustomExchange } from "./Modifiers";
+
const successfulNo3DSCardDetails = {
- card_number: "4444090101010103",
+ card_number: "4000001000000018",
+ card_exp_month: "06",
+ card_exp_year: "28",
+ card_holder_name: "joseph Doe",
+ card_cvc: "123",
+};
+const successfulThreeDSTestCardDetails = {
+ card_number: "4111111111111111",
card_exp_month: "06",
+ card_exp_year: "28",
+ card_holder_name: "joseph Doe",
+ card_cvc: "123",
+};
+const failedNo3DSCardDetails = {
+ card_number: "4000000000002701",
+ card_exp_month: "01",
card_exp_year: "50",
card_holder_name: "joseph Doe",
card_cvc: "123",
};
+const singleUseMandateData = {
+ customer_acceptance: customerAcceptance,
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: customerAcceptance,
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const paymentMethodData3Ds = {
+ card: {
+ last4: "1111",
+ card_type: "CREDIT",
+ card_network: "Visa",
+ card_issuer: "JP Morgan",
+ card_issuing_country: "INDIA",
+ card_isin: "411111",
+ card_extended_bin: null,
+ card_exp_month: "06",
+ card_exp_year: "28",
+ card_holder_name: "joseph Doe",
+ payment_checks: null,
+ authentication_data: null,
+ },
+ billing: null,
+};
+
+const paymentMethodDataNo3Ds = {
+ card: {
+ last4: "0018",
+ card_type: "CREDIT",
+ card_network: "Visa",
+ card_issuer: "INTL HDQTRS-CENTER OWNED",
+ card_issuing_country: "UNITEDSTATES",
+ card_isin: "400000",
+ card_extended_bin: null,
+ card_exp_month: "06",
+ card_exp_year: "28",
+ card_holder_name: "joseph Doe",
+ payment_checks: null,
+ authentication_data: null,
+ },
+ billing: null,
+};
+
+const billingWithNewline = {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street\nApt 101",
+ line3: "Harrison Street\nApt 101",
+ city: "Zurich",
+ state: "asd",
+ zip: "8008",
+ country: "CH",
+ first_name: "joseph",
+ last_name: "Doe",
+ },
+ phone: {
+ number: "9123456789",
+ country_code: "+91",
+ },
+ email: "[email protected]",
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -21,6 +113,74 @@ export const connectorDetails = {
},
},
},
+ PaymentConfirmWithShippingCost: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ shipping_cost: 50,
+ amount_received: 6050,
+ amount: 6000,
+ net_amount: 6050,
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ billing: billingWithNewline,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ setup_future_usage: "on_session",
+ payment_method_data: paymentMethodDataNo3Ds,
+ },
+ },
+ },
+ "3DSManualCapture": {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ billing: billingWithNewline,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ setup_future_usage: "on_session",
+ payment_method_data: paymentMethodData3Ds,
+ },
+ },
+ },
No3DSManualCapture: {
Request: {
payment_method: "card",
@@ -30,11 +190,14 @@ export const connectorDetails = {
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
+ billing: billingWithNewline,
},
Response: {
status: 200,
body: {
status: "requires_capture",
+ attempt_count: 1,
+ payment_method_data: paymentMethodDataNo3Ds,
},
},
},
@@ -47,11 +210,14 @@ export const connectorDetails = {
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
+ billing: billingWithNewline,
},
Response: {
status: 200,
body: {
status: "succeeded",
+ attempt_count: 1,
+ payment_method_data: paymentMethodDataNo3Ds,
},
},
},
@@ -122,5 +288,391 @@ export const connectorDetails = {
},
},
},
+ manualPaymentRefund: {
+ Request: {
+ amount: 6000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ manualPaymentPartialRefund: {
+ Request: {
+ amount: 2000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateMultiUseNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ MandateSingleUseNo3DSAutoCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ MandateSingleUseNo3DSManualCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ MandateMultiUseNo3DSManualCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ MandateMultiUse3DSAutoCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ MandateMultiUse3DSManualCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ billing: billingWithNewline,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ ZeroAuthPaymentIntent: {
+ Request: {
+ amount: 0,
+ setup_future_usage: "off_session",
+ currency: "USD",
+ billing: billingWithNewline,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ ZeroAuthConfirmPayment: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_type: "debit",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ setup_future_usage: "on_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+
+ SaveCardUseNo3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ setup_future_usage: "on_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ SaveCardUseNo3DSManualCaptureOffSession: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ 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: "requires_customer_action",
+ },
+ },
+ },
+
+ SaveCardUseNo3DSAutoCaptureOffSession: getCustomExchange({
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ 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: "requires_customer_action",
+ },
+ },
+ ResponseCustom: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ }),
+ No3DSFailPayment: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: failedNo3DSCardDetails,
+ },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "DECLINED",
+ error_message: "Declined",
+ unified_code: "UE_9000",
+ unified_message: "Something went wrong",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: customerAcceptance,
+ billing: billingWithNewline,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ // 3DS elements are hidden and hence are not clickable in anyway
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: customerAcceptance,
+ billing: billingWithNewline,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
},
};
diff --git a/cypress-tests/cypress/e2e/configs/Payment/ItauBank.js b/cypress-tests/cypress/e2e/configs/Payment/ItauBank.js
index ac8461211f..d419a466ec 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/ItauBank.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/ItauBank.js
@@ -1,16 +1,48 @@
+const successfulNo3DSCardDetails = {
+ card_number: "4242424242424242",
+ card_exp_month: "10",
+ card_exp_year: "30",
+ card_holder_name: "John",
+ card_cvc: "737",
+};
+
+const mandateNotSupported = {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "setup mandate flow not supported",
+ code: "IR_20",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
- ZeroAuthMandate: {
+ ZeroAuthPaymentIntent: {
+ Request: {
+ currency: "USD",
+ },
Response: {
- status: 400,
+ status: 200,
body: {
- error: {
- type: "invalid_request",
- message: "setup mandate flow not supported",
- code: "IR_20",
- },
+ status: "requires_payment_method",
+ },
+ },
+ },
+ ZeroAuthConfirmPayment: {
+ Request: {
+ payment_type: "setup_mandate",
+ payment_method: "card",
+ payment_method_type: "credit",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
},
+ Response: mandateNotSupported,
+ },
+ ZeroAuthMandate: {
+ Response: mandateNotSupported,
},
},
bank_transfer_pm: {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
index d6cacc3f93..4a6ebb0690 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
@@ -13,6 +13,7 @@ function normalize(input) {
const exceptions = {
bankofamerica: "Bank of America",
cybersource: "Cybersource",
+ datatrans: "Datatrans",
facilitapay: "Facilitapay",
paybox: "Paybox",
paypal: "Paypal",
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 14f431c7a1..6c637caf14 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -335,6 +335,7 @@ export const CONNECTOR_LISTS = {
CONNECTOR_AGNOSTIC_NTID: [
"bankofamerica",
"braintree",
+ "facilitapay",
"fiuu",
"fiserv",
"jpmorgan",