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

ci(cypress): fix `hipay` test cases (#8563)

Arindam Sahoo7e6c511e5009
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Hipay.js b/cypress-tests/cypress/e2e/configs/Payment/Hipay.js
index 0a9ed82621..d6c5412d3d 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Hipay.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Hipay.js
@@ -4,19 +4,19 @@ const successfulNo3DSCardDetails = {
card_number: "4111111111111111",
card_exp_month: "06",
card_exp_year: "50",
- card_holder_name: "joseph Doe",
+ card_holder_name: "Joseph Doe",
card_cvc: "123",
};
const billing_info = {
address: {
line1: "1467",
- line2: "CA",
- line3: "CA",
- city: "Florence",
- state: "Tuscany",
- zip: "12345",
- country: "IT",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "San Fransico",
+ state: "California",
+ zip: "94122",
+ country: "US",
first_name: "Max",
last_name: "Mustermann",
},
@@ -26,13 +26,12 @@ const billing_info = {
country_code: "+91",
},
};
+
const successful3DSCardDetails = {
+ ...successfulNo3DSCardDetails,
card_number: "4000000000000002",
- card_exp_month: "06",
- card_exp_year: "50",
- card_holder_name: "joseph Doe",
- card_cvc: "123",
};
+
const singleUseMandateData = {
customer_acceptance: customerAcceptance,
mandate_type: {
@@ -52,6 +51,47 @@ const multiUseMandateData = {
},
},
};
+
+const paymentMethodDataNo3DSResponse = {
+ card: {
+ authentication_data: null,
+ card_exp_month: "06",
+ card_exp_year: "50",
+ card_extended_bin: null,
+ card_holder_name: "Joseph Doe",
+ card_isin: "411111",
+ card_issuer: "JP Morgan",
+ card_issuing_country: "INDIA",
+ card_network: "Visa",
+ card_type: "CREDIT",
+ last4: "1111",
+ payment_checks: null,
+ },
+ billing: {
+ address: null,
+ email: billing_info.email,
+ phone: null,
+ },
+};
+
+const paymentMethodData3DSResponse = {
+ card: {
+ authentication_data: null,
+ card_exp_month: "06",
+ card_exp_year: "50",
+ card_extended_bin: null,
+ card_holder_name: "Joseph Doe",
+ card_isin: "400000",
+ card_issuer: "INTL HDQTRS-CENTER OWNED",
+ card_issuing_country: "UNITEDSTATES",
+ card_network: "Visa",
+ card_type: "CREDIT",
+ last4: "0002",
+ payment_checks: null,
+ },
+ billing: null,
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -74,11 +114,11 @@ export const connectorDetails = {
payment_method_data: {
card: successfulNo3DSCardDetails,
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
},
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
currency: "EUR",
customer_acceptance: null,
@@ -88,6 +128,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_capture",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -98,11 +139,11 @@ export const connectorDetails = {
payment_method_data: {
card: successfulNo3DSCardDetails,
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
},
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
currency: "EUR",
customer_acceptance: null,
@@ -112,6 +153,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "succeeded",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -139,24 +181,14 @@ export const connectorDetails = {
},
},
MandateMultiUseNo3DSAutoCapture: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
- 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",
- },
- email: "[email protected]",
- },
+ billing: billing_info,
},
currency: "EUR",
mandate_data: multiUseMandateData,
@@ -165,6 +197,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "succeeded",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -176,20 +209,7 @@ export const connectorDetails = {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
- 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",
- },
- email: "[email protected]",
- },
+ billing: billing_info,
},
currency: "EUR",
mandate_data: multiUseMandateData,
@@ -198,6 +218,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_capture",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -210,7 +231,7 @@ export const connectorDetails = {
payment_method_data: {
card: successfulNo3DSCardDetails,
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
},
currency: "EUR",
@@ -221,6 +242,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "succeeded",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -229,28 +251,12 @@ export const connectorDetails = {
TRIGGER_SKIP: true,
},
Request: {
+ currency: "EUR",
payment_method: "card",
payment_method_type: "debit",
payment_method_data: {
card: successfulNo3DSCardDetails,
- 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",
- },
- email: "[email protected]",
- },
+ billing: billing_info,
},
setup_future_usage: "off_session",
customer_acceptance: customerAcceptance,
@@ -259,6 +265,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "succeeded",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -270,24 +277,7 @@ export const connectorDetails = {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
- 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",
- },
- email: "[email protected]",
- },
+ billing: billing_info,
},
setup_future_usage: "off_session",
customer_acceptance: customerAcceptance,
@@ -296,6 +286,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_capture",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -335,24 +326,7 @@ export const connectorDetails = {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
- 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",
- },
- email: "[email protected]",
- },
+ billing: billing_info,
},
currency: "EUR",
setup_future_usage: "on_session",
@@ -362,6 +336,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_capture",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -374,7 +349,7 @@ export const connectorDetails = {
payment_method_data: {
card: successfulNo3DSCardDetails,
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
},
currency: "EUR",
@@ -384,6 +359,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "succeeded",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -396,7 +372,7 @@ export const connectorDetails = {
payment_method_data: {
card: successfulNo3DSCardDetails,
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
},
currency: "EUR",
@@ -406,6 +382,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_capture",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -479,6 +456,9 @@ export const connectorDetails = {
},
},
PaymentMethodIdMandateNo3DSAutoCapture: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
Request: {
payment_method: "card",
payment_method_data: {
@@ -486,7 +466,7 @@ export const connectorDetails = {
},
currency: "EUR",
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
mandate_data: null,
customer_acceptance: customerAcceptance,
@@ -495,17 +475,21 @@ export const connectorDetails = {
status: 200,
body: {
status: "succeeded",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
PaymentMethodIdMandateNo3DSManualCapture: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
Request: {
payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
billing: {
- email: "[email protected]",
+ email: billing_info.email,
},
currency: "EUR",
mandate_data: null,
@@ -515,6 +499,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_capture",
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -549,6 +534,7 @@ export const connectorDetails = {
amount_received: 6050,
amount: 6000,
net_amount: 6050,
+ payment_method_data: paymentMethodDataNo3DSResponse,
},
},
},
@@ -570,6 +556,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_customer_action",
+ payment_method_data: paymentMethodData3DSResponse,
},
},
},
@@ -591,6 +578,116 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_customer_action",
+ payment_method_data: paymentMethodData3DSResponse,
+ },
+ },
+ },
+ ZeroAuthPaymentIntent: {
+ Request: {
+ amount: 0,
+ setup_future_usage: "off_session",
+ currency: "USD",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ ZeroAuthConfirmPayment: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_type: "setup_mandate",
+ payment_method: "card",
+ payment_method_type: "credit",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ setup_future_usage: "off_session",
+ payment_method_data: paymentMethodDataNo3DSResponse,
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ currency: "EUR",
+ billing: billing_info,
+ },
+ Response: {
+ status: 200,
+ body: {
+ amount: 0,
+ status: "processing",
+ },
+ },
+ },
+ PaymentIntentOffSession: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ currency: "EUR",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successful3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_data: paymentMethodData3DSResponse,
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successful3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_data: paymentMethodData3DSResponse,
},
},
},