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

refactor(cypress): error handling and add sync refunds in places where missing (#5128)

Pa1NarKddfdc35f707f
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js
index 98ff9c5c15..35f230a3f5 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js
@@ -2,8 +2,7 @@ import confirmBody from "../../fixtures/confirm-body.json";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import voidBody from "../../fixtures/void-payment-body.json";
import State from "../../utils/State";
-import getConnectorDetails from "../PaymentUtils/utils";
-import * as utils from "../PaymentUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/utils";
let globalState;
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js
index 163607e42c..857584fd1b 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js
@@ -80,6 +80,17 @@ describe("Card - Refund flow - No 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
context("Card - Partial Refund flow test for No-3DS", () => {
@@ -151,6 +162,17 @@ describe("Card - Refund flow - No 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
context(
@@ -197,6 +219,17 @@ describe("Card - Refund flow - No 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SyncRefund"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
}
);
@@ -779,6 +812,17 @@ describe("Card - Refund flow - 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
context("Card - Partial Refund flow test for 3DS", () => {
@@ -854,6 +898,17 @@ describe("Card - Refund flow - 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
context("Fully Refund Card-ThreeDS payment flow test Create+Confirm", () => {
@@ -902,6 +957,17 @@ describe("Card - Refund flow - 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
context(
@@ -1054,6 +1120,17 @@ describe("Card - Refund flow - 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
context("Card - Partial Refund for fully captured 3DS payment", () => {
@@ -1143,6 +1220,17 @@ describe("Card - Refund flow - 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
context("Card - Full Refund for partially captured 3DS payment", () => {
@@ -1222,6 +1310,17 @@ describe("Card - Refund flow - 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
context("Card - partial Refund for partially captured 3DS payment", () => {
@@ -1301,5 +1400,16 @@ describe("Card - Refund flow - 3DS", () => {
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});
+
+ it("sync-refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "SyncRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.syncRefundCallTest(req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
});
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
index 9fb1052aa6..3d2a070490 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
@@ -6,16 +6,6 @@ import getConnectorDetails, * as utils from "../PaymentUtils/utils";
let globalState;
describe("Bank Redirect tests", () => {
- before("seed global state", () => {
- cy.task("getGlobalState").then((state) => {
- globalState = new State(state);
- });
- });
-
- after("flush global state", () => {
- cy.task("setGlobalState", globalState.data);
- });
-
afterEach("flush global state", () => {
cy.task("setGlobalState", globalState.data);
});
@@ -23,6 +13,12 @@ describe("Bank Redirect tests", () => {
context("Blik Create and Confirm flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
beforeEach(function () {
if (!should_continue) {
this.skip();
@@ -72,11 +68,18 @@ describe("Bank Redirect tests", () => {
context("EPS Create and Confirm flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
beforeEach(function () {
if (!should_continue) {
this.skip();
}
});
+
it("create-payment-call-test", () => {
let data = getConnectorDetails(globalState.get("connectorId"))[
"bank_redirect_pm"
@@ -131,6 +134,12 @@ describe("Bank Redirect tests", () => {
context("iDEAL Create and Confirm flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
beforeEach(function () {
if (!should_continue) {
this.skip();
@@ -191,6 +200,12 @@ describe("Bank Redirect tests", () => {
context("Giropay Create and Confirm flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
beforeEach(function () {
if (!should_continue) {
this.skip();
@@ -250,6 +265,12 @@ describe("Bank Redirect tests", () => {
context("Sofort Create and Confirm flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
beforeEach(function () {
if (!should_continue) {
this.skip();
@@ -309,6 +330,12 @@ describe("Bank Redirect tests", () => {
context("Przelewy24 Create and Confirm flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
beforeEach(function () {
if (!should_continue) {
this.skip();
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js
index 926e8f3631..f7c0fcc984 100644
--- a/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js
@@ -8,18 +8,12 @@ import getConnectorDetails, * as utils from "../PaymentUtils/utils";
let globalState;
describe("Card - Mandates using Payment Method Id flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
});
});
- after("flush global state", () => {
- cy.task("setGlobalState", globalState.data);
- });
-
afterEach("flush global state", () => {
cy.task("setGlobalState", globalState.data);
});
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
index 9d489b713f..72090f9172 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
@@ -54,7 +54,9 @@ export const connectorDetails = {
card_pm: {
PaymentIntent: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -68,7 +70,9 @@ export const connectorDetails = {
},
"3DSManualCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -82,7 +86,9 @@ export const connectorDetails = {
},
"3DSAutoCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -96,7 +102,9 @@ export const connectorDetails = {
},
No3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -110,7 +118,9 @@ export const connectorDetails = {
},
No3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -124,7 +134,9 @@ export const connectorDetails = {
},
Capture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -169,10 +181,6 @@ export const connectorDetails = {
body: {
status: "pending",
},
- status: 200,
- body: {
- status: "pending",
- },
},
},
PartialRefund: {
@@ -334,7 +342,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -355,7 +365,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -674,33 +686,6 @@ 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/BankOfAmerica.js b/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js
index fe37a11346..79ea91e1ed 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js
@@ -52,7 +52,9 @@ export const connectorDetails = {
card_pm: {
PaymentIntent: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -66,7 +68,9 @@ export const connectorDetails = {
},
"3DSManualCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -80,7 +84,9 @@ export const connectorDetails = {
},
"3DSAutoCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -94,7 +100,9 @@ export const connectorDetails = {
},
No3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -108,7 +116,9 @@ export const connectorDetails = {
},
No3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -122,7 +132,9 @@ export const connectorDetails = {
},
Capture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -159,7 +171,9 @@ export const connectorDetails = {
},
Refund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -172,7 +186,9 @@ export const connectorDetails = {
},
PartialRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -185,7 +201,9 @@ export const connectorDetails = {
},
SyncRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -333,7 +351,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -354,7 +374,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js b/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
index aa61184aed..d8995661e0 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
@@ -14,45 +14,13 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "737",
};
-const singleUseMandateData = {
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
- },
-};
-
-const multiUseMandateData = {
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
- },
-};
-
export const connectorDetails = {
card_pm: {
PaymentIntent: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -66,7 +34,9 @@ export const connectorDetails = {
},
"3DSManualCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -80,7 +50,9 @@ export const connectorDetails = {
},
"3DSAutoCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -94,7 +66,9 @@ export const connectorDetails = {
},
No3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -108,7 +82,9 @@ export const connectorDetails = {
},
No3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -122,7 +98,9 @@ export const connectorDetails = {
},
Capture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -159,7 +137,9 @@ export const connectorDetails = {
},
Refund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -172,20 +152,9 @@ export const connectorDetails = {
},
PartialRefund: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- },
- Response: {
- status: 200,
- body: {
- status: "succeeded",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
- },
- },
- SyncRefund: {
- Request: {
- card: successfulNo3DSCardDetails,
currency: "USD",
customer_acceptance: null,
},
@@ -196,174 +165,22 @@ export const connectorDetails = {
},
},
},
- MandateSingleUse3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- MandateSingleUse3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- MandateSingleUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- MandateSingleUseNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- MandateMultiUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- MandateMultiUseNo3DSManualCapture: {
+ SyncRefund: {
Request: {
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- MandateMultiUse3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- MandateMultiUse3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
+ customer_acceptance: null,
},
Response: {
- status: 400,
+ status: 200,
body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
+ status: "succeeded",
},
},
},
ZeroAuthMandate: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
Response: {
status: 501,
body: {
@@ -377,7 +194,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -398,7 +217,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -417,118 +238,5 @@ export const connectorDetails = {
},
},
},
- PaymentMethodIdMandateNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- PaymentMethodIdMandateNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by bluesnap",
- },
- },
- },
- },
},
};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
index d15ff44d70..56aebf488d 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
@@ -41,6 +41,40 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "999",
};
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
/*
`getDefaultExchange` contains the default Request and Response to be considered if none provided.
`getCustomExchange` takes in 2 optional fields named as Request and Response.
@@ -64,6 +98,22 @@ const getDefaultExchange = () => ({
},
});
+const getUnsupportedExchange = () => ({
+ Request: {
+ currency: "EUR",
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: `Payment method type not supported`,
+ code: "HE_03",
+ },
+ },
+ },
+});
+
// Const to get PaymentExchange with overridden properties
export const getCustomExchange = (overrides) => {
const defaultExchange = getDefaultExchange();
@@ -81,6 +131,11 @@ export const getCustomExchange = (overrides) => {
};
};
+// Function to update the default status code
+export const updateDefaultStatusCode = () => {
+ return getUnsupportedExchange().Response;
+};
+
export const payment_methods_enabled = [
{
payment_method: "bank_redirect",
@@ -278,13 +333,10 @@ export const payment_methods_enabled = [
];
export const connectorDetails = {
- card_pm: {
+ bank_transfer_pm: {
PaymentIntent: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- setup_future_usage: "on_session",
+ currency: "BRL",
},
Response: {
status: 200,
@@ -293,500 +345,508 @@ export const connectorDetails = {
},
},
}),
- "3DSManualCapture": getCustomExchange({
- Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- }),
- "3DSAutoCapture": getCustomExchange({
- Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- }),
- No3DSManualCapture: getCustomExchange({
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- }),
- No3DSAutoCapture: getCustomExchange({
+ Pix: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- setup_future_usage: "on_session",
+ payment_method: "bank_transfer",
+ payment_method_type: "pix",
+ payment_method_data: {
+ bank_transfer: {
+ pix: {},
+ },
+ },
+ 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",
+ },
+ },
+ currency: "BRL",
},
}),
- Capture: getCustomExchange({
+ },
+ bank_redirect_pm: {
+ PaymentIntent: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
+ currency: "EUR",
},
- }),
- PartialCapture: getCustomExchange({
- Request: {},
- }),
- Void: getCustomExchange({
- Request: {},
Response: {
- status: 400,
+ status: 200,
body: {
- error: {
- code: "IR_16",
- message:
- "You cannot cancel this payment because it has status processing",
- type: "invalid_request",
- },
+ status: "requires_payment_method",
},
},
}),
- Refund: getCustomExchange({
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- },
- }),
- PartialRefund: getCustomExchange({
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- },
- }),
- SyncRefund: getCustomExchange({
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- },
- }),
- MandateSingleUse3DSAutoCapture: getCustomExchange({
+ ideal: getCustomExchange({
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
+ payment_method: "bank_redirect",
+ payment_method_type: "ideal",
+ payment_method_data: {
+ bank_redirect: {
+ ideal: {
+ bank_name: "ing",
+ country: "NL",
+ },
},
},
- },
- }),
- MandateSingleUse3DSManualCapture: getCustomExchange({
- Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
+ billing: {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "San Fransico",
+ state: "California",
+ zip: "94122",
+ country: "NL",
+ first_name: "john",
+ last_name: "doe",
},
},
},
}),
- MandateSingleUseNo3DSAutoCapture: getCustomExchange({
+ giropay: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
+ payment_method: "bank_redirect",
+ payment_method_type: "giropay",
+ payment_method_data: {
+ bank_redirect: {
+ giropay: {
+ bank_name: "",
+ bank_account_bic: "",
+ bank_account_iban: "",
+ preferred_language: "en",
+ country: "DE",
+ },
},
},
- },
- }),
- MandateSingleUseNo3DSManualCapture: getCustomExchange({
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
+ billing: {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "San Fransico",
+ state: "California",
+ zip: "94122",
+ country: "DE",
+ first_name: "john",
+ last_name: "doe",
},
},
},
}),
- MandateMultiUseNo3DSAutoCapture: getCustomExchange({
+ sofort: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
+ payment_method: "bank_redirect",
+ payment_method_type: "sofort",
+ payment_method_data: {
+ bank_redirect: {
+ sofort: {
+ country: "DE",
+ preferred_language: "en",
+ },
},
},
- },
- }),
- MandateMultiUseNo3DSManualCapture: getCustomExchange({
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
+ billing: {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "San Fransico",
+ state: "California",
+ zip: "94122",
+ country: "DE",
+ first_name: "john",
+ last_name: "doe",
},
},
},
}),
- MandateMultiUse3DSAutoCapture: getCustomExchange({
+ eps: getCustomExchange({
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
+ payment_method: "bank_redirect",
+ payment_method_type: "eps",
+ payment_method_data: {
+ bank_redirect: {
+ eps: {
+ bank_name: "ing",
+ },
},
},
- },
- }),
- MandateMultiUse3DSManualCapture: getCustomExchange({
- Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
+ billing: {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "San Fransico",
+ state: "California",
+ zip: "94122",
+ country: "AT",
+ first_name: "john",
+ last_name: "doe",
},
},
},
}),
- ZeroAuthMandate: getCustomExchange({
+ przelewy24: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
+ payment_method: "bank_redirect",
+ payment_method_type: "przelewy24",
+ payment_method_data: {
+ bank_redirect: {
+ przelewy24: {
+ bank_name: "citi",
+ billing_details: {
+ email: "[email protected]",
+ },
+ },
},
},
},
}),
- SaveCardUseNo3DSAutoCapture: getCustomExchange({
+ blikPaymentIntent: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- setup_future_usage: "on_session",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "127.0.0.1",
- user_agent: "amet irure esse",
- },
+ currency: "PLN",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
},
},
}),
- SaveCardUseNo3DSManualCapture: getCustomExchange({
+ blik: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- setup_future_usage: "on_session",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "127.0.0.1",
- user_agent: "amet irure esse",
+ payment_method: "bank_redirect",
+ payment_method_type: "blik",
+ payment_method_data: {
+ bank_redirect: {
+ blik: {
+ blik_code: "777987",
+ },
+ },
+ },
+ billing: {
+ address: {
+ line1: "1467",
+ line2: "Harrison Street",
+ line3: "Harrison Street",
+ city: "San Fransico",
+ state: "California",
+ zip: "94122",
+ country: "PL",
+ first_name: "john",
+ last_name: "doe",
},
},
},
}),
- PaymentMethodIdMandateNo3DSAutoCapture: getCustomExchange({
+ },
+ card_pm: {
+ PaymentIntent: getCustomExchange({
+ Request: {
+ currency: "USD",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ }),
+ "3DSManualCapture": getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ }),
+ "3DSAutoCapture": getCustomExchange({
Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ }),
+ No3DSManualCapture: getCustomExchange({
+ Request: {
+ payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ }),
+ No3DSAutoCapture: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
},
}),
- PaymentMethodIdMandateNo3DSManualCapture: getCustomExchange({
+ Capture: getCustomExchange({
Request: {
+ payment_method: "card",
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
+ customer_acceptance: null,
+ },
+ }),
+ PartialCapture: getCustomExchange({
+ Request: {},
+ }),
+ Void: getCustomExchange({
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "cancelled",
+ capture_method: "manual",
},
},
}),
- PaymentMethodIdMandate3DSAutoCapture: getCustomExchange({
+ Refund: getCustomExchange({
Request: {
+ payment_method: "card",
payment_method_data: {
- card: successfulThreeDSTestCardDetails,
+ card: successfulNo3DSCardDetails,
},
currency: "USD",
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
+ customer_acceptance: null,
+ },
+ }),
+ PartialRefund: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ customer_acceptance: null,
},
}),
- PaymentMethodIdMandate3DSManualCapture: getCustomExchange({
+ SyncRefund: getCustomExchange({
Request: {
+ payment_method: "card",
payment_method_data: {
- card: successfulThreeDSTestCardDetails,
+ card: successfulNo3DSCardDetails,
},
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ }),
+ MandateSingleUse3DSAutoCapture: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
}),
- },
- bank_transfer_pm: {
- PaymentIntent: getCustomExchange({
+ MandateSingleUse3DSManualCapture: getCustomExchange({
Request: {
- currency: "BRL",
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
- Response: {
- status: 200,
- body: {
- status: "requires_payment_method",
+ }),
+ MandateSingleUseNo3DSAutoCapture: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
}),
- Pix: getCustomExchange({
+ MandateSingleUseNo3DSManualCapture: getCustomExchange({
Request: {
- payment_method: "bank_transfer",
- payment_method_type: "pix",
+ payment_method: "card",
payment_method_data: {
- bank_transfer: {
- pix: {},
- },
+ card: successfulNo3DSCardDetails,
},
- 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",
- },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ }),
+ MandateMultiUseNo3DSAutoCapture: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
- currency: "BRL",
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
}),
- },
- bank_redirect_pm: {
- PaymentIntent: getCustomExchange({
+ MandateMultiUseNo3DSManualCapture: getCustomExchange({
Request: {
- currency: "EUR",
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
- Response: {
- status: 200,
- body: {
- status: "requires_payment_method",
+ }),
+ MandateMultiUse3DSAutoCapture: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
}),
- ideal: getCustomExchange({
+ MandateMultiUse3DSManualCapture: getCustomExchange({
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "ideal",
+ payment_method: "card",
payment_method_data: {
- bank_redirect: {
- ideal: {
- bank_name: "ing",
- country: "NL",
- },
- },
+ card: successfulThreeDSTestCardDetails,
},
- billing: {
- address: {
- line1: "1467",
- line2: "Harrison Street",
- line3: "Harrison Street",
- city: "San Fransico",
- state: "California",
- zip: "94122",
- country: "NL",
- first_name: "john",
- last_name: "doe",
- },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ }),
+ ZeroAuthMandate: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
}),
- giropay: getCustomExchange({
+ SaveCardUseNo3DSAutoCapture: getCustomExchange({
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "giropay",
+ payment_method: "card",
payment_method_data: {
- bank_redirect: {
- giropay: {
- bank_name: "",
- bank_account_bic: "",
- bank_account_iban: "",
- preferred_language: "en",
- country: "DE",
- },
- },
+ card: successfulNo3DSCardDetails,
},
- billing: {
- address: {
- line1: "1467",
- line2: "Harrison Street",
- line3: "Harrison Street",
- city: "San Fransico",
- state: "California",
- zip: "94122",
- country: "DE",
- first_name: "john",
- last_name: "doe",
+ currency: "USD",
+ setup_future_usage: "on_session",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "127.0.0.1",
+ user_agent: "amet irure esse",
},
},
},
}),
- sofort: getCustomExchange({
+ SaveCardUseNo3DSManualCapture: getCustomExchange({
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "sofort",
+ payment_method: "card",
payment_method_data: {
- bank_redirect: {
- sofort: {
- country: "DE",
- preferred_language: "en",
- },
- },
+ card: successfulNo3DSCardDetails,
},
- billing: {
- address: {
- line1: "1467",
- line2: "Harrison Street",
- line3: "Harrison Street",
- city: "San Fransico",
- state: "California",
- zip: "94122",
- country: "DE",
- first_name: "john",
- last_name: "doe",
+ currency: "USD",
+ setup_future_usage: "on_session",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "127.0.0.1",
+ user_agent: "amet irure esse",
},
},
},
}),
- eps: getCustomExchange({
+ PaymentMethodIdMandateNo3DSAutoCapture: getCustomExchange({
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "eps",
payment_method_data: {
- bank_redirect: {
- eps: {
- bank_name: "ing",
- },
- },
+ card: successfulNo3DSCardDetails,
},
- billing: {
- address: {
- line1: "1467",
- line2: "Harrison Street",
- line3: "Harrison Street",
- city: "San Fransico",
- state: "California",
- zip: "94122",
- country: "AT",
- first_name: "john",
- last_name: "doe",
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
},
},
},
}),
- przelewy24: getCustomExchange({
+ PaymentMethodIdMandateNo3DSManualCapture: getCustomExchange({
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "przelewy24",
payment_method_data: {
- bank_redirect: {
- przelewy24: {
- bank_name: "citi",
- billing_details: {
- email: "[email protected]",
- },
- },
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
},
},
},
}),
- blikPaymentIntent: getCustomExchange({
+ PaymentMethodIdMandate3DSAutoCapture: getCustomExchange({
Request: {
- currency: "PLN",
- },
- Response: {
- status: 200,
- body: {
- status: "requires_payment_method",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
},
},
}),
- blik: getCustomExchange({
+ PaymentMethodIdMandate3DSManualCapture: getCustomExchange({
Request: {
- payment_method: "bank_redirect",
- payment_method_type: "blik",
payment_method_data: {
- bank_redirect: {
- blik: {
- blik_code: "777987",
- },
- },
+ card: successfulThreeDSTestCardDetails,
},
- billing: {
- address: {
- line1: "1467",
- line2: "Harrison Street",
- line3: "Harrison Street",
- city: "San Fransico",
- state: "California",
- zip: "94122",
- country: "PL",
- first_name: "john",
- last_name: "doe",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
},
},
},
@@ -811,7 +871,7 @@ export const connectorDetails = {
payment_method_data: {
upi: {
upi_collect: {
- vpa_id: "successtest@ita",
+ vpa_id: "successtest@iata",
},
},
},
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js
index fe37a11346..79ea91e1ed 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js
@@ -52,7 +52,9 @@ export const connectorDetails = {
card_pm: {
PaymentIntent: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -66,7 +68,9 @@ export const connectorDetails = {
},
"3DSManualCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -80,7 +84,9 @@ export const connectorDetails = {
},
"3DSAutoCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -94,7 +100,9 @@ export const connectorDetails = {
},
No3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -108,7 +116,9 @@ export const connectorDetails = {
},
No3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -122,7 +132,9 @@ export const connectorDetails = {
},
Capture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -159,7 +171,9 @@ export const connectorDetails = {
},
Refund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -172,7 +186,9 @@ export const connectorDetails = {
},
PartialRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -185,7 +201,9 @@ export const connectorDetails = {
},
SyncRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -333,7 +351,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -354,7 +374,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Iatapay.js b/cypress-tests/cypress/e2e/PaymentUtils/Iatapay.js
index ae5e61137b..fe9e0c68e0 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Iatapay.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Iatapay.js
@@ -1,53 +1,3 @@
-const successfulNo3DSCardDetails = {
- card_number: "371449635398431",
- card_exp_month: "03",
- card_exp_year: "30",
- card_holder_name: "John Doe",
- card_cvc: "7373",
-};
-
-const successfulThreeDSTestCardDetails = {
- card_number: "4917610000000000",
- card_exp_month: "03",
- card_exp_year: "30",
- card_holder_name: "Joseph Doe",
- card_cvc: "737",
-};
-
-const multiUseMandateData = {
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
- },
-};
-
-const singleUseMandateData = {
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
- },
-};
-
export const connectorDetails = {
bank_redirect_pm: {
ideal: {
@@ -84,250 +34,7 @@ export const connectorDetails = {
},
},
card_pm: {
- Capture: {
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- },
- Response: {
- status: 404,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment does not exist in our records",
- code: "HE_02",
- },
- },
- },
- },
- No3DSManualCapture: {
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- "3DSManualCapture": {
- Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateMultiUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateSingleUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateSingleUseNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateMultiUseNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- PaymentMethodIdMandateNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- PaymentMethodIdMandateNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
ZeroAuthMandate: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
Response: {
status: 501,
body: {
@@ -339,15 +46,6 @@ export const connectorDetails = {
},
},
},
- Void: {
- Request: {},
- Response: {
- status: 200,
- body: {
- status: "cancelled",
- },
- },
- },
},
upi_pm: {
PaymentIntent: {
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js b/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js
index 7e9369cb44..70eea459dc 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js
@@ -52,7 +52,9 @@ export const connectorDetails = {
card_pm: {
PaymentIntent: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -66,7 +68,9 @@ export const connectorDetails = {
},
"3DSManualCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -80,7 +84,9 @@ export const connectorDetails = {
},
"3DSAutoCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -94,7 +100,9 @@ export const connectorDetails = {
},
No3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -108,7 +116,9 @@ export const connectorDetails = {
},
No3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -122,7 +132,9 @@ export const connectorDetails = {
},
Capture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -162,7 +174,9 @@ export const connectorDetails = {
},
Refund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -175,7 +189,9 @@ export const connectorDetails = {
},
PartialRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -187,186 +203,21 @@ export const connectorDetails = {
},
},
SyncRefund: {
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- },
- Response: {
- status: 200,
- body: {
- status: "succeeded",
- },
- },
- },
- MandateSingleUse3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- MandateSingleUse3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- MandateSingleUseNo3DSAutoCapture: {
Request: {
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- MandateSingleUseNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- MandateMultiUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- MandateMultiUseNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- MandateMultiUse3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- MandateMultiUse3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
+ customer_acceptance: null,
},
Response: {
- status: 400,
+ status: 200,
body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
+ status: "succeeded",
},
},
},
ZeroAuthMandate: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
Response: {
status: 501,
body: {
@@ -380,7 +231,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -401,7 +254,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -420,118 +275,5 @@ export const connectorDetails = {
},
},
},
- PaymentMethodIdMandateNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- PaymentMethodIdMandateNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by nmi",
- },
- },
- },
- },
},
};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js b/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
index 960a25f056..1aa4bc9c1a 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
@@ -16,45 +16,13 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "123",
};
-const singleUseMandateData = {
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
- },
-};
-
-const multiUseMandateData = {
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
- },
-};
-
export const connectorDetails = {
card_pm: {
PaymentIntent: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -68,7 +36,9 @@ export const connectorDetails = {
},
"3DSManualCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -82,7 +52,9 @@ export const connectorDetails = {
},
"3DSAutoCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -96,7 +68,9 @@ export const connectorDetails = {
},
No3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -110,7 +84,9 @@ export const connectorDetails = {
},
No3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -124,7 +100,9 @@ export const connectorDetails = {
},
Capture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -161,7 +139,9 @@ export const connectorDetails = {
},
Refund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -179,7 +159,9 @@ export const connectorDetails = {
},
PartialRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -197,7 +179,9 @@ export const connectorDetails = {
},
SyncRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -213,173 +197,7 @@ export const connectorDetails = {
},
},
},
- MandateSingleUse3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- MandateSingleUse3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- MandateSingleUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- MandateSingleUseNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- MandateMultiUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- MandateMultiUseNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- MandateMultiUse3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- MandateMultiUse3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
ZeroAuthMandate: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
Response: {
status: 501,
body: {
@@ -393,7 +211,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -414,7 +234,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -433,119 +255,6 @@ export const connectorDetails = {
},
},
},
- PaymentMethodIdMandateNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- PaymentMethodIdMandateNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by paypal",
- },
- },
- },
- },
},
bank_redirect_pm: {
PaymentIntent: getCustomExchange({
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
index e4002d5565..c2f8b171dd 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
@@ -1,8 +1,5 @@
import { getCustomExchange } from "./Commons";
-const successfulTestCard = "4242424242424242";
-const successful3DSCard = "4000002500003155";
-
const successfulNo3DSCardDetails = {
card_number: "4242424242424242",
card_exp_month: "10",
@@ -57,7 +54,9 @@ export const connectorDetails = {
card_pm: {
PaymentIntent: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -71,7 +70,9 @@ export const connectorDetails = {
},
"3DSManualCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -85,7 +86,9 @@ export const connectorDetails = {
},
"3DSAutoCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -99,7 +102,9 @@ export const connectorDetails = {
},
No3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -113,7 +118,9 @@ export const connectorDetails = {
},
No3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -127,7 +134,9 @@ export const connectorDetails = {
},
Capture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -164,7 +173,9 @@ export const connectorDetails = {
},
Refund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -177,7 +188,9 @@ export const connectorDetails = {
},
PartialRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -190,7 +203,9 @@ export const connectorDetails = {
},
SyncRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -338,7 +353,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -359,7 +376,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -550,7 +569,10 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
- status: "requires_customer_action",
+ status: "failed",
+ error_code: "payment_method_not_available",
+ error_message:
+ "Giropay is deprecated and can no longer be used for payment acceptance. Please refer to https://docs.stripe.com/payments/giropay",
},
},
},
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
index 6c5fda5702..651bc7d06b 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
@@ -16,23 +16,6 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "737",
};
-const singleUseMandateData = {
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
- },
-};
-
const multiUseMandateData = {
customer_acceptance: {
acceptance_type: "offline",
@@ -54,7 +37,9 @@ export const connectorDetails = {
card_pm: {
PaymentIntent: getCustomExchange({
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -68,7 +53,9 @@ export const connectorDetails = {
}),
"3DSAutoCapture": {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -80,28 +67,11 @@ export const connectorDetails = {
},
},
},
- "3DSManualCapture": {
- Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "manual is not supported by trustpay",
- },
- },
- },
- },
No3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
@@ -113,28 +83,11 @@ export const connectorDetails = {
},
},
},
- No3DSManualCapture: {
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- setup_future_usage: "on_session",
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "manual is not supported by trustpay",
- },
- },
- },
- },
Capture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -152,7 +105,9 @@ export const connectorDetails = {
},
PartialCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
paymentSuccessfulStatus: "succeeded",
paymentSyncStatus: "succeeded",
@@ -183,7 +138,9 @@ export const connectorDetails = {
},
Refund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -196,7 +153,9 @@ export const connectorDetails = {
},
PartialRefund: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
customer_acceptance: null,
},
@@ -209,129 +168,17 @@ export const connectorDetails = {
},
},
SyncRefund: {
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- customer_acceptance: null,
- },
- Response: {
- status: 200,
- body: {
- status: "succeeded",
- },
- },
- },
- MandateSingleUse3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateSingleUse3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateSingleUseNo3DSManualCapture: {
Request: {
payment_method_data: {
card: successfulNo3DSCardDetails,
},
currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateSingleUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: singleUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateMultiUseNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- MandateMultiUseNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
+ customer_acceptance: null,
},
Response: {
- status: 400,
+ status: 200,
body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
+ status: "succeeded",
},
},
},
@@ -350,33 +197,7 @@ export const connectorDetails = {
},
},
},
- MandateMultiUse3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
ZeroAuthMandate: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: multiUseMandateData,
- },
Response: {
status: 501,
body: {
@@ -390,7 +211,9 @@ export const connectorDetails = {
},
SaveCardUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
currency: "USD",
setup_future_usage: "on_session",
customer_acceptance: {
@@ -409,144 +232,6 @@ export const connectorDetails = {
},
},
},
- SaveCardUseNo3DSManualCapture: {
- Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- setup_future_usage: "on_session",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "127.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- },
- },
- },
- },
- PaymentMethodIdMandateNo3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by trustpay",
- },
- },
- },
- },
- PaymentMethodIdMandateNo3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulNo3DSCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "manual is not supported by trustpay",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSAutoCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- currency: "USD",
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "debit mandate payment is not supported by trustpay",
- },
- },
- },
- },
- PaymentMethodIdMandate3DSManualCapture: {
- Request: {
- payment_method_data: {
- card: successfulThreeDSTestCardDetails,
- },
- mandate_data: null,
- authentication_type: "three_ds",
- customer_acceptance: {
- acceptance_type: "offline",
- accepted_at: "1963-05-03T04:07:52.723Z",
- online: {
- ip_address: "125.0.0.1",
- user_agent: "amet irure esse",
- },
- },
- },
- Response: {
- status: 400,
- body: {
- error: {
- type: "invalid_request",
- message: "Payment method type not supported",
- code: "HE_03",
- reason: "manual is not supported by trustpay",
- },
- },
- },
- },
},
bank_redirect_pm: {
PaymentIntent: getCustomExchange({
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/utils.js b/cypress-tests/cypress/e2e/PaymentUtils/utils.js
index 3f41549bb8..a337b0c29f 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/utils.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/utils.js
@@ -1,7 +1,10 @@
import { connectorDetails as adyenConnectorDetails } from "./Adyen.js";
import { connectorDetails as bankOfAmericaConnectorDetails } from "./BankOfAmerica.js";
import { connectorDetails as bluesnapConnectorDetails } from "./Bluesnap.js";
-import { connectorDetails as CommonConnectorDetails } from "./Commons.js";
+import {
+ connectorDetails as CommonConnectorDetails,
+ updateDefaultStatusCode,
+} from "./Commons.js";
import { connectorDetails as cybersourceConnectorDetails } from "./Cybersource.js";
import { connectorDetails as iatapayConnectorDetails } from "./Iatapay.js";
import { connectorDetails as nmiConnectorDetails } from "./Nmi.js";
@@ -62,7 +65,7 @@ function mergeConnectorDetails(source, fallback) {
return merged;
}
-function getValueByKey(jsonObject, key) {
+export function getValueByKey(jsonObject, key) {
const data =
typeof jsonObject === "string" ? JSON.parse(jsonObject) : jsonObject;
@@ -84,3 +87,18 @@ export const should_continue_further = (res_data) => {
return true;
}
};
+
+export function defaultErrorHandler(response, response_data) {
+ if (
+ response.status === 400 &&
+ response.body.error.message === "Payment method type not supported"
+ ) {
+ // Update the default status from 501 to 400 as `unsupported payment method` error is the next common error after `not implemented` error
+ response_data = updateDefaultStatusCode();
+ }
+
+ expect(response.body).to.have.property("error");
+ for (const key in response_data.body.error) {
+ expect(response_data.body.error[key]).to.equal(response.body.error[key]);
+ }
+}
diff --git a/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js b/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js
index 096d31ce71..2b4cdf9e2d 100644
--- a/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js
+++ b/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js
@@ -42,7 +42,7 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
- status: "requires_creation",
+ status: "requires_confirmation",
payout_type: "card",
},
},
@@ -124,7 +124,7 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
- status: "requires_creation",
+ status: "requires_confirmation",
payout_type: "bank",
},
},
diff --git a/cypress-tests/cypress/e2e/PayoutUtils/AdyenPlatform.js b/cypress-tests/cypress/e2e/PayoutUtils/AdyenPlatform.js
index e1304afcc3..75b45aac20 100644
--- a/cypress-tests/cypress/e2e/PayoutUtils/AdyenPlatform.js
+++ b/cypress-tests/cypress/e2e/PayoutUtils/AdyenPlatform.js
@@ -32,7 +32,7 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
- status: "requires_creation",
+ status: "requires_confirmation",
payout_type: "bank",
},
},
diff --git a/cypress-tests/cypress/e2e/PayoutUtils/Commons.js b/cypress-tests/cypress/e2e/PayoutUtils/Commons.js
index c7705aee26..4036ee7f61 100644
--- a/cypress-tests/cypress/e2e/PayoutUtils/Commons.js
+++ b/cypress-tests/cypress/e2e/PayoutUtils/Commons.js
@@ -107,7 +107,7 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
- status: "requires_creation",
+ status: "requires_confirmation",
payout_type: "card",
},
},
@@ -175,7 +175,7 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
- status: "requires_creation",
+ status: "requires_confirmation",
payout_type: "bank",
},
},
diff --git a/cypress-tests/cypress/e2e/PayoutUtils/Wise.js b/cypress-tests/cypress/e2e/PayoutUtils/Wise.js
index 0a69697fc3..829a28fda4 100644
--- a/cypress-tests/cypress/e2e/PayoutUtils/Wise.js
+++ b/cypress-tests/cypress/e2e/PayoutUtils/Wise.js
@@ -141,7 +141,7 @@ export const connectorDetails = {
Response: {
status: 200,
body: {
- status: "requires_creation",
+ status: "requires_confirmation",
payout_type: "bank",
},
},
diff --git a/cypress-tests/cypress/e2e/RoutingUtils/Common.js b/cypress-tests/cypress/e2e/RoutingUtils/Common.js
index eda34969cf..39bb213b60 100644
--- a/cypress-tests/cypress/e2e/RoutingUtils/Common.js
+++ b/cypress-tests/cypress/e2e/RoutingUtils/Common.js
@@ -32,7 +32,9 @@ export const connectorDetails = {
card_pm: {
Confirm: {
Request: {
- card: card_data,
+ payment_method_data: {
+ card: card_data,
+ },
currency: "USD",
customer_acceptance: null,
setup_future_usage: "on_session",
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index de311a4697..5ca8226d22 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -25,6 +25,7 @@
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
// commands.js or your custom support file
+import { defaultErrorHandler, getValueByKey } from "../e2e/PaymentUtils/utils";
import * as RequestBodyUtils from "../utils/RequestBodyUtils";
import { handleRedirection } from "./redirectionHandler";
@@ -36,13 +37,6 @@ function logRequestId(xRequestId) {
}
}
-function defaultErrorHandler(response, response_data) {
- expect(response.body).to.have.property("error");
- for (const key in response_data.body.error) {
- expect(response_data.body.error[key]).to.equal(response.body.error[key]);
- }
-}
-
Cypress.Commands.add(
"merchantCreateCallTest",
(merchantCreateBody, globalState) => {
@@ -100,7 +94,10 @@ Cypress.Commands.add(
JSON.stringify(jsonContent),
globalState.get("connectorId")
);
- createConnectorBody.connector_account_details = authDetails;
+ createConnectorBody.connector_account_details =
+ authDetails.connector_account_details;
+ createConnectorBody.metadata = authDetails?.metadata;
+
cy.request({
method: "POST",
url: `${globalState.get("baseUrl")}/account/${merchantId}/connectors`,
@@ -146,15 +143,6 @@ Cypress.Commands.add(
`${connectorName}_payout`
);
- let sourceBalanceAccount = null;
- if (authDetails && typeof authDetails === "object") {
- // Specific to `AdyenPlatform` payout connector
- // If the connector has source_balance_account in creds file, set it in the body and remove it from authDetails
- sourceBalanceAccount = authDetails.source_balance_account;
- delete authDetails.source_balance_account;
- }
- authDetails = authDetails;
-
// If the connector does not have payout connector creds in creds file, set payoutsExecution to false
if (authDetails === null) {
globalState.set("payoutsExecution", false);
@@ -163,9 +151,10 @@ Cypress.Commands.add(
globalState.set("payoutsExecution", true);
}
- createConnectorBody.connector_account_details = authDetails;
- createConnectorBody.metadata.source_balance_account =
- sourceBalanceAccount;
+ createConnectorBody.connector_account_details =
+ authDetails.connector_account_details;
+ createConnectorBody.metadata = authDetails?.metadata;
+
cy.request({
method: "POST",
url: `${globalState.get("baseUrl")}/account/${merchantId}/connectors`,
@@ -195,16 +184,6 @@ Cypress.Commands.add(
}
);
-function getValueByKey(jsonObject, key) {
- const data =
- typeof jsonObject === "string" ? JSON.parse(jsonObject) : jsonObject;
- if (data && typeof data === "object" && key in data) {
- return data[key];
- } else {
- return null;
- }
-}
-
Cypress.Commands.add(
"createCustomerCallTest",
(customerCreateBody, globalState) => {
@@ -264,10 +243,9 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
expect(response.body).to.have.property("client_secret");
const clientSecret = response.body.client_secret;
globalState.set("clientSecret", clientSecret);
@@ -325,10 +303,8 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
-
- if (response.status === 200) {
+ if (res_data.status === 200) {
expect(response.body).to.have.property("payment_method_id");
expect(response.body).to.have.property("client_secret");
globalState.set("paymentMethodId", response.body.payment_method_id);
@@ -343,11 +319,11 @@ Cypress.Commands.add(
"confirmCallTest",
(confirmBody, req_data, res_data, confirm, globalState) => {
const paymentIntentID = globalState.get("paymentID");
- confirmBody.payment_method_data.card = req_data.card;
confirmBody.confirm = confirm;
confirmBody.client_secret = globalState.get("clientSecret");
- confirmBody.customer_acceptance = req_data.customer_acceptance;
-
+ for (const key in req_data) {
+ confirmBody[key] = req_data[key];
+ }
cy.request({
method: "POST",
url: `${globalState.get("baseUrl")}/payments/${paymentIntentID}/confirm`,
@@ -359,9 +335,8 @@ Cypress.Commands.add(
body: confirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
globalState.set("paymentID", paymentIntentID);
if (response.body.capture_method === "automatic") {
if (response.body.authentication_type === "three_ds") {
@@ -425,63 +400,66 @@ Cypress.Commands.add(
body: confirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
- expect(response.headers["content-type"]).to.include("application/json");
- globalState.set("paymentID", paymentIntentId);
- globalState.set("paymentMethodType", confirmBody.payment_method_type);
-
- switch (response.body.authentication_type) {
- case "three_ds":
- if (
- response.body.capture_method === "automatic" ||
- response.body.capture_method === "manual"
- ) {
- if (response.body.status !== "failed") {
- // we get many statuses here, hence this verification
- if (
- connectorId === "adyen" &&
- response.body.payment_method_type === "blik"
- ) {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("type")
- .to.equal("wait_screen_information");
- } else {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
+ if (res_data.status === 200) {
+ expect(response.headers["content-type"]).to.include("application/json");
+ globalState.set("paymentID", paymentIntentId);
+ globalState.set("paymentMethodType", confirmBody.payment_method_type);
+
+ switch (response.body.authentication_type) {
+ case "three_ds":
+ if (
+ response.body.capture_method === "automatic" ||
+ response.body.capture_method === "manual"
+ ) {
+ if (response.body.status !== "failed") {
+ // we get many statuses here, hence this verification
+ if (
+ connectorId === "adyen" &&
+ response.body.payment_method_type === "blik"
+ ) {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("type")
+ .to.equal("wait_screen_information");
+ } else {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
+ );
+ }
+ } else if (response.body.status === "failed") {
+ expect(response.body.error_code).to.equal(
+ res_data.body.error_code
);
}
- } else if (response.body.status === "failed") {
- expect(response.body.error_code).to.equal(
- res_data.body.error_code
+ } else {
+ defaultErrorHandler(response, res_data);
+ }
+ break;
+ case "no_three_ds":
+ if (
+ response.body.capture_method === "automatic" ||
+ response.body.capture_method === "manual"
+ ) {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
);
+ } else {
+ defaultErrorHandler(response, res_data);
}
- } else {
+ break;
+ default:
defaultErrorHandler(response, res_data);
- }
- break;
- case "no_three_ds":
- if (
- response.body.capture_method === "automatic" ||
- response.body.capture_method === "manual"
- ) {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- } else {
- defaultErrorHandler(response, res_data);
- }
- break;
- default:
- defaultErrorHandler(response, res_data);
+ }
+ } else {
+ defaultErrorHandler(response, res_data);
}
});
}
@@ -509,10 +487,9 @@ Cypress.Commands.add(
body: confirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- globalState.set("paymentID", paymentIntentID);
- if (response.status === 200) {
+ if (res_data.status === 200) {
+ globalState.set("paymentID", paymentIntentID);
if (
response.body.capture_method === "automatic" ||
response.body.capture_method === "manual"
@@ -569,11 +546,8 @@ Cypress.Commands.add(
body: confirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
-
- if (response.status === 200) {
+ if (res_data.status === 200) {
if (
response.body.capture_method === "automatic" ||
response.body.capture_method === "manual"
@@ -615,14 +589,12 @@ Cypress.Commands.add(
capture_method,
globalState
) => {
- createConfirmPaymentBody.payment_method_data.card = req_data.card;
createConfirmPaymentBody.authentication_type = authentication_type;
- createConfirmPaymentBody.currency = req_data.currency;
createConfirmPaymentBody.capture_method = capture_method;
- createConfirmPaymentBody.customer_acceptance = req_data.customer_acceptance;
- createConfirmPaymentBody.setup_future_usage = req_data.setup_future_usage;
createConfirmPaymentBody.customer_id = globalState.get("customerId");
-
+ for (const key in req_data) {
+ createConfirmPaymentBody[key] = req_data[key];
+ }
cy.request({
method: "POST",
url: `${globalState.get("baseUrl")}/payments`,
@@ -634,11 +606,8 @@ Cypress.Commands.add(
body: createConfirmPaymentBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
-
- if (response.status === 200) {
+ if (res_data.status === 200) {
if (response.body.capture_method === "automatic") {
expect(response.body).to.have.property("status");
globalState.set("paymentAmount", createConfirmPaymentBody.amount);
@@ -690,7 +659,7 @@ Cypress.Commands.add(
"saveCardConfirmCallTest",
(saveCardConfirmBody, req_data, res_data, globalState) => {
const paymentIntentID = globalState.get("paymentID");
- saveCardConfirmBody.card_cvc = req_data.card.card_cvc;
+ saveCardConfirmBody.card_cvc = req_data.payment_method_data.card.card_cvc;
saveCardConfirmBody.payment_token = globalState.get("paymentToken");
saveCardConfirmBody.client_secret = globalState.get("clientSecret");
cy.request({
@@ -705,10 +674,9 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- globalState.set("paymentID", paymentIntentID);
- if (response.status === 200) {
+ if (res_data.status === 200) {
+ globalState.set("paymentID", paymentIntentID);
if (response.body.capture_method === "automatic") {
if (response.body.authentication_type === "three_ds") {
expect(response.body)
@@ -755,7 +723,6 @@ Cypress.Commands.add(
(requestBody, req_data, res_data, amount_to_capture, globalState) => {
const payment_id = globalState.get("paymentID");
requestBody.amount_to_capture = amount_to_capture;
- let amount = globalState.get("paymentAmount");
cy.request({
method: "POST",
url: `${globalState.get("baseUrl")}/payments/${payment_id}/capture`,
@@ -768,7 +735,6 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
if (response.body.capture_method !== undefined) {
expect(response.body.payment_id).to.equal(payment_id);
@@ -798,9 +764,8 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
}
@@ -848,10 +813,9 @@ Cypress.Commands.add(
body: requestBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
globalState.set("refundId", response.body.refund_id);
for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
@@ -878,7 +842,7 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
+
expect(response.headers["content-type"]).to.include("application/json");
for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
@@ -919,11 +883,10 @@ Cypress.Commands.add(
body: requestBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- globalState.set("paymentID", response.body.payment_id);
+ if (res_data.status === 200) {
+ globalState.set("paymentID", response.body.payment_id);
- if (response.status === 200) {
globalState.set("paymentID", response.body.payment_id);
if (requestBody.mandate_data === null) {
expect(response.body).to.have.property("payment_method_id");
@@ -1199,7 +1162,6 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState) => {
},
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
expect(response.headers["content-type"]).to.include("application/json");
if (response.body.customer_payment_methods[0]?.payment_token) {
const paymentToken =
@@ -1258,11 +1220,9 @@ Cypress.Commands.add(
body: createConfirmPayoutBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
globalState.set("payoutAmount", createConfirmPayoutBody.amount);
globalState.set("payoutID", response.body.payout_id);
for (const key in res_data.body) {
@@ -1307,11 +1267,9 @@ Cypress.Commands.add(
body: createConfirmPayoutBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
globalState.set("payoutAmount", createConfirmPayoutBody.amount);
globalState.set("payoutID", response.body.payout_id);
for (const key in res_data.body) {
@@ -1343,11 +1301,9 @@ Cypress.Commands.add(
body: payoutFulfillBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
}
@@ -1378,11 +1334,9 @@ Cypress.Commands.add(
body: payoutConfirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
}
@@ -1431,11 +1385,9 @@ Cypress.Commands.add("createJWTToken", (req_data, res_data, globalState) => {
body: jwt_body,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
expect(response.body).to.have.property("token");
//set jwt_token
globalState.set("jwtToken", response.body.token);
@@ -1504,11 +1456,9 @@ Cypress.Commands.add(
body: routingBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
expect(response.body).to.have.property("id");
globalState.set("routingConfigId", response.body.id);
for (const key in res_data.body) {
@@ -1539,11 +1489,9 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
expect(response.body.id).to.equal(routing_config_id);
for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
@@ -1573,11 +1521,9 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
-
- expect(res_data.status).to.equal(response.status);
expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
+ if (res_data.status === 200) {
expect(response.body.id).to.equal(routing_config_id);
for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.js
index 12e86f6448..c493862e40 100644
--- a/cypress-tests/cypress/support/redirectionHandler.js
+++ b/cypress-tests/cypress/support/redirectionHandler.js
@@ -221,7 +221,10 @@ function bankRedirectRedirection(
break;
case "ideal":
cy.contains("button", "Select your bank").click();
- cy.get('[data-testid="ideal-box-bank-item-INGBNL2A"]').click();
+ cy.get('[data-testid="ideal-box-bank-item-INGBNL2A-content"]')
+ .should("be.visible")
+ .click();
+
break;
case "giropay":
cy.get("._transactionId__header__iXVd_").should(
diff --git a/cypress-tests/package-lock.json b/cypress-tests/package-lock.json
index 41c069fea0..2a1fdbe977 100644
--- a/cypress-tests/package-lock.json
+++ b/cypress-tests/package-lock.json
@@ -584,9 +584,9 @@
}
},
"node_modules/cypress": {
- "version": "13.10.0",
- "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.10.0.tgz",
- "integrity": "sha512-tOhwRlurVOQbMduX+KonoMeQILs2cwR3yHGGENoFvvSoLUBHmJ8b9/n21gFSDqjlOJ+SRVcwuh+fG/JDsHsT6Q==",
+ "version": "13.12.0",
+ "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.12.0.tgz",
+ "integrity": "sha512-udzS2JilmI9ApO/UuqurEwOvThclin5ntz7K0BtnHBs+tg2Bl9QShLISXpSEMDv/u8b6mqdoAdyKeZiSqKWL8g==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",