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

test(cypress): add BankRedirect Ideal mandate and PayLater AfterpayClearpay coverage for stripe (#13165)

venkatakarthikm-maker693ff40ff26b
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
index 3c85bd6ad2..4b054db5f9 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
@@ -1203,6 +1203,9 @@ export const connectorDetails = {
status: "requires_customer_action",
},
},
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
}),
},
OnlineBankingFpx: getCustomExchange({
@@ -1382,6 +1385,18 @@ export const connectorDetails = {
billing: standardBillingAddress,
},
}),
+ MandateSingleUseAutoCapture: getCustomExchange({
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ }),
},
},
bank_debit_pm: {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js b/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
index 1fc6fba97b..e48be1a96f 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
@@ -62,6 +62,79 @@ const onlineCustomerAcceptance = {
acceptance_type: "online",
};
+const idealBaseRequest = {
+ payment_method: "bank_redirect",
+ payment_method_type: "ideal",
+ payment_method_data: {
+ bank_redirect: {
+ ideal: {
+ bank_name: "ing",
+ },
+ },
+ },
+ billing: {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "San Fransico",
+ state: "California",
+ zip: "94122",
+ country: "NL",
+ first_name: "joseph",
+ last_name: "Doe",
+ },
+ phone: {
+ number: "9123456789",
+ country_code: "+91",
+ },
+ },
+};
+
+const bancontactBaseRequest = {
+ payment_method: "bank_redirect",
+ payment_method_type: "bancontact_card",
+ payment_method_data: {
+ bank_redirect: {
+ bancontact_card: {},
+ },
+ },
+ billing: {
+ email: "[email protected]",
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "San Fransico",
+ state: "California",
+ zip: "94122",
+ country: "BE",
+ first_name: "joseph",
+ last_name: "Doe",
+ },
+ phone: {
+ number: "9123456789",
+ country_code: "+91",
+ },
+ },
+};
+
+const mandateSingleUseFields = {
+ currency: "EUR",
+ customer_acceptance: customerAcceptance,
+ mandate_data: {
+ ...singleUseMandateData,
+ mandate_type: {
+ single_use: {
+ ...singleUseMandateData.mandate_type.single_use,
+ currency: "EUR",
+ },
+ },
+ },
+ setup_future_usage: "off_session",
+ payment_type: "new_mandate",
+};
+
const connectorCredential = (connectorIndex) => ({
value: `connector_${connectorIndex}`,
});
@@ -1064,32 +1137,7 @@ export const connectorDetails = {
bank_redirect_pm: {
Ideal: {
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "ideal",
- payment_method_data: {
- bank_redirect: {
- ideal: {
- bank_name: "ing",
- },
- },
- },
- billing: {
- address: {
- line1: "1467",
- line2: "Harrison Street",
- line3: "Harrison Street",
- city: "San Fransico",
- state: "California",
- zip: "94122",
- country: "NL",
- first_name: "joseph",
- last_name: "Doe",
- },
- phone: {
- number: "9123456789",
- country_code: "+91",
- },
- },
+ ...idealBaseRequest,
},
Response: {
status: 200,
@@ -1097,6 +1145,22 @@ export const connectorDetails = {
status: "requires_customer_action",
},
},
+ MandateSingleUseAutoCapture: {
+ Request: {
+ ...idealBaseRequest,
+ billing: {
+ ...idealBaseRequest.billing,
+ email: "[email protected]",
+ },
+ ...mandateSingleUseFields,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
},
Giropay: {
Request: {
@@ -1215,44 +1279,8 @@ export const connectorDetails = {
BancontactCard: {
MandateSingleUse: {
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "bancontact_card",
- payment_method_data: {
- bank_redirect: {
- bancontact_card: {},
- },
- },
- billing: {
- email: "[email protected]",
- address: {
- line1: "1467",
- line2: "Harrison Street",
- line3: "Harrison Street",
- city: "San Fransico",
- state: "California",
- zip: "94122",
- country: "BE",
- first_name: "joseph",
- last_name: "Doe",
- },
- phone: {
- number: "9123456789",
- country_code: "+91",
- },
- },
- currency: "EUR",
- customer_acceptance: customerAcceptance,
- mandate_data: {
- customer_acceptance: customerAcceptance,
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "EUR",
- },
- },
- },
- setup_future_usage: "off_session",
- payment_type: "new_mandate",
+ ...bancontactBaseRequest,
+ ...mandateSingleUseFields,
},
Response: {
status: 200,
@@ -1263,44 +1291,8 @@ export const connectorDetails = {
},
MandateSingleUseAutoCapture: {
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "bancontact_card",
- payment_method_data: {
- bank_redirect: {
- bancontact_card: {},
- },
- },
- billing: {
- email: "[email protected]",
- address: {
- line1: "1467",
- line2: "Harrison Street",
- line3: "Harrison Street",
- city: "San Fransico",
- state: "California",
- zip: "94122",
- country: "BE",
- first_name: "joseph",
- last_name: "Doe",
- },
- phone: {
- number: "9123456789",
- country_code: "+91",
- },
- },
- currency: "EUR",
- customer_acceptance: customerAcceptance,
- mandate_data: {
- customer_acceptance: customerAcceptance,
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "EUR",
- },
- },
- },
- setup_future_usage: "off_session",
- payment_type: "new_mandate",
+ ...bancontactBaseRequest,
+ ...mandateSingleUseFields,
},
Response: {
status: 200,
@@ -1442,6 +1434,97 @@ export const connectorDetails = {
},
},
}),
+ AfterpayClearpayAutoCapture: getCustomExchange({
+ Request: {
+ currency: "USD",
+ capture_method: "automatic",
+ billing: {
+ address: {
+ line1: "1467 Harrison Street",
+ city: "San Francisco",
+ state: "California",
+ zip: "94122",
+ country: "US",
+ first_name: "Mock",
+ last_name: "Mock",
+ },
+ email: "[email protected]",
+ },
+ shipping: {
+ address: {
+ line1: "1467 Harrison Street",
+ city: "San Francisco",
+ state: "California",
+ zip: "94122",
+ country: "US",
+ first_name: "Mock",
+ last_name: "Mock",
+ },
+ },
+ order_details: [
+ {
+ product_name: "Test Product",
+ quantity: 1,
+ amount: 6000,
+ },
+ ],
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ }),
+ AfterpayClearpay: getCustomExchange({
+ Request: {
+ payment_method: "pay_later",
+ payment_method_type: "afterpay_clearpay",
+ payment_experience: "redirect_to_url",
+ payment_method_data: {
+ pay_later: {
+ afterpay_clearpay_redirect: {},
+ },
+ },
+ currency: "USD",
+ billing: {
+ address: {
+ line1: "1467 Harrison Street",
+ city: "San Francisco",
+ state: "California",
+ zip: "94122",
+ country: "US",
+ first_name: "Mock",
+ last_name: "Mock",
+ },
+ email: "[email protected]",
+ },
+ shipping: {
+ address: {
+ line1: "1467 Harrison Street",
+ city: "San Francisco",
+ state: "California",
+ zip: "94122",
+ country: "US",
+ first_name: "Mock",
+ last_name: "Mock",
+ },
+ },
+ order_details: [
+ {
+ product_name: "Test Product",
+ quantity: 1,
+ amount: 6000,
+ },
+ ],
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ }),
},
bank_debit_pm: {
PaymentIntent: (paymentMethodType) => {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 61872a35e3..85bfc5c82e 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -613,7 +613,7 @@ export const CONNECTOR_LISTS = {
"wellsfargo",
], // payload verified as working
BANK_REDIRECT_BANCONTACT: ["adyen", "stripe"],
- BANK_REDIRECT_MANDATE: ["adyen"],
+ BANK_REDIRECT_MANDATE: ["adyen", "stripe"],
BLUECODE_WALLET: ["calida"],
ALIPAY_HK_WALLET: [""],
PAYPAL_WALLET: [
@@ -672,7 +672,7 @@ export const CONNECTOR_LISTS = {
EXTERNAL_THREE_DS: ["stripe", "finix"],
PARTNER_MERCHANT_IDENTIFIER: ["adyen", "checkout"],
AFFIRM_PAY_LATER: ["affirm"],
- AFTERPAY_CLEARPAY: ["adyen"],
+ AFTERPAY_CLEARPAY: ["adyen", "stripe"],
ALMA: ["adyen"],
WALLEY: ["adyen"],
EXTEND_AUTHORIZATION: ["adyen", "paypal"],