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

test(cypress): add multisafepay wallet(AliPay, WeChatPay, MbWay, PayPal) (#12426)

HS-QUALIBOT2c1769048bb9
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
index 8140ae4b32..d39b35f9ba 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
@@ -569,6 +569,30 @@ export const payment_methods_enabled = [
recurring_enabled: false,
installment_payment_enabled: false,
},
+ {
+ payment_method_type: "ali_pay",
+ payment_experience: "redirect_to_url",
+ minimum_amount: 1,
+ maximum_amount: 68607706,
+ recurring_enabled: false,
+ installment_payment_enabled: false,
+ },
+ {
+ payment_method_type: "we_chat_pay",
+ payment_experience: "redirect_to_url",
+ minimum_amount: 1,
+ maximum_amount: 68607706,
+ recurring_enabled: false,
+ installment_payment_enabled: false,
+ },
+ {
+ payment_method_type: "mb_way",
+ payment_experience: "redirect_to_url",
+ minimum_amount: 1,
+ maximum_amount: 68607706,
+ recurring_enabled: false,
+ installment_payment_enabled: false,
+ },
],
},
{
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
index 1b81e87214..9addc95b34 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
@@ -198,6 +198,10 @@ const CURRENCY_MAP = {
Interac: "CAD", // Canadian payment method
AliPayHk: "HKD", // Hong Kong payment method
Affirm: "USD", // US BNPL payment method
+ AliPay: "CNY", // Default ISO-4217 currency; MultiSafepay sandbox overrides to EUR (see Multisafepay.js::wallet_pm.PaymentIntent)
+ WeChatPay: "CNY", // Default ISO-4217 currency; MultiSafepay sandbox overrides to EUR (see Multisafepay.js::wallet_pm.PaymentIntent)
+ Paypal: "EUR",
+ MbWay: "EUR",
Mifinity: "EUR", // Mifinity wallet payment method
// Voucher payment methods
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Multisafepay.js b/cypress-tests/cypress/e2e/configs/Payment/Multisafepay.js
index 6a2188623d..d3388ac84f 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Multisafepay.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Multisafepay.js
@@ -1,8 +1,10 @@
import {
customerAcceptance,
+ standardBillingAddress,
multiUseMandateData,
singleUseMandateData,
} from "./Commons";
+import { getCurrency, getCustomExchange } from "./Modifiers";
const successfulThreeDSTestCardDetails = {
card_number: "5500000000000004",
@@ -967,4 +969,137 @@ export const connectorDetails = {
},
},
},
+ wallet_pm: {
+ PaymentIntent: (paymentMethodType) =>
+ getCustomExchange({
+ Request: {
+ currency: ["AliPay", "WeChatPay"].includes(paymentMethodType)
+ ? "EUR"
+ : getCurrency(paymentMethodType),
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ }),
+
+ AliPay: getCustomExchange({
+ Request: {
+ payment_method: "wallet",
+ payment_method_type: "ali_pay",
+ authentication_type: "no_three_ds",
+ payment_method_data: {
+ wallet: {
+ ali_pay_redirect: {},
+ },
+ },
+ billing: {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "Shanghai",
+ state: "Shanghai",
+ zip: "200000",
+ country: "CN",
+ first_name: "joseph",
+ last_name: "Doe",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ }),
+
+ PayPal: getCustomExchange({
+ // NOTE: MultiSafepay PayPal sandbox enforces CSRF protection, so the
+ // redirection handler skips the click-through (returns verifyUrl=false).
+ // See redirectionHandler.js::bankRedirectRedirection > multisafepay.
+ Request: {
+ payment_method: "wallet",
+ payment_method_type: "paypal",
+ authentication_type: "no_three_ds",
+ payment_method_data: {
+ wallet: {
+ paypal_redirect: {},
+ },
+ },
+ billing: standardBillingAddress,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ }),
+
+ WeChatPay: getCustomExchange({
+ Request: {
+ payment_method: "wallet",
+ payment_method_type: "we_chat_pay",
+ authentication_type: "no_three_ds",
+ payment_method_data: {
+ wallet: {
+ we_chat_pay_redirect: {},
+ },
+ },
+ billing: {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "Shanghai",
+ state: "Shanghai",
+ zip: "200000",
+ country: "CN",
+ first_name: "joseph",
+ last_name: "Doe",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ }),
+
+ MbWay: getCustomExchange({
+ Request: {
+ payment_method: "wallet",
+ payment_method_type: "mb_way",
+ authentication_type: "no_three_ds",
+ payment_method_data: {
+ wallet: {
+ mb_way_redirect: {},
+ },
+ },
+ billing: {
+ address: {
+ zip: "560095",
+ first_name: "John",
+ last_name: "Doe",
+ line1: "Main street",
+ country: "PT",
+ line2: "sub street",
+ city: "city",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ }),
+ },
};
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 7f81924755..b6ca907a1d 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -537,8 +537,11 @@ export const CONNECTOR_LISTS = {
BANK_REDIRECT_MANDATE: ["adyen"],
BLUECODE_WALLET: ["calida"],
ALIPAY_HK_WALLET: ["adyen"],
- PAYPAL_WALLET: ["novalnet", "paypal"],
+ PAYPAL_WALLET: ["novalnet", "paypal", "multisafepay"],
MIFINITY_WALLET: ["mifinity"],
+ ALIPAY_WALLET: ["multisafepay"],
+ WECHATPAY_WALLET: ["multisafepay"],
+ MBWAY_WALLET: ["multisafepay"],
SKRILL_WALLET: ["paysafe"],
PAYSAFECARD_GIFT_CARD: ["paysafe"],
PAYPAL_MANDATE: ["paypal"],
diff --git a/cypress-tests/cypress/e2e/spec/Payment/19-Wallet.cy.js b/cypress-tests/cypress/e2e/spec/Payment/19-Wallet.cy.js
index 9b2515d762..ee6485a620 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/19-Wallet.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/19-Wallet.cy.js
@@ -209,7 +209,7 @@ describe("Wallet tests", () => {
});
context("Mifinity Create and Confirm flow test", () => {
- const shouldContinue = true;
+ let shouldContinue = true;
before("seed global state", function () {
let skip = false;
@@ -243,8 +243,6 @@ describe("Wallet tests", () => {
});
it("Create Payment Intent -> List Merchant Payment Methods -> Confirm Payment -> Handle Wallet Redirection -> Retrieve Payment", () => {
- let shouldContinue = true;
-
cy.step("Create Payment Intent", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
@@ -288,9 +286,9 @@ describe("Wallet tests", () => {
}
});
- cy.step("Handle Bank Redirect Redirection", () => {
+ cy.step("Handle Wallet Redirection", () => {
if (!shouldContinue) {
- cy.task("cli_log", "Skipping step: Handle Bank Redirect Redirection");
+ cy.task("cli_log", "Skipping step: Handle Wallet Redirection");
return;
}
const expected_redirection = fixtures.confirmBody["return_url"];
@@ -316,7 +314,9 @@ describe("Wallet tests", () => {
});
});
-describe("PayPal Wallet tests", () => {
+context("PayPal Create and Confirm flow test", () => {
+ let shouldContinue = true;
+
before("seed global state", function () {
let skip = false;
@@ -346,20 +346,225 @@ describe("PayPal Wallet tests", () => {
cy.task("setGlobalState", globalState.data);
});
- context("PayPal Create and Confirm flow test", () => {
- let shouldContinue = true;
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
+ it("create-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["PaymentIntent"]("PaypalRedirect");
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (shouldContinue) shouldContinue = should_continue_further(data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm PayPal redirect", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["PaypalRedirect"];
+
+ cy.confirmBankRedirectCallTest(
+ fixtures.confirmBody,
+ data,
+ true,
+ globalState
+ );
+
+ if (shouldContinue) shouldContinue = should_continue_further(data);
+ });
+
+ it.skip("Handle wallet redirection", () => {
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+ const nextActionUrl = globalState.get("nextActionUrl");
+
+ expect(
+ nextActionUrl,
+ "nextActionUrl should be defined before handling wallet redirection"
+ ).to.be.a("string");
+
+ cy.handleWalletRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
+
+ it("Sync payment status", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["PaypalRedirect"];
+
+ cy.retrievePaymentCallTest({
+ globalState,
+ data,
+ expectedIntentStatus: "requires_customer_action",
});
+ });
+});
- it("create-payment-call-test", () => {
+context("PayPal Mandate CIT flow test", () => {
+ let shouldContinue = true;
+
+ before("seed global state", function () {
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+ const connector = globalState.get("connectorId");
+
+ if (
+ shouldIncludeConnector(
+ connector,
+ CONNECTOR_LISTS.INCLUDE.PAYPAL_WALLET
+ ) ||
+ shouldIncludeConnector(
+ connector,
+ CONNECTOR_LISTS.INCLUDE.PAYPAL_MANDATE
+ )
+ ) {
+ skip = true;
+ return;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["PaymentIntent"]("PaypalRedirect");
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+ if (shouldContinue) shouldContinue = should_continue_further(data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm PayPal mandate CIT redirect", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["PaypalRedirectMandateCIT"];
+
+ cy.confirmBankRedirectCallTest(
+ fixtures.confirmBody,
+ data,
+ true,
+ globalState
+ );
+
+ if (shouldContinue) shouldContinue = should_continue_further(data);
+ });
+
+ it.skip("Handle wallet redirection", () => {
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+ const nextActionUrl = globalState.get("nextActionUrl");
+
+ expect(
+ nextActionUrl,
+ "nextActionUrl should be defined before handling wallet redirection"
+ ).to.be.a("string");
+
+ cy.handleWalletRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
+
+ it("Sync payment status", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["PaypalRedirectMandateCIT"];
+
+ cy.retrievePaymentCallTest({
+ globalState,
+ data,
+ expectedIntentStatus: "requires_customer_action",
+ });
+ });
+});
+
+context("AliPay Create and Confirm flow test", () => {
+ let shouldContinue = true;
+
+ before("seed global state", function () {
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+ const connector = globalState.get("connectorId");
+
+ if (
+ shouldIncludeConnector(
+ connector,
+ CONNECTOR_LISTS.INCLUDE.ALIPAY_WALLET
+ )
+ ) {
+ skip = true;
+ return;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
+ });
+
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("Create Payment Intent -> List Merchant Payment Methods -> Confirm Payment -> Handle Wallet Redirection -> Retrieve Payment", () => {
+ cy.step("Create Payment Intent", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["PaymentIntent"]("PaypalRedirect");
-
+ ]["PaymentIntent"]("AliPay");
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
data,
@@ -367,50 +572,60 @@ describe("PayPal Wallet tests", () => {
"automatic",
globalState
);
- if (shouldContinue) shouldContinue = should_continue_further(data);
+ if (!should_continue_further(data)) {
+ shouldContinue = false;
+ }
});
- it("payment_methods-call-test", () => {
+ cy.step("List Merchant Payment Methods", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");
+ return;
+ }
cy.paymentMethodsCallTest(globalState);
});
- it("Confirm PayPal redirect", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
+ cy.step("Confirm Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Payment");
+ return;
+ }
+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["PaypalRedirect"];
-
+ ]["AliPay"];
cy.confirmBankRedirectCallTest(
fixtures.confirmBody,
- data,
+ confirmData,
true,
globalState
);
-
- if (shouldContinue) shouldContinue = should_continue_further(data);
+ if (!should_continue_further(confirmData)) {
+ shouldContinue = false;
+ }
});
- it.skip("Handle wallet redirection", () => {
+ cy.step("Handle Wallet Redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle Wallet Redirection");
+ return;
+ }
const expected_redirection = fixtures.confirmBody["return_url"];
const payment_method_type = globalState.get("paymentMethodType");
- const nextActionUrl = globalState.get("nextActionUrl");
-
- expect(
- nextActionUrl,
- "nextActionUrl should be defined before handling wallet redirection"
- ).to.be.a("string");
-
- cy.handleWalletRedirection(
+ cy.handleBankRedirectRedirection(
globalState,
payment_method_type,
expected_redirection
);
});
- it("Sync payment status", () => {
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
const data = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["PaypalRedirect"];
-
+ ]["AliPay"];
cy.retrievePaymentCallTest({
globalState,
data,
@@ -418,46 +633,51 @@ describe("PayPal Wallet tests", () => {
});
});
});
+});
- context("PayPal Mandate CIT flow test", () => {
- let shouldContinue = true;
+context("WeChatPay Create and Confirm flow test", () => {
+ let shouldContinue = true;
- before("seed global state", function () {
- let skip = false;
+ before("seed global state", function () {
+ let skip = false;
- cy.task("getGlobalState")
- .then((state) => {
- globalState = new State(state);
- const connector = globalState.get("connectorId");
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+ const connector = globalState.get("connectorId");
- if (
- shouldIncludeConnector(
- connector,
- CONNECTOR_LISTS.INCLUDE.PAYPAL_MANDATE
- )
- ) {
- skip = true;
- return;
- }
- })
- .then(() => {
- if (skip) {
- this.skip();
- }
- });
- });
+ if (
+ shouldIncludeConnector(
+ connector,
+ CONNECTOR_LISTS.INCLUDE.WECHATPAY_WALLET
+ )
+ ) {
+ skip = true;
+ return;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
+ });
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
- it("create-payment-call-test", () => {
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("Create Payment Intent -> List Merchant Payment Methods -> Confirm Payment -> Handle Wallet Redirection -> Retrieve Payment", () => {
+ cy.step("Create Payment Intent", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["PaymentIntent"]("PaypalRedirect");
-
+ ]["PaymentIntent"]("WeChatPay");
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
data,
@@ -465,50 +685,60 @@ describe("PayPal Wallet tests", () => {
"automatic",
globalState
);
- if (shouldContinue) shouldContinue = should_continue_further(data);
+ if (!should_continue_further(data)) {
+ shouldContinue = false;
+ }
});
- it("payment_methods-call-test", () => {
+ cy.step("List Merchant Payment Methods", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");
+ return;
+ }
cy.paymentMethodsCallTest(globalState);
});
- it("Confirm PayPal mandate CIT redirect", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
+ cy.step("Confirm Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Payment");
+ return;
+ }
+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["PaypalRedirectMandateCIT"];
-
+ ]["WeChatPay"];
cy.confirmBankRedirectCallTest(
fixtures.confirmBody,
- data,
+ confirmData,
true,
globalState
);
-
- if (shouldContinue) shouldContinue = should_continue_further(data);
+ if (!should_continue_further(confirmData)) {
+ shouldContinue = false;
+ }
});
- it.skip("Handle wallet redirection", () => {
+ cy.step("Handle Wallet Redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle Wallet Redirection");
+ return;
+ }
const expected_redirection = fixtures.confirmBody["return_url"];
const payment_method_type = globalState.get("paymentMethodType");
- const nextActionUrl = globalState.get("nextActionUrl");
-
- expect(
- nextActionUrl,
- "nextActionUrl should be defined before handling wallet redirection"
- ).to.be.a("string");
-
- cy.handleWalletRedirection(
+ cy.handleBankRedirectRedirection(
globalState,
payment_method_type,
expected_redirection
);
});
- it("Sync payment status", () => {
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
const data = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["PaypalRedirectMandateCIT"];
-
+ ]["WeChatPay"];
cy.retrievePaymentCallTest({
globalState,
data,
@@ -518,7 +748,9 @@ describe("PayPal Wallet tests", () => {
});
});
-describe("Skrill Wallet tests", () => {
+context("MbWay Create and Confirm flow test", () => {
+ let shouldContinue = true;
+
before("seed global state", function () {
let skip = false;
@@ -530,7 +762,7 @@ describe("Skrill Wallet tests", () => {
if (
shouldIncludeConnector(
connector,
- CONNECTOR_LISTS.INCLUDE.SKRILL_WALLET
+ CONNECTOR_LISTS.INCLUDE.MBWAY_WALLET
)
) {
skip = true;
@@ -539,9 +771,6 @@ describe("Skrill Wallet tests", () => {
})
.then(() => {
if (skip) {
- cy.log(
- "Skipping Skrill wallet tests — connector not in SKRILL_WALLET list"
- );
this.skip();
}
});
@@ -551,50 +780,61 @@ describe("Skrill Wallet tests", () => {
cy.task("setGlobalState", globalState.data);
});
- context("Skrill - Create and Confirm flow test", () => {
- let shouldContinue = true;
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
- it("create-payment-call-test", () => {
+ it("Create Payment Intent -> List Merchant Payment Methods -> Confirm Payment -> Handle Wallet Redirection -> Retrieve Payment", () => {
+ cy.step("Create Payment Intent", () => {
const data = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["PaymentIntent"]("Skrill");
-
+ ]["PaymentIntent"]("MbWay");
cy.createPaymentIntentTest(
fixtures.createPaymentBody,
data,
- "three_ds",
+ "no_three_ds",
"automatic",
globalState
);
- if (shouldContinue) shouldContinue = should_continue_further(data);
+ if (!should_continue_further(data)) {
+ shouldContinue = false;
+ }
});
- it("payment_methods-call-test", () => {
+ cy.step("List Merchant Payment Methods", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: List Merchant Payment Methods");
+ return;
+ }
cy.paymentMethodsCallTest(globalState);
});
- it("Confirm Skrill wallet redirect", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
+ cy.step("Confirm Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Payment");
+ return;
+ }
+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["Skrill"];
-
+ ]["MbWay"];
cy.confirmBankRedirectCallTest(
fixtures.confirmBody,
- data,
+ confirmData,
true,
globalState
);
-
- if (shouldContinue) shouldContinue = should_continue_further(data);
+ if (!should_continue_further(confirmData)) {
+ shouldContinue = false;
+ }
});
- it("Handle Skrill bank redirect redirection", () => {
+ cy.step("Handle Wallet Redirection", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Handle Wallet Redirection");
+ return;
+ }
const expected_redirection = fixtures.confirmBody["return_url"];
const payment_method_type = globalState.get("paymentMethodType");
cy.handleBankRedirectRedirection(
@@ -604,12 +844,113 @@ describe("Skrill Wallet tests", () => {
);
});
- it("Sync payment status", () => {
+ cy.step("Retrieve Payment", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
const data = getConnectorDetails(globalState.get("connectorId"))[
"wallet_pm"
- ]["Skrill"];
-
- cy.retrievePaymentCallTest({ globalState, data });
+ ]["MbWay"];
+ cy.retrievePaymentCallTest({
+ globalState,
+ data,
+ expectedIntentStatus: "requires_customer_action",
+ });
});
});
});
+
+context("Skrill - Create and Confirm flow test", () => {
+ let shouldContinue = true;
+
+ before("seed global state", function () {
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+ const connector = globalState.get("connectorId");
+
+ if (
+ shouldIncludeConnector(
+ connector,
+ CONNECTOR_LISTS.INCLUDE.SKRILL_WALLET
+ )
+ ) {
+ skip = true;
+ return;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ cy.log(
+ "Skipping Skrill wallet tests — connector not in SKRILL_WALLET list"
+ );
+ this.skip();
+ }
+ });
+ });
+
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["PaymentIntent"]("Skrill");
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "three_ds",
+ "automatic",
+ globalState
+ );
+ if (shouldContinue) shouldContinue = should_continue_further(data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm Skrill wallet redirect", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["Skrill"];
+
+ cy.confirmBankRedirectCallTest(
+ fixtures.confirmBody,
+ data,
+ true,
+ globalState
+ );
+
+ if (shouldContinue) shouldContinue = should_continue_further(data);
+ });
+
+ it("Handle Skrill bank redirect redirection", () => {
+ const expected_redirection = fixtures.confirmBody["return_url"];
+ const payment_method_type = globalState.get("paymentMethodType");
+ cy.handleBankRedirectRedirection(
+ globalState,
+ payment_method_type,
+ expected_redirection
+ );
+ });
+
+ it("Sync payment status", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["Skrill"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+});
diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.js
index 7c54759eb7..071797c895 100644
--- a/cypress-tests/cypress/support/redirectionHandler.js
+++ b/cypress-tests/cypress/support/redirectionHandler.js
@@ -1215,6 +1215,7 @@ function bankRedirectRedirection(
);
verifyUrl = false;
break;
+
// The 'ideal' case is handled outside handleFlow
default:
throw new Error(
@@ -1625,7 +1626,16 @@ function bankRedirectRedirection(
break;
case "multisafepay":
- if (["sofort", "eps", "mbway"].includes(paymentMethodType)) {
+ if (
+ [
+ "sofort",
+ "eps",
+ "mb_way",
+ "ali_pay",
+ "paypal",
+ "we_chat_pay",
+ ].includes(paymentMethodType)
+ ) {
// Multisafe pay has CSRF blocking cannot actually test redirection flow via cypress
// cy.get(".btn-msp-success").click();