Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cypress): add test case for incorrect and empty card types #6550

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions cypress-tests/cypress/e2e/PaymentTest/00021-Variations.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,40 @@ describe("Corner cases", () => {
);
});

it("[Payment] Incorrect card type", () => {
let data = getConnectorDetails(globalState.get("commons"))["card_pm"][
"IncorrectCardType"
];
let req_data = data["Request"];
let res_data = data["Response"];

cy.createConfirmPaymentTest(
paymentIntentBody,
req_data,
res_data,
"no_three_ds",
"automatic",
globalState
);
});

it("[Payment] Empty card type", () => {
let data = getConnectorDetails(globalState.get("commons"))["card_pm"][
"EmptyCardType"
];
let req_data = data["Request"];
let res_data = data["Response"];

cy.createConfirmPaymentTest(
paymentIntentBody,
req_data,
res_data,
"no_three_ds",
"automatic",
globalState
);
});

it("[Payment] Invalid `amount_to_capture`", () => {
let data = getConnectorDetails(globalState.get("commons"))["card_pm"][
"InvalidAmountToCapture"
Expand Down
73 changes: 73 additions & 0 deletions cypress-tests/cypress/e2e/PaymentUtils/Commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,79 @@ export const connectorDetails = {
},
},
},
IncorrectCardType: {
Request: {
currency: "USD",
kashif-m marked this conversation as resolved.
Show resolved Hide resolved
payment_method: "card",
payment_method_type: "debit",
setup_future_usage: "off_session",
confirm: true,
billing: {
kashif-m marked this conversation as resolved.
Show resolved Hide resolved
address: {
line1: "1467",
line2: "Harrison Street",
line3: "Harrison Street",
city: "San Fransico",
state: "California",
zip: "94122",
country: "BR",
first_name: "john",
last_name: "doe",
},
},
payment_method_data: {
kashif-m marked this conversation as resolved.
Show resolved Hide resolved
card: {
card_number: "4242424242424242",
card_exp_month: "01",
card_exp_year: "2034",
card_holder_name: "joseph Doe",
card_cvc: "123",
},
},
},
Response: {
status: 200,
body: {
payment_method_type: "credit",
},
},
},
EmptyCardType: {
Request: {
currency: "USD",
payment_method: "card",
setup_future_usage: "off_session",
confirm: true,
billing: {
address: {
line1: "1467",
line2: "Harrison Street",
line3: "Harrison Street",
city: "San Fransico",
state: "California",
zip: "94122",
country: "BR",
first_name: "john",
last_name: "doe",
},
},
payment_method_data: {
kashif-m marked this conversation as resolved.
Show resolved Hide resolved
card: {
card_number: "4242424242424242",
card_exp_month: "01",
card_exp_year: "2034",
card_holder_name: "joseph Doe",
card_cvc: "123",
},
},
},
Response: {
status: 200,
body: {
payment_method_type: "credit",
},
},
},
InvalidAmountToCapture: {
Request: {
currency: "USD",
Expand Down
Loading