Skip to content

Commit

Permalink
ci(cypress): Add field level verification (#6153)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnanasundari24 authored Oct 9, 2024
1 parent 55a97cc commit edd0998
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 49 deletions.
3 changes: 1 addition & 2 deletions cypress-tests/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"printWidth": 120
"singleQuote": false
}
58 changes: 29 additions & 29 deletions cypress-tests/cypress/e2e/PaymentUtils/Nexixpay.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const successfulNo3DSCardDetails = {
};

const successfulThreeDSTestCardDetails = {
card_number: "4349940199004549",
card_exp_month: "12",
card_exp_year: "30",
card_holder_name: "joseph Doe",
card_cvc: "396",
card_number: "4349940199004549",
card_exp_month: "12",
card_exp_year: "30",
card_holder_name: "joseph Doe",
card_cvc: "396",
};

export const connectorDetails = {
Expand All @@ -37,21 +37,21 @@ export const connectorDetails = {
payment_method: "card",
billing: {
address: {
line1: "1467",
line2: "CA",
line3: "CA",
city: "Florence",
state: "Tuscany",
zip: "12345",
country: "IT",
first_name: "Max",
last_name: "Mustermann"
line1: "1467",
line2: "CA",
line3: "CA",
city: "Florence",
state: "Tuscany",
zip: "12345",
country: "IT",
first_name: "Max",
last_name: "Mustermann",
},
email: "[email protected]",
phone: {
number: "9123456789",
country_code: "+91"
}
number: "9123456789",
country_code: "+91",
},
},
payment_method_data: {
card: successfulThreeDSTestCardDetails,
Expand All @@ -71,21 +71,21 @@ export const connectorDetails = {
payment_method: "card",
billing: {
address: {
line1: "1467",
line2: "CA",
line3: "CA",
city: "Florence",
state: "Tuscany",
zip: "12345",
country: "IT",
first_name: "Max",
last_name: "Mustermann"
line1: "1467",
line2: "CA",
line3: "CA",
city: "Florence",
state: "Tuscany",
zip: "12345",
country: "IT",
first_name: "Max",
last_name: "Mustermann",
},
email: "[email protected]",
phone: {
number: "9123456789",
country_code: "+91"
}
number: "9123456789",
country_code: "+91",
},
},
payment_method_data: {
card: successfulThreeDSTestCardDetails,
Expand Down
55 changes: 54 additions & 1 deletion cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,46 @@ const multiUseMandateData = {
},
};

const payment_method_data_3ds = {
card: {
last4: "3155",
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: "10",
card_exp_year: "25",
card_holder_name: null,
payment_checks: null,
authentication_data: null,
},
billing: null,
};

const payment_method_data_no3ds = {
card: {
last4: "4242",
card_type: "CREDIT",
card_network: "Visa",
card_issuer: "STRIPE PAYMENTS UK LIMITED",
card_issuing_country: "UNITEDKINGDOM",
card_isin: "424242",
card_extended_bin: null,
card_exp_month: "10",
card_exp_year: "25",
card_holder_name: null,
payment_checks: {
cvc_check: "pass",
address_line1_check: "pass",
address_postal_code_check: "pass",
},
authentication_data: null,
},
billing: null,
};

export const connectorDetails = {
card_pm: {
PaymentIntent: {
Expand All @@ -62,6 +102,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_payment_method",
setup_future_usage: "on_session",
},
},
},
Expand All @@ -75,6 +116,7 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_payment_method",
setup_future_usage: "off_session",
},
},
},
Expand All @@ -91,10 +133,13 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
status: "requires_capture",
status: "requires_customer_action",
setup_future_usage: "on_session",
payment_method_data: payment_method_data_3ds,
},
},
},

"3DSAutoCapture": {
Request: {
payment_method: "card",
Expand All @@ -109,6 +154,8 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_customer_action",
setup_future_usage: "on_session",
payment_method_data: payment_method_data_3ds,
},
},
},
Expand All @@ -126,6 +173,9 @@ export const connectorDetails = {
status: 200,
body: {
status: "requires_capture",
payment_method: "card",
attempt_count: 1,
payment_method_data: payment_method_data_no3ds,
},
},
},
Expand All @@ -143,6 +193,9 @@ export const connectorDetails = {
status: 200,
body: {
status: "succeeded",
payment_method: "card",
attempt_count: 1,
payment_method_data: payment_method_data_no3ds,
},
},
},
Expand Down
Loading

0 comments on commit edd0998

Please sign in to comment.