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

ci(cypress): Fix payment method id for non supported connectors #5075

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add-bank-redirect-paypal
  • Loading branch information
likhinbopanna committed Jun 21, 2024
commit abb1892416d203fc9949521fe060e267f1c0fa8c
166 changes: 164 additions & 2 deletions cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getCustomExchange } from "./Commons";

const successfulNo3DSCardDetails = {
card_number: "4012000033330026",
card_exp_month: "01",
Expand Down Expand Up @@ -232,7 +234,7 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
payment_method_data: {
payment_method_data: {
card: successfulThreeDSTestCardDetails,
},
currency: "USD",
Expand Down Expand Up @@ -336,7 +338,7 @@ export const connectorDetails = {
card: successfulThreeDSTestCardDetails,
},
currency: "USD",
mandate_data: multiUseMandateData,
mandate_data: multiUseMandateData,
},
Response: {
status: 400,
Expand Down Expand Up @@ -545,4 +547,164 @@ export const connectorDetails = {
},
},
},
bank_redirect_pm: {
PaymentIntent: getCustomExchange({
Request: {
currency: "EUR",
},
Response: {
status: 200,
body: {
status: "requires_payment_method",
},
},
}),
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: "8056594427",
country_code: "+91",
},
},
},
Response: {
status: 200,
body: {
status: "requires_customer_action",
},
},
},
giropay: {
Request: {
payment_method: "bank_redirect",
payment_method_type: "giropay",
payment_method_data: {
bank_redirect: {
giropay: {
bank_name: "",
bank_account_bic: "",
bank_account_iban: "",
},
},
},
billing: {
address: {
line1: "1467",
line2: "Harrison Street",
line3: "Harrison Street",
city: "San Fransico",
state: "California",
zip: "94122",
country: "DE",
first_name: "joseph",
last_name: "Doe",
},
phone: {
number: "8056594427",
country_code: "+91",
},
},
},
Response: {
status: 200,
body: {
status: "requires_customer_action",
},
},
},
sofort: {
Request: {
payment_method: "bank_redirect",
payment_method_type: "sofort",
payment_method_data: {
bank_redirect: {
sofort: {
preferred_language: "en",
},
},
},
billing: {
address: {
line1: "1467",
line2: "Harrison Street",
line3: "Harrison Street",
city: "San Fransico",
state: "California",
zip: "94122",
country: "AT",
first_name: "joseph",
last_name: "Doe",
},
phone: {
number: "8056594427",
country_code: "+91",
},
},
},
Response: {
status: 200,
body: {
status: "failed",
error_code: "PERMISSION_DENIED",
},
},
},
eps: {
Request: {
payment_method: "bank_redirect",
payment_method_type: "eps",
payment_method_data: {
bank_redirect: {
eps: {
bank_name: "ing",
},
},
},
billing: {
address: {
line1: "1467",
line2: "Harrison Street",
line3: "Harrison Street",
city: "San Fransico",
state: "California",
zip: "94122",
country: "AT",
first_name: "joseph",
last_name: "Doe",
},
phone: {
number: "8056594427",
country_code: "+91",
},
},
},
Response: {
status: 200,
body: {
status: "requires_customer_action",
},
},
},
},
};
18 changes: 18 additions & 0 deletions cypress-tests/cypress/support/redirectionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,24 @@ function bankRedirectRedirection(
}
verifyUrl = true;
break;
case "paypal":
switch (payment_method_type) {
case "eps":
cy.get('button[name="Successful"][value="SUCCEEDED"]').click();
break;
case "ideal":
cy.get('button[name="Successful"][value="SUCCEEDED"]').click();
break;
case "giropay":
cy.get('button[name="Successful"][value="SUCCEEDED"]').click();
break;
default:
throw new Error(
`Unsupported payment method type: ${payment_method_type}`
);
}
verifyUrl = true;
break;
case "stripe":
switch (payment_method_type) {
case "eps":
Expand Down
Loading