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): Add bank redirects for stripe (#4772)

likhinbopanna055347606b7d
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
index 0706cf15b1..f031f15140 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
@@ -301,7 +301,65 @@ describe("Bank Redirect tests", () => {
cy.handleBankRedirectRedirection(
globalState,
payment_method_type,
- expected_redirection,
+ expected_redirection
+ );
+ });
+ });
+
+ context("Przelewy24 Create and Confirm flow test", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "bank_redirect_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "automatic",
+ globalState
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm bank redirect", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "bank_redirect_pm"
+ ]["przelewy24"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.confirmBankRedirectCallTest(
+ confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle bank redirect redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ let payment_method_type = globalState.get("paymentMethodType");
+ cy.handleBankRedirectRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
);
});
});
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
index 19b6f34224..36c3d2c205 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
@@ -441,7 +441,6 @@ export const connectorDetails = {
bank_name: "",
bank_account_bic: "",
bank_account_iban: "",
- preferred_language: "en",
country: "DE",
},
},
@@ -493,6 +492,33 @@ export const connectorDetails = {
},
},
},
+ przelewy24: {
+ Request: {
+ payment_method: "bank_redirect",
+ payment_method_type: "przelewy24",
+ payment_method_data: {
+ bank_redirect: {
+ przelewy24: {
+ bank_name: "citi",
+ billing_details: {
+ email: "[email protected]",
+ },
+ },
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "automatic for przelewy24 is not supported by adyen",
+ },
+ },
+ },
+ },
blik: {
Request: {
payment_method: "bank_redirect",
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
index d3228396fc..250396cb25 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
@@ -481,6 +481,22 @@ export const connectorDetails = {
},
},
}),
+ przelewy24: getCustomExchange({
+ Request: {
+ payment_method: "bank_redirect",
+ payment_method_type: "przelewy24",
+ payment_method_data: {
+ bank_redirect: {
+ przelewy24: {
+ bank_name: "citi",
+ billing_details: {
+ email: "[email protected]",
+ },
+ },
+ },
+ },
+ },
+ }),
blikPaymentIntent: getCustomExchange({
Request: {
currency: "PLN",
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
index 841c40b873..7af51bf007 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
@@ -1,3 +1,5 @@
+import { getCustomExchange } from "./Commons";
+
const successfulTestCard = "4242424242424242";
const successful3DSCard = "4000002760003184";
@@ -370,4 +372,137 @@ 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",
+ country: "NL",
+ },
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ giropay: {
+ Request: {
+ payment_method: "bank_redirect",
+ payment_method_type: "giropay",
+ payment_method_data: {
+ bank_redirect: {
+ giropay: {
+ country: "DE",
+ },
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ sofort: {
+ Request: {
+ payment_method: "bank_redirect",
+ payment_method_type: "sofort",
+ payment_method_data: {
+ bank_redirect: {
+ sofort: {
+ country: "DE",
+ preferred_language: "en",
+ },
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ eps: {
+ Request: {
+ payment_method: "bank_redirect",
+ payment_method_type: "eps",
+ payment_method_data: {
+ bank_redirect: {
+ eps: {
+ bank_name: "bank_austria",
+ },
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ blik: {
+ Request: {
+ payment_method: "bank_redirect",
+ payment_method_type: "blik",
+ payment_method_data: {
+ bank_redirect: {
+ blik: {
+ blik_code: "777987",
+ },
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "payment_intent_invalid_parameter",
+ },
+ },
+ },
+ przelewy24: {
+ Request: {
+ payment_method: "bank_redirect",
+ payment_method_type: "przelewy24",
+ payment_method_data: {
+ bank_redirect: {
+ przelewy24: {
+ bank_name: "citi",
+ billing_details: {
+ email: "[email protected]",
+ },
+ },
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ },
};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
index d2a8b956b9..338371f72e 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
@@ -470,7 +470,6 @@ export const connectorDetails = {
bank_name: "",
bank_account_bic: "",
bank_account_iban: "",
- preferred_language: "en",
country: "DE",
},
},
diff --git a/cypress-tests/cypress/fixtures/create-connector-body.json b/cypress-tests/cypress/fixtures/create-connector-body.json
index 9ab253565e..0bfa7e4911 100644
--- a/cypress-tests/cypress/fixtures/create-connector-body.json
+++ b/cypress-tests/cypress/fixtures/create-connector-body.json
@@ -122,6 +122,17 @@
"maximum_amount": 68607706,
"recurring_enabled": true,
"installment_payment_enabled": true
+ },
+ {
+ "payment_method_type": "przelewy24",
+ "payment_experience": null,
+ "card_networks": null,
+ "accepted_currencies": null,
+ "accepted_countries": null,
+ "minimum_amount": 1,
+ "maximum_amount": 68607706,
+ "recurring_enabled": true,
+ "installment_payment_enabled": true
}
]
}
diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.js
index f6b65d8251..67953a0907 100644
--- a/cypress-tests/cypress/support/redirectionHandler.js
+++ b/cypress-tests/cypress/support/redirectionHandler.js
@@ -193,7 +193,31 @@ function bankRedirectRedirection(
break;
default:
throw new Error(
- `Unsupported payment method type: ${payment_method_type}`,
+ `Unsupported payment method type: ${payment_method_type}`
+ );
+ }
+ verifyUrl = true;
+ break;
+ case "stripe":
+ switch (payment_method_type) {
+ case "eps":
+ cy.get('a[name="success"]').click();
+ break;
+ case "ideal":
+ cy.get('a[name="success"]').click();
+ break;
+ case "giropay":
+ cy.get('a[name="success"]').click();
+ break;
+ case "sofort":
+ cy.get('a[name="success"]').click();
+ break;
+ case "przelewy24":
+ cy.get('a[name="success"]').click();
+ break;
+ default:
+ throw new Error(
+ `Unsupported payment method type: ${payment_method_type}`
);
}
verifyUrl = true;