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

feat(cypress): Add service level testing for Payouts (#4744)

Sakil Mostak1d36798399c1
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00001-CustomerCreate.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00001-CustomerCreate.cy.js
deleted file mode 100644
index 5e8bcb5aa1..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00001-CustomerCreate.cy.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import customerCreateBody from "../../fixtures/create-customer-body.json";
-import State from "../../utils/State";
-
-let globalState;
-
-describe("Customer Create flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
- after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
- it("customer-create-call-test", () => {
-
- cy.createCustomerCallTest(customerCreateBody, globalState);
-
- });
-});
\ No newline at end of file
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00005-NoThreeDSManualCapture.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00005-NoThreeDSManualCapture.cy.js
deleted file mode 100644
index 4ee4483c96..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00005-NoThreeDSManualCapture.cy.js
+++ /dev/null
@@ -1,206 +0,0 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import confirmBody from "../../fixtures/confirm-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-
-let globalState;
-
-describe("Card - NoThreeDS Manual payment flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
-
- after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- context("Card - NoThreeDS Manual Full Capture payment flow test", () => {
-
- context("payment Create and Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- });
-
- context("Payment Create+Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create+confirm-payment-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.createConfirmPaymentTest(createConfirmPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
- });
-
-
- });
-
- context("Card - NoThreeDS Manual Partial Capture payment flow test - Create and Confirm", () => {
-
- context("payment Create and Payment Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
- });
-
- context("payment + Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create+confirm-payment-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.createConfirmPaymentTest(createConfirmPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- });
-
-
- });
-});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00006-VoidPayment.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00006-VoidPayment.cy.js
deleted file mode 100644
index ef81577756..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00006-VoidPayment.cy.js
+++ /dev/null
@@ -1,130 +0,0 @@
-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 "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-
-let globalState;
-
-describe("Card - NoThreeDS Manual payment flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
-
- after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- context("Card - void payment in Requires_capture state flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("void-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Void"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.voidCallTest(voidBody, req_data, res_data, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
-
- context("Card - void payment in Requires_payment_method state flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("void-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Void"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.voidCallTest(voidBody, req_data, res_data, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data); });
- });
-
- context("Card - void payment in Requires_payment_method state flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, false, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("void-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Void"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.voidCallTest(voidBody, req_data, res_data, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data); });
- });
-});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00008-RefundPayment.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00008-RefundPayment.cy.js
deleted file mode 100644
index 672c5cf8f4..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00008-RefundPayment.cy.js
+++ /dev/null
@@ -1,990 +0,0 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import confirmBody from "../../fixtures/confirm-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import refundBody from "../../fixtures/refund-flow-body.json";
-import listRefundCall from "../../fixtures/list-refund-call-body.json";
-import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-
-let globalState;
-
-describe("Card - Refund flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
-
- })
-
- afterEach("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- context("Card - Full Refund flow test for No-3DS", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
-
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
-
- context("Card - Partial Refund flow test for No-3DS", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
-
- context("Fully Refund Card-NoThreeDS payment flow test Create+Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create+confirm-payment-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest( createConfirmPaymentBody, req_data, res_data,"no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- });
-
- context("Partially Refund Card-NoThreeDS payment flow test Create+Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create+confirm-payment-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest( createConfirmPaymentBody, req_data, res_data,"no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
- 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 fully captured No-3DS payment", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
- 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 No-3DS payment", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
- 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);
- });
- it("list-refund-call-test", () => {
- cy.listRefundCallTest(listRefundCall, globalState);
- });
- });
-
- context("Card - Full Refund for partially captured No-3DS payment", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
- 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 No-3DS payment", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
- 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 Create + Confirm Automatic CIT and MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["MandateMultiUseNo3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + req_data.card);
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 7000, true, "automatic", "new_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 7000, globalState);
- 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 flow test for 3DS", () => {
-
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
-
- })
-
- afterEach("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm 3DS", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
-
- context("Card - Partial Refund flow test for 3DS", () => {
-
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm 3DS", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
-
- context("Fully Refund Card-ThreeDS payment flow test Create+Confirm", () => {
-
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create+confirm-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest(createConfirmPaymentBody, req_data, res_data, "three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- });
-
- context("Partially Refund Card-ThreeDS payment flow test Create+Confirm", () => {
-
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create+confirm-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest(createConfirmPaymentBody, req_data, res_data, "three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialRefund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
- 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 fully captured 3DS payment", () => {
-
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm 3DS", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
-
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- });
-
- context("Card - Partial Refund for fully captured 3DS payment", () => {
-
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm 3DS", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
-
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 5000, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 1500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
-
- });
-
- context("Card - Full Refund for partially captured 3DS payment", () => {
-
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm 3DS", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
-
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
-
- });
-
- context("Card - partial Refund for partially captured 3DS payment", () => {
-
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("Confirm 3DS", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
-
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 50 , globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00009-SyncRefund.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00009-SyncRefund.cy.js
deleted file mode 100644
index f0cdc9a689..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00009-SyncRefund.cy.js
+++ /dev/null
@@ -1,72 +0,0 @@
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import refundBody from "../../fixtures/refund-flow-body.json";
-import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-
-let globalState;
-
-describe("Card - Sync Refund flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
-
- after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("refund-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Refund"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
- 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/ConnectorTest/00010-CreateSingleuseMandate.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00010-CreateSingleuseMandate.cy.js
deleted file mode 100644
index ec85017f55..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00010-CreateSingleuseMandate.cy.js
+++ /dev/null
@@ -1,129 +0,0 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
-import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-
-let globalState;
-
-describe("Card - SingleUse Mandates flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
-
- after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- context("Card - NoThreeDS Create + Confirm Automatic CIT and MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["MandateSingleUseNo3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 7000, true, "automatic", "new_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
- });
-
- context("Card - NoThreeDS Create + Confirm Manual CIT and MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["MandateSingleUseNo3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 6500, true, "manual", "new_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("cit-capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 6500, true, "manual", globalState);
- });
-
- it("mit-capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("list-mandate-call-test", () => {
- cy.listMandateCallTest(globalState);
- });
- });
-
- context("Card - ThreeDS Create + Confirm Manual CIT and MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Create No 3DS CIT", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["MandateSingleUseNo3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 6500, true, "manual", "new_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("cit-capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
-
- it("list-mandate-call-test", () => {
- cy.listMandateCallTest(globalState);
- });
- });
-});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00011-CreateMultiuseMandate.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00011-CreateMultiuseMandate.cy.js
deleted file mode 100644
index 3e14d69db8..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00011-CreateMultiuseMandate.cy.js
+++ /dev/null
@@ -1,138 +0,0 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
-import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-
-let globalState;
-
-describe("Card - MultiUse Mandates flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
-
- after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
-
- context("Card - NoThreeDS Create + Confirm Automatic CIT and MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["MandateMultiUseNo3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 7000, true, "automatic", "new_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
- });
-
- context("Card - NoThreeDS Create + Confirm Manual CIT and MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["MandateMultiUseNo3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 6500, true, "manual", "new_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("cit-capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT 1", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 6500, true, "manual", globalState);
- });
-
- it("mit-capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT 2", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 6500, true, "manual", globalState);
- });
-
- it("mit-capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
-
- context("Card - ThreeDS Create + Confirm Manual CIT and MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["MandateMultiUseNo3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 6500, true, "manual", "new_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("cit-capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 6500, true, "automatic", globalState);
- });
- });
-});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00012-ListAndRevokeMandate.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00012-ListAndRevokeMandate.cy.js
deleted file mode 100644
index 1f9782f227..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00012-ListAndRevokeMandate.cy.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-
-import State from "../../utils/State";
-
-let globalState;
-
-describe("Card - SingleUse Mandates flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
-
- after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- context("Card - NoThreeDS Create + Confirm Automatic CIT and MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["MandateSingleUseNo3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- console.log("det -> " + data.card);
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 7000, true, "automatic", "new_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
-
- it("list-mandate-call-test", () => {
- cy.listMandateCallTest(globalState);
- });
-
- it("revoke-mandate-call-test", () => {
- cy.revokeMandateCallTest(globalState);
- });
-
- it("revoke-revoked-mandate-call-test", () => {
- cy.revokeMandateCallTest(globalState);
- });
- });
-
-});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00013-SaveCardFlow.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00013-SaveCardFlow.cy.js
deleted file mode 100644
index 828fb5101a..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00013-SaveCardFlow.cy.js
+++ /dev/null
@@ -1,187 +0,0 @@
-import captureBody from "../../fixtures/capture-flow-body.json";
-import confirmBody from "../../fixtures/confirm-body.json";
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import customerCreateBody from "../../fixtures/create-customer-body.json";
-import SaveCardConfirmBody from "../../fixtures/save-card-confirm-body.json";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-import State from "../../utils/State";
-let globalState;
-
-describe("Card - SaveCard payment flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
-
-
- context("Save card for NoThreeDS automatic capture payment- Create+Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
- });
-
- it("create+confirm-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["SaveCardUseNo3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest( createConfirmPaymentBody, req_data, res_data,"no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("retrieve-customerPM-call-test", () => {
- cy.listCustomerPMCallTest(globalState);
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it ("confirm-save-card-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["SaveCardUseNo3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.saveCardConfirmCallTest(SaveCardConfirmBody, req_data, res_data, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- });
-
- context("Save card for NoThreeDS manual full capture payment- Create+Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
- });
-
- it("create+confirm-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["SaveCardUseNo3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest( createConfirmPaymentBody, req_data, res_data,"no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("retrieve-customerPM-call-test", () => {
- cy.listCustomerPMCallTest(globalState);
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest( createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
-
- it ("confirm-save-card-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["SaveCardUseNo3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.saveCardConfirmCallTest(SaveCardConfirmBody, req_data, res_data, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
-
- context("Save card for NoThreeDS manual partial capture payment- Create + Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("customer-create-call-test", () => {
- cy.createCustomerCallTest(customerCreateBody, globalState);
- });
-
- it("create+confirm-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["SaveCardUseNo3DSAutoCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest( createConfirmPaymentBody, req_data, res_data,"no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("retrieve-customerPM-call-test", () => {
- cy.listCustomerPMCallTest(globalState);
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest( createPaymentBody, req_data, res_data, "no_three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
-
- it ("confirm-save-card-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["SaveCardUseNo3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.saveCardConfirmCallTest(SaveCardConfirmBody,req_data, res_data,globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
- });
-
-
-});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00014-ZeroAuthMandate.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00014-ZeroAuthMandate.cy.js
deleted file mode 100644
index 7a0eba4b6a..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00014-ZeroAuthMandate.cy.js
+++ /dev/null
@@ -1,68 +0,0 @@
-import citConfirmBody from "../../fixtures/create-mandate-cit.json";
-import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
-import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
-
-let globalState;
-
-describe("Card - SingleUse Mandates flow test", () => {
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
- })
-
- after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- context("Card - NoThreeDS Create + Confirm Automatic CIT and Single use MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["ZeroAuthMandate"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 0, true, "automatic", "setup_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
- });
- context("Card - NoThreeDS Create + Confirm Automatic CIT and Multi use MIT payment flow test", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["ZeroAuthMandate"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.citForMandatesCallTest(citConfirmBody, req_data, res_data, 0, true, "automatic", "setup_mandate", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
- it("Confirm No 3DS MIT", () => {
- cy.mitForMandatesCallTest(mitConfirmBody, 7000, true, "automatic", globalState);
- });
- });
-
-});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00015-ThreeDSManualCapture.cy.js b/cypress-tests/cypress/e2e/ConnectorTest/00015-ThreeDSManualCapture.cy.js
deleted file mode 100644
index 50d136b596..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorTest/00015-ThreeDSManualCapture.cy.js
+++ /dev/null
@@ -1,216 +0,0 @@
-import createPaymentBody from "../../fixtures/create-payment-body.json";
-import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
-import confirmBody from "../../fixtures/confirm-body.json";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import State from "../../utils/State";
-import captureBody from "../../fixtures/capture-flow-body.json";
-import * as utils from "../ConnectorUtils/utils";
-
-let globalState;
-
-describe("Card - ThreeDS Manual payment flow test", () => {
-
-
- before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
- globalState = new State(state);
- })
-
- })
-
- afterEach("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
- context("Card - ThreeDS Manual Full Capture payment flow test", () => {
- context("payment Create and Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- });
-
- context("Payment Create+Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create+confirm-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest(createConfirmPaymentBody, req_data, res_data, "three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = createConfirmPaymentBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["Capture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
- });
-
-
- });
-
- context("Card - ThreeDS Manual Partial Capture payment flow test - Create and Confirm", () => {
- context("payment Create and Payment Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("payment_methods-call-test", () => {
- cy.paymentMethodsCallTest(globalState);
- });
-
- it("confirm-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = confirmBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
- });
-
- context("payment + Confirm", () => {
- let should_continue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
- });
-
- it("create+confirm-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSManualCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.createConfirmPaymentTest(createConfirmPaymentBody, req_data, res_data, "three_ds", "manual", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("Handle redirection", () => {
- let expected_redirection = createConfirmPaymentBody["return_url"];
- cy.handleRedirection(globalState, expected_redirection);
- })
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- it("capture-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PartialCapture"];
- let req_data = data["Request"];
- let res_data = data["Response"];
- cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
- });
-
- it("retrieve-payment-call-test", () => {
- cy.retrievePaymentCallTest(globalState);
- });
-
- });
-
-
- });
-});
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/BankOfAmerica.js b/cypress-tests/cypress/e2e/ConnectorUtils/BankOfAmerica.js
deleted file mode 100644
index 5b3df0efc5..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorUtils/BankOfAmerica.js
+++ /dev/null
@@ -1,381 +0,0 @@
-const successfulNo3DSCardDetails = {
- "card_number": "4242424242424242",
- "card_exp_month": "01",
- "card_exp_year": "25",
- "card_holder_name": "joseph Doe",
- "card_cvc": "123"
-
-};
-
-const successfulThreeDSTestCardDetails = {
- "card_number": "4000000000001091",
- "card_exp_month": "01",
- "card_exp_year": "25",
- "card_holder_name": "joseph Doe",
- "card_cvc": "123"
-};
-export const connectorDetails = {
- card_pm:{
- "PaymentIntent": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_payment_method"
- }
- }
- },
- "3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "No3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "No3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "Capture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body":{
- "status": "succeeded",
- "amount": 6500,
- "amount_capturable": 0,
- "amount_received": 6500,
-
- }
- }
- },
- "PartialCapture": {
- "Request": {
-
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "partially_captured",
- "amount": 6500,
- "amount_capturable": 0,
- "amount_received": 100,
- }
-
- }
- },
- "Void":{
- "Request": {
- },
- "Response": {
- "status": 200,
- "body":{
- status: "cancelled"
-
- }
- }
- },
- "Refund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "pending",
- }
-
- }
- },
- "PartialRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "pending",
- }
-
- }
- },
- "SyncRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "pending",
- }
-
- }
- },
- "MandateSingleUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
-
- },
- "MandateSingleUse3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_customer_action"
- }
- }
-
- },
- "MandateSingleUseNo3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "MandateSingleUseNo3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUseNo3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "MandateMultiUseNo3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUse3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "ZeroAuthMandate": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "SaveCardUseNo3DSAutoCapture": {
- "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": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "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": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- }
- };
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/Bluesnap.js b/cypress-tests/cypress/e2e/ConnectorUtils/Bluesnap.js
deleted file mode 100644
index 17e040668a..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorUtils/Bluesnap.js
+++ /dev/null
@@ -1,425 +0,0 @@
-const successfulNo3DSCardDetails = {
- "card_number": "4242424242424242",
- "card_exp_month": "10",
- "card_exp_year": "30",
- "card_holder_name": "John",
- "card_cvc": "737"
-};
-
-const successfulThreeDSTestCardDetails = {
- "card_number": "4000000000001091",
- "card_exp_month": "10",
- "card_exp_year": "30",
- "card_holder_name": "Joseph",
- "card_cvc": "737"
-};
-
-export const connectorDetails = {
- card_pm:{
- "PaymentIntent": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_payment_method"
- }
- }
- },
- "3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "No3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "No3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "Capture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body":{
- "status": "succeeded",
- "amount": 6500,
- "amount_capturable": 0,
- "amount_received": 6500,
-
- }
- }
- },
- "PartialCapture": {
- "Request": {
-
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "partially_captured",
- "amount": 6500,
- "amount_capturable": 0,
- "amount_received": 100,
- }
-
- }
- },
- "Void":{
- "Request": {
- },
- "Response": {
- "status": 200,
- "body":{
- status: "cancelled"
-
- }
- }
- },
- "Refund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded",
- }
-
- }
- },
- "PartialRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded",
- }
-
- }
- },
- "SyncRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded",
- }
-
- }
- },
- "MandateSingleUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "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"
- }
- }
- }
- },
- "ZeroAuthMandate": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 501,
- "body": {
- "error": {
- "type": "invalid_request",
- "message": "Setup Mandate flow for Bluesnap is not implemented",
- "code": "IR_00",
- }
- }
- }
- },
- "SaveCardUseNo3DSAutoCapture": {
- "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": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "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": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- }
- };
\ No newline at end of file
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/Cybersource.js b/cypress-tests/cypress/e2e/ConnectorUtils/Cybersource.js
deleted file mode 100644
index 67d2875df5..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorUtils/Cybersource.js
+++ /dev/null
@@ -1,381 +0,0 @@
-const successfulNo3DSCardDetails = {
- "card_number": "4242424242424242",
- "card_exp_month": "01",
- "card_exp_year": "25",
- "card_holder_name": "joseph Doe",
- "card_cvc": "123"
-};
-
-const successfulThreeDSTestCardDetails = {
- "card_number": "4000000000001091",
- "card_exp_month": "01",
- "card_exp_year": "25",
- "card_holder_name": "joseph Doe",
- "card_cvc": "123"
-};
-
-export const connectorDetails = {
- card_pm:{
- "PaymentIntent": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_payment_method"
- }
- }
- },
- "3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "No3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "No3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "Capture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body":{
- "status": "succeeded",
- "amount": 6500,
- "amount_capturable": 0,
- "amount_received": 6500,
-
- }
- }
- },
- "PartialCapture": {
- "Request": {
-
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "partially_captured",
- "amount": 6500,
- "amount_capturable": 0,
- "amount_received": 100,
- }
-
- }
- },
- "Void":{
- "Request": {
- },
- "Response": {
- "status": 200,
- "body":{
- status: "cancelled"
-
- }
- }
- },
- "Refund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "pending",
- }
-
- }
- },
- "PartialRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "pending",
- }
-
- }
- },
- "SyncRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "pending",
- }
-
- }
- },
- "MandateSingleUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
-
- },
- "MandateSingleUse3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_customer_action"
- }
- }
-
- },
- "MandateSingleUseNo3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "MandateSingleUseNo3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUseNo3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "MandateMultiUseNo3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUse3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "ZeroAuthMandate": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "SaveCardUseNo3DSAutoCapture": {
- "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": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "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": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- }
- };
\ No newline at end of file
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/Nmi.js b/cypress-tests/cypress/e2e/ConnectorUtils/Nmi.js
deleted file mode 100644
index 27caaa82dc..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorUtils/Nmi.js
+++ /dev/null
@@ -1,427 +0,0 @@
-const successfulNo3DSCardDetails = {
- "card_number": "4000000000002503",
- "card_exp_month": "08",
- "card_exp_year": "25",
- "card_holder_name": "joseph Doe",
- "card_cvc": "999"
-};
-
-const successfulThreeDSTestCardDetails = {
- "card_number": "4000000000002503",
- "card_exp_month": "10",
- "card_exp_year": "25",
- "card_holder_name": "morino",
- "card_cvc": "999"
-};
-
-export const connectorDetails = {
- card_pm:{
- "PaymentIntent": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_payment_method"
- }
- }
- },
- "3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- "3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- "No3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- "No3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- "Capture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body":{
- "status": "processing",
- "amount": 6500,
- "amount_capturable": 6500,
-
- }
- }
- },
- "PartialCapture": {
- "Request": {
-
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "processing",
- "amount": 6500,
- "amount_capturable": 6500,
- }
-
- }
- },
- "Void":{
- "Request": {
- },
- "Response": {
- "status": 400,
- "body":{
- "error":{
- "code":"IR_16",
- "message":"You cannot cancel this payment because it has status processing",
- "type":"invalid_request",
- }
-
- }
- }
- },
- "Refund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "pending",
- }
-
- }
- },
- "PartialRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "pending",
- }
-
- }
- },
- "SyncRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded",
- }
-
- }
- },
- "MandateSingleUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "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"
- }
- }
- }
- },
- "ZeroAuthMandate": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 501,
- "body": {
- "error": {
- "type": "invalid_request",
- "message": "Setup Mandate flow for Nmi is not implemented",
- "code": "IR_00",
- }
- }
- }
- },
- "SaveCardUseNo3DSAutoCapture": {
- "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": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- "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": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- }
- };
\ No newline at end of file
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/Paypal.js b/cypress-tests/cypress/e2e/ConnectorUtils/Paypal.js
deleted file mode 100644
index 056b4b5e8a..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorUtils/Paypal.js
+++ /dev/null
@@ -1,440 +0,0 @@
-const successfulNo3DSCardDetails = {
- "card_number": "4012000033330026",
- "card_exp_month": "01",
- "card_exp_year": "25",
- "card_holder_name": "joseph Doe",
- "card_cvc": "123"
-
-};
-
-const successfulThreeDSTestCardDetails = {
- "card_number": "4868719460707704",
- "card_exp_month": "01",
- "card_exp_year": "25",
- "card_holder_name": "joseph Doe",
- "card_cvc": "123"
-};
-
-export const connectorDetails = {
- card_pm:{
- "PaymentIntent": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_payment_method"
- }
- }
- },
- "3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- "No3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "No3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- "Capture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body":{
- "status": "processing",
- "amount": 6500,
- "amount_capturable": 6500,
- "amount_received": 0,
-
- }
- }
- },
- "PartialCapture": {
- "Request": {
-
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "processing",
- "amount": 6500,
- "amount_capturable": 6500,
- "amount_received": 0,
- }
-
- }
- },
- "Void":{
- "Request": {
- },
- "Response": {
- "status": 200,
- "body":{
- status: "cancelled"
-
- }
- }
- },
- "Refund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 400,
- "body": {
- "error": {
- "type": "invalid_request",
- "message": "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured",
- "code" : "IR_14"
- },
- }
-
- }
- },
- "PartialRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 400,
- "body": {
- "error": {
- "type": "invalid_request",
- "message": "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured",
- "code" : "IR_14"
- },
- }
-
- }
- },
- "SyncRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 400,
- "body": {
- "error": {
- "type": "invalid_request",
- "message": "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured",
- "code" : "IR_14"
- },
- }
-
- }
- },
- "MandateSingleUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "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": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "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": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 501,
- "body": {
- "error": {
- "type": "invalid_request",
- "message": "Setup Mandate flow for Paypal is not implemented",
- "code": "IR_00",
- }
- }
- }
- },
- "SaveCardUseNo3DSAutoCapture": {
- "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": 200,
- "body": {
- "status": "processing"
- }
- }
- },
- "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": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- }
- };
-
-
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/Stripe.js b/cypress-tests/cypress/e2e/ConnectorUtils/Stripe.js
deleted file mode 100644
index 1003946dd7..0000000000
--- a/cypress-tests/cypress/e2e/ConnectorUtils/Stripe.js
+++ /dev/null
@@ -1,384 +0,0 @@
-const successfulTestCard = "4242424242424242";
-const successful3DSCard = "4000002760003184";
-
-const successfulNo3DSCardDetails = {
- "card_number": "4242424242424242",
- "card_exp_month": "10",
- "card_exp_year": "25",
- "card_holder_name": "morino",
- "card_cvc": "737"
-};
-
-const successfulThreeDSTestCardDetails = {
- "card_number": "4000002760003184",
- "card_exp_month": "10",
- "card_exp_year": "25",
- "card_holder_name": "morino",
- "card_cvc": "737"
-};
-
-export const connectorDetails = {
-card_pm:{
- "PaymentIntent": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_payment_method"
- }
- }
- },
- "3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "No3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "No3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- "setup_future_usage": "on_session"
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "Capture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body":{
- "status": "succeeded",
- "amount": 6500,
- "amount_capturable": 0,
- "amount_received": 6500,
-
- }
- }
- },
- "PartialCapture": {
- "Request": {
-
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "partially_captured",
- "amount": 6500,
- "amount_capturable": 0,
- "amount_received": 100,
- }
-
- }
- },
- "Void":{
- "Request": {
- },
- "Response": {
- "status": 200,
- "body":{
- status: "cancelled"
-
- }
- }
- },
- "Refund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded",
- }
-
- }
- },
- "PartialRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded",
- }
-
- }
- },
- "SyncRefund": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "customer_acceptance": null,
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded",
- }
-
- }
- },
- "MandateSingleUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
-
- },
- "MandateSingleUse3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_customer_action"
- }
- }
-
- },
- "MandateSingleUseNo3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "MandateSingleUseNo3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUseNo3DSAutoCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "MandateMultiUseNo3DSManualCapture": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUse3DSAutoCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "MandateMultiUse3DSManualCapture": {
- "Request": {
- "card": successfulThreeDSTestCardDetails,
- "currency": "USD",
- "mandate_type": {
- "multi_use": {
- "amount": 8000,
- "currency": "USD"
- }
- },
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
- "ZeroAuthMandate": {
- "Request": {
- "card": successfulNo3DSCardDetails,
- "currency": "USD",
- "mandate_type": {
- "single_use": {
- "amount": 8000,
- "currency": "USD"
- }
- }
- },
- "Response": {
- "status": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "SaveCardUseNo3DSAutoCapture": {
- "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": 200,
- "body": {
- "status": "succeeded"
- }
- }
- },
- "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": 200,
- "body": {
- "status": "requires_capture"
- }
- }
- },
-}
-};
\ No newline at end of file
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00000-AccountCreate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00000-AccountCreate.cy.js
new file mode 100644
index 0000000000..f58eb194db
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00000-AccountCreate.cy.js
@@ -0,0 +1,24 @@
+import apiKeyCreateBody from "../../fixtures/create-api-key-body.json";
+import merchantCreateBody from "../../fixtures/merchant-create-body.json";
+import State from "../../utils/State";
+
+let globalState;
+describe("Account Create flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ console.log("seeding globalState -> " + JSON.stringify(globalState));
+ });
+ });
+ after("flush global state", () => {
+ console.log("flushing globalState -> " + JSON.stringify(globalState));
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ it("merchant-create-call-test", () => {
+ cy.merchantCreateCallTest(merchantCreateBody, globalState);
+ });
+ it("api-key-create-call-test", () => {
+ cy.apiKeyCreateTest(apiKeyCreateBody, globalState);
+ });
+});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00001-CustomerCreate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00001-CustomerCreate.cy.js
new file mode 100644
index 0000000000..996ec85ee3
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00001-CustomerCreate.cy.js
@@ -0,0 +1,20 @@
+import customerCreateBody from "../../fixtures/create-customer-body.json";
+import State from "../../utils/State";
+
+let globalState;
+
+describe("Customer Create flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ console.log("seeding globalState -> " + JSON.stringify(globalState));
+ });
+ });
+ after("flush global state", () => {
+ console.log("flushing globalState -> " + JSON.stringify(globalState));
+ cy.task("setGlobalState", globalState.data);
+ });
+ it("customer-create-call-test", () => {
+ cy.createCustomerCallTest(customerCreateBody, globalState);
+ });
+});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00002-ConnectorCreate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js
similarity index 78%
rename from cypress-tests/cypress/e2e/ConnectorTest/00002-ConnectorCreate.cy.js
rename to cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js
index 927f0d0201..85a908da1a 100644
--- a/cypress-tests/cypress/e2e/ConnectorTest/00002-ConnectorCreate.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js
@@ -3,17 +3,15 @@ import State from "../../utils/State";
let globalState;
describe("Connector Account Create flow test", () => {
-
before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
+ cy.task("getGlobalState").then((state) => {
globalState = new State(state);
- })
- })
+ });
+ });
after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
+ cy.task("setGlobalState", globalState.data);
+ });
it("connector-create-call-test", () => {
cy.createConnectorCallTest(createConnectorBody, globalState);
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00003-NoThreeDSAutoCapture.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00003-NoThreeDSAutoCapture.cy.js
similarity index 60%
rename from cypress-tests/cypress/e2e/ConnectorTest/00003-NoThreeDSAutoCapture.cy.js
rename to cypress-tests/cypress/e2e/PaymentTest/00003-NoThreeDSAutoCapture.cy.js
index ec36fa1602..2dfedbb83d 100644
--- a/cypress-tests/cypress/e2e/ConnectorTest/00003-NoThreeDSAutoCapture.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00003-NoThreeDSAutoCapture.cy.js
@@ -2,39 +2,47 @@ import confirmBody from "../../fixtures/confirm-body.json";
import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
let globalState;
describe("Card - NoThreeDS payment flow test", () => {
-
before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
+ cy.task("getGlobalState").then((state) => {
globalState = new State(state);
- })
- })
+ });
+ });
after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
+ cy.task("setGlobalState", globalState.data);
+ });
context("Card-NoThreeDS payment flow test Create and confirm", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
});
it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
});
it("payment_methods-call-test", () => {
@@ -42,35 +50,47 @@ describe("Card - NoThreeDS payment flow test", () => {
});
it("Confirm No 3DS", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSAutoCapture"
+ ];
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
});
it("retrieve-payment-call-test", () => {
cy.retrievePaymentCallTest(globalState);
});
-
});
context("Card-NoThreeDS payment flow test Create+Confirm", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
});
it("create+confirm-payment-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSAutoCapture"
+ ];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.createConfirmPaymentTest(createConfirmPaymentBody, req_data, res_data, "no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
});
it("retrieve-payment-call-test", () => {
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00004-ThreeDSAutoCapture.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00004-ThreeDSAutoCapture.cy.js
similarity index 61%
rename from cypress-tests/cypress/e2e/ConnectorTest/00004-ThreeDSAutoCapture.cy.js
rename to cypress-tests/cypress/e2e/PaymentTest/00004-ThreeDSAutoCapture.cy.js
index 3178170021..7ae900c833 100644
--- a/cypress-tests/cypress/e2e/ConnectorTest/00004-ThreeDSAutoCapture.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00004-ThreeDSAutoCapture.cy.js
@@ -1,39 +1,46 @@
import confirmBody from "../../fixtures/confirm-body.json";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
let globalState;
describe("Card - ThreeDS payment flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
});
before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
+ cy.task("getGlobalState").then((state) => {
globalState = new State(state);
- })
-
- })
+ });
+ });
afterEach("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
-
+ cy.task("setGlobalState", globalState.data);
+ });
it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
});
it("payment_methods-call-test", () => {
@@ -41,16 +48,18 @@ describe("Card - ThreeDS payment flow test", () => {
});
it("Confirm 3DS", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["3DSAutoCapture"];
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSAutoCapture"
+ ];
let req_data = data["Request"];
let res_data = data["Response"];
cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
});
it("Handle redirection", () => {
let expected_redirection = confirmBody["return_url"];
cy.handleRedirection(globalState, expected_redirection);
- })
-
+ });
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00005-NoThreeDSManualCapture.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00005-NoThreeDSManualCapture.cy.js
new file mode 100644
index 0000000000..8fa262fd06
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00005-NoThreeDSManualCapture.cy.js
@@ -0,0 +1,263 @@
+import captureBody from "../../fixtures/capture-flow-body.json";
+import confirmBody from "../../fixtures/confirm-body.json";
+import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
+import createPaymentBody from "../../fixtures/create-payment-body.json";
+import State from "../../utils/State";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
+
+let globalState;
+
+describe("Card - NoThreeDS Manual payment flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context("Card - NoThreeDS Manual Full Capture payment flow test", () => {
+ context("payment Create and Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+ });
+
+ context("Payment Create+Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+ });
+ });
+
+ context(
+ "Card - NoThreeDS Manual Partial Capture payment flow test - Create and Confirm",
+ () => {
+ context("payment Create and Payment Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(
+ confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PartialCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+ });
+
+ context("payment + Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PartialCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+ });
+ },
+ );
+});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js
new file mode 100644
index 0000000000..dea9d9e540
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00006-VoidPayment.cy.js
@@ -0,0 +1,181 @@
+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";
+
+let globalState;
+
+describe("Card - NoThreeDS Manual payment flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context("Card - void payment in Requires_capture state flow test", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("void-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Void"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.voidCallTest(voidBody, req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ });
+
+ context(
+ "Card - void payment in Requires_payment_method state flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("void-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Void"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.voidCallTest(voidBody, req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ },
+ );
+
+ context(
+ "Card - void payment in Requires_payment_method state flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, false, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("void-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Void"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.voidCallTest(voidBody, req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ },
+ );
+});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00007-SyncPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00007-SyncPayment.cy.js
similarity index 62%
rename from cypress-tests/cypress/e2e/ConnectorTest/00007-SyncPayment.cy.js
rename to cypress-tests/cypress/e2e/PaymentTest/00007-SyncPayment.cy.js
index 1920cdd09d..06e8b490ed 100644
--- a/cypress-tests/cypress/e2e/ConnectorTest/00007-SyncPayment.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00007-SyncPayment.cy.js
@@ -1,36 +1,45 @@
import confirmBody from "../../fixtures/confirm-body.json";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
-import getConnectorDetails from "../ConnectorUtils/utils";
-import * as utils from "../ConnectorUtils/utils";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
let globalState;
describe("Card - Sync payment flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails
- beforeEach(function () {
- if(!should_continue) {
- this.skip();
- }
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
});
before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
+ cy.task("getGlobalState").then((state) => {
globalState = new State(state);
- })
- })
+ });
+ });
after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
+ cy.task("setGlobalState", globalState.data);
+ });
it("create-payment-call-test", () => {
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["PaymentIntent"];
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
let req_data = data["Request"];
let res_data = data["Response"];
- cy.createPaymentIntentTest(createPaymentBody, req_data, res_data, "no_three_ds", "automatic", globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
});
it("payment_methods-call-test", () => {
@@ -39,16 +48,18 @@ describe("Card - Sync payment flow test", () => {
it("confirm-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
- let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"]["No3DSAutoCapture"];
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSAutoCapture"
+ ];
let req_data = data["Request"];
let res_data = data["Response"];
console.log("det -> " + data.card);
cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
- if(should_continue) should_continue = utils.should_continue_further(res_data);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
});
it("retrieve-payment-call-test", () => {
cy.retrievePaymentCallTest(globalState);
});
-
});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js
new file mode 100644
index 0000000000..f2d921d80f
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00008-RefundPayment.cy.js
@@ -0,0 +1,1304 @@
+import captureBody from "../../fixtures/capture-flow-body.json";
+import confirmBody from "../../fixtures/confirm-body.json";
+import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
+import citConfirmBody from "../../fixtures/create-mandate-cit.json";
+import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
+import createPaymentBody from "../../fixtures/create-payment-body.json";
+import refundBody from "../../fixtures/refund-flow-body.json";
+import listRefundCall from "../../fixtures/list-refund-call-body.json";
+import State from "../../utils/State";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
+
+let globalState;
+
+describe("Card - Refund flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context("Card - Full Refund flow test for No-3DS", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSAutoCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ });
+
+ context("Card - Partial Refund flow test for No-3DS", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSAutoCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ });
+
+ context(
+ "Fully Refund Card-NoThreeDS payment flow test Create+Confirm",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Refund"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ },
+ );
+
+ context(
+ "Partially Refund Card-NoThreeDS payment flow test Create+Confirm",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["No3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PartialRefund"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PartialRefund"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ 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 fully captured No-3DS payment", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Capture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ 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 No-3DS payment", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Capture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ 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);
+ });
+ it("list-refund-call-test", () => {
+ cy.listRefundCallTest(listRefundCall, globalState);
+ });
+ });
+
+ context("Card - Full Refund for partially captured No-3DS payment", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
+ 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 No-3DS payment", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
+ 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 Create + Confirm Automatic CIT and MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateMultiUseNo3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + req_data.card);
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 7000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Refund"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 7000, globalState);
+ 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 flow test for 3DS", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm 3DS", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSAutoCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+});
+
+context("Card - Partial Refund flow test for 3DS", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm 3DS", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSAutoCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 1200, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+});
+
+context("Fully Refund Card-ThreeDS payment flow test Create+Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSAutoCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+});
+
+context(
+ "Partially Refund Card-ThreeDS payment flow test Create+Confirm",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSAutoCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialRefund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 3000, globalState);
+ 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 fully captured 3DS payment", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm 3DS", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Capture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+});
+
+context("Card - Partial Refund for fully captured 3DS payment", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm 3DS", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Capture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 5000, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 1500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+});
+
+context("Card - Full Refund for partially captured 3DS payment", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm 3DS", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+});
+
+context("Card - partial Refund for partially captured 3DS payment", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("Confirm 3DS", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "3DSManualCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PartialCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 50, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00009-SyncRefund.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00009-SyncRefund.cy.js
new file mode 100644
index 0000000000..0f14dad72d
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00009-SyncRefund.cy.js
@@ -0,0 +1,89 @@
+import confirmBody from "../../fixtures/confirm-body.json";
+import createPaymentBody from "../../fixtures/create-payment-body.json";
+import refundBody from "../../fixtures/refund-flow-body.json";
+import State from "../../utils/State";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
+
+let globalState;
+
+describe("Card - Sync Refund flow test", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "PaymentIntent"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "No3DSAutoCapture"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("refund-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
+ "Refund"
+ ];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.refundCallTest(refundBody, req_data, res_data, 6500, globalState);
+ 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/00010-CreateSingleuseMandate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00010-CreateSingleuseMandate.cy.js
new file mode 100644
index 0000000000..00faf6dfcb
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00010-CreateSingleuseMandate.cy.js
@@ -0,0 +1,199 @@
+import captureBody from "../../fixtures/capture-flow-body.json";
+import citConfirmBody from "../../fixtures/create-mandate-cit.json";
+import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
+import State from "../../utils/State";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
+
+let globalState;
+
+describe("Card - SingleUse Mandates flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context(
+ "Card - NoThreeDS Create + Confirm Automatic CIT and MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateSingleUseNo3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 7000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+ },
+ );
+
+ context(
+ "Card - NoThreeDS Create + Confirm Manual CIT and MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateSingleUseNo3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 6500,
+ true,
+ "manual",
+ "new_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("cit-capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 6500,
+ true,
+ "manual",
+ globalState,
+ );
+ });
+
+ it("mit-capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("list-mandate-call-test", () => {
+ cy.listMandateCallTest(globalState);
+ });
+ },
+ );
+
+ context(
+ "Card - ThreeDS Create + Confirm Manual CIT and MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Create No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateSingleUseNo3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 6500,
+ true,
+ "manual",
+ "new_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("cit-capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+
+ it("list-mandate-call-test", () => {
+ cy.listMandateCallTest(globalState);
+ });
+ },
+ );
+});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00011-CreateMultiuseMandate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00011-CreateMultiuseMandate.cy.js
new file mode 100644
index 0000000000..1dee7ea901
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00011-CreateMultiuseMandate.cy.js
@@ -0,0 +1,222 @@
+import captureBody from "../../fixtures/capture-flow-body.json";
+import citConfirmBody from "../../fixtures/create-mandate-cit.json";
+import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
+import State from "../../utils/State";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
+
+let globalState;
+
+describe("Card - MultiUse Mandates flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context(
+ "Card - NoThreeDS Create + Confirm Automatic CIT and MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateMultiUseNo3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 7000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+ },
+ );
+
+ context(
+ "Card - NoThreeDS Create + Confirm Manual CIT and MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateMultiUseNo3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 6500,
+ true,
+ "manual",
+ "new_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("cit-capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT 1", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 6500,
+ true,
+ "manual",
+ globalState,
+ );
+ });
+
+ it("mit-capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT 2", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 6500,
+ true,
+ "manual",
+ globalState,
+ );
+ });
+
+ it("mit-capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ },
+ );
+
+ context(
+ "Card - ThreeDS Create + Confirm Manual CIT and MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateMultiUseNo3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 6500,
+ true,
+ "manual",
+ "new_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("cit-capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 6500,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+ },
+ );
+});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00012-ListAndRevokeMandate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00012-ListAndRevokeMandate.cy.js
new file mode 100644
index 0000000000..28ffacb829
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00012-ListAndRevokeMandate.cy.js
@@ -0,0 +1,77 @@
+import citConfirmBody from "../../fixtures/create-mandate-cit.json";
+import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
+
+import State from "../../utils/State";
+
+let globalState;
+
+describe("Card - SingleUse Mandates flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context(
+ "Card - NoThreeDS Create + Confirm Automatic CIT and MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateSingleUseNo3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ console.log("det -> " + data.card);
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 7000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+
+ it("list-mandate-call-test", () => {
+ cy.listMandateCallTest(globalState);
+ });
+
+ it("revoke-mandate-call-test", () => {
+ cy.revokeMandateCallTest(globalState);
+ });
+
+ it("revoke-revoked-mandate-call-test", () => {
+ cy.revokeMandateCallTest(globalState);
+ });
+ },
+ );
+});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js
new file mode 100644
index 0000000000..c31a24e393
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00013-SaveCardFlow.cy.js
@@ -0,0 +1,278 @@
+import captureBody from "../../fixtures/capture-flow-body.json";
+import confirmBody from "../../fixtures/confirm-body.json";
+import createPaymentBody from "../../fixtures/create-payment-body.json";
+import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
+import customerCreateBody from "../../fixtures/create-customer-body.json";
+import SaveCardConfirmBody from "../../fixtures/save-card-confirm-body.json";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
+import State from "../../utils/State";
+let globalState;
+
+describe("Card - SaveCard payment flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ context(
+ "Save card for NoThreeDS automatic capture payment- Create+Confirm",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("customer-create-call-test", () => {
+ cy.createCustomerCallTest(customerCreateBody, globalState);
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("retrieve-customerPM-call-test", () => {
+ cy.listCustomerPMCallTest(globalState);
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("confirm-save-card-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.saveCardConfirmCallTest(
+ SaveCardConfirmBody,
+ req_data,
+ res_data,
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ },
+ );
+
+ context(
+ "Save card for NoThreeDS manual full capture payment- Create+Confirm",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("customer-create-call-test", () => {
+ cy.createCustomerCallTest(customerCreateBody, globalState);
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("retrieve-customerPM-call-test", () => {
+ cy.listCustomerPMCallTest(globalState);
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("confirm-save-card-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.saveCardConfirmCallTest(
+ SaveCardConfirmBody,
+ req_data,
+ res_data,
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ },
+ );
+
+ context(
+ "Save card for NoThreeDS manual partial capture payment- Create + Confirm",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("customer-create-call-test", () => {
+ cy.createCustomerCallTest(customerCreateBody, globalState);
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSAutoCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "automatic",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("retrieve-customerPM-call-test", () => {
+ cy.listCustomerPMCallTest(globalState);
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "no_three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("confirm-save-card-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SaveCardUseNo3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.saveCardConfirmCallTest(
+ SaveCardConfirmBody,
+ req_data,
+ res_data,
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PartialCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+ },
+ );
+});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00014-ZeroAuthMandate.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00014-ZeroAuthMandate.cy.js
new file mode 100644
index 0000000000..d90d86d8c4
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00014-ZeroAuthMandate.cy.js
@@ -0,0 +1,113 @@
+import citConfirmBody from "../../fixtures/create-mandate-cit.json";
+import mitConfirmBody from "../../fixtures/create-mandate-mit.json";
+import State from "../../utils/State";
+import getConnectorDetails from "../PaymentUtils/utils";
+import * as utils from "../PaymentUtils/utils";
+
+let globalState;
+
+describe("Card - SingleUse Mandates flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context(
+ "Card - NoThreeDS Create + Confirm Automatic CIT and Single use MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["ZeroAuthMandate"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 0,
+ true,
+ "automatic",
+ "setup_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+ },
+ );
+ context(
+ "Card - NoThreeDS Create + Confirm Automatic CIT and Multi use MIT payment flow test",
+ () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["ZeroAuthMandate"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.citForMandatesCallTest(
+ citConfirmBody,
+ req_data,
+ res_data,
+ 0,
+ true,
+ "automatic",
+ "setup_mandate",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+ it("Confirm No 3DS MIT", () => {
+ cy.mitForMandatesCallTest(
+ mitConfirmBody,
+ 7000,
+ true,
+ "automatic",
+ globalState,
+ );
+ });
+ },
+ );
+});
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00015-ThreeDSManualCapture.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00015-ThreeDSManualCapture.cy.js
new file mode 100644
index 0000000000..0aa4ad1049
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00015-ThreeDSManualCapture.cy.js
@@ -0,0 +1,272 @@
+import createPaymentBody from "../../fixtures/create-payment-body.json";
+import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
+import confirmBody from "../../fixtures/confirm-body.json";
+import getConnectorDetails from "../PaymentUtils/utils";
+import State from "../../utils/State";
+import captureBody from "../../fixtures/capture-flow-body.json";
+import * as utils from "../PaymentUtils/utils";
+
+let globalState;
+
+describe("Card - ThreeDS Manual payment flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context("Card - ThreeDS Manual Full Capture payment flow test", () => {
+ context("payment Create and Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.confirmCallTest(confirmBody, req_data, res_data, true, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+ });
+
+ context("Payment Create+Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = createConfirmPaymentBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 6500, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+ });
+ });
+
+ context(
+ "Card - ThreeDS Manual Partial Capture payment flow test - Create and Confirm",
+ () => {
+ context("payment Create and Payment Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntent"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createPaymentIntentTest(
+ createPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("payment_methods-call-test", () => {
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ it("confirm-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.confirmCallTest(
+ confirmBody,
+ req_data,
+ res_data,
+ true,
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = confirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PartialCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+ });
+
+ context("payment + Confirm", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ it("create+confirm-payment-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPaymentTest(
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ "three_ds",
+ "manual",
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("Handle redirection", () => {
+ let expected_redirection = createConfirmPaymentBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+
+ it("capture-call-test", () => {
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PartialCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.captureCallTest(captureBody, req_data, res_data, 100, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ cy.retrievePaymentCallTest(globalState);
+ });
+ });
+ },
+ );
+});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00016-BankTransfers.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00016-BankTransfers.cy.js
similarity index 93%
rename from cypress-tests/cypress/e2e/ConnectorTest/00016-BankTransfers.cy.js
rename to cypress-tests/cypress/e2e/PaymentTest/00016-BankTransfers.cy.js
index da4fab34b8..6e132f5a1b 100644
--- a/cypress-tests/cypress/e2e/ConnectorTest/00016-BankTransfers.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00016-BankTransfers.cy.js
@@ -1,7 +1,7 @@
import confirmBody from "../../fixtures/confirm-body.json";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
-import getConnectorDetails, * as utils from "../ConnectorUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/utils";
let globalState;
@@ -37,7 +37,7 @@ describe("Bank Transfers", () => {
res_data,
"three_ds",
"automatic",
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -58,7 +58,7 @@ describe("Bank Transfers", () => {
req_data,
res_data,
true,
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -70,7 +70,7 @@ describe("Bank Transfers", () => {
cy.handleBankTransferRedirection(
globalState,
payment_method_type,
- expected_redirection
+ expected_redirection,
);
});
});
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00017-BankRedirect.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
similarity index 95%
rename from cypress-tests/cypress/e2e/ConnectorTest/00017-BankRedirect.cy.js
rename to cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
index 3a636b2020..0706cf15b1 100644
--- a/cypress-tests/cypress/e2e/ConnectorTest/00017-BankRedirect.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentTest/00017-BankRedirect.cy.js
@@ -1,7 +1,7 @@
import confirmBody from "../../fixtures/confirm-body.json";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
-import getConnectorDetails, * as utils from "../ConnectorUtils/utils";
+import getConnectorDetails, * as utils from "../PaymentUtils/utils";
let globalState;
@@ -41,7 +41,7 @@ describe("Bank Redirect tests", () => {
res_data,
"three_ds",
"automatic",
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -62,7 +62,7 @@ describe("Bank Redirect tests", () => {
req_data,
res_data,
true,
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -89,7 +89,7 @@ describe("Bank Redirect tests", () => {
res_data,
"three_ds",
"automatic",
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -110,7 +110,7 @@ describe("Bank Redirect tests", () => {
req_data,
res_data,
true,
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -123,7 +123,7 @@ describe("Bank Redirect tests", () => {
cy.handleBankRedirectRedirection(
globalState,
payment_method_type,
- expected_redirection
+ expected_redirection,
);
});
});
@@ -149,7 +149,7 @@ describe("Bank Redirect tests", () => {
res_data,
"three_ds",
"automatic",
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -170,7 +170,7 @@ describe("Bank Redirect tests", () => {
req_data,
res_data,
true,
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -183,7 +183,7 @@ describe("Bank Redirect tests", () => {
cy.handleBankRedirectRedirection(
globalState,
payment_method_type,
- expected_redirection
+ expected_redirection,
);
});
});
@@ -208,7 +208,7 @@ describe("Bank Redirect tests", () => {
res_data,
"three_ds",
"automatic",
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -229,7 +229,7 @@ describe("Bank Redirect tests", () => {
req_data,
res_data,
true,
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -242,7 +242,7 @@ describe("Bank Redirect tests", () => {
cy.handleBankRedirectRedirection(
globalState,
payment_method_type,
- expected_redirection
+ expected_redirection,
);
});
});
@@ -267,7 +267,7 @@ describe("Bank Redirect tests", () => {
res_data,
"three_ds",
"automatic",
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -288,7 +288,7 @@ describe("Bank Redirect tests", () => {
req_data,
res_data,
true,
- globalState
+ globalState,
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
@@ -301,7 +301,7 @@ describe("Bank Redirect tests", () => {
cy.handleBankRedirectRedirection(
globalState,
payment_method_type,
- expected_redirection
+ expected_redirection,
);
});
});
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/Adyen.js b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
similarity index 100%
rename from cypress-tests/cypress/e2e/ConnectorUtils/Adyen.js
rename to cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js b/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js
new file mode 100644
index 0000000000..a34190c209
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js
@@ -0,0 +1,369 @@
+const successfulNo3DSCardDetails = {
+ card_number: "4242424242424242",
+ card_exp_month: "01",
+ card_exp_year: "25",
+ card_holder_name: "joseph Doe",
+ card_cvc: "123",
+};
+
+const successfulThreeDSTestCardDetails = {
+ card_number: "4000000000001091",
+ card_exp_month: "01",
+ card_exp_year: "25",
+ card_holder_name: "joseph Doe",
+ card_cvc: "123",
+};
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ "3DSManualCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ No3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ Capture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 6500,
+ },
+ },
+ },
+ PartialCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "partially_captured",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 100,
+ },
+ },
+ },
+ Void: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "cancelled",
+ },
+ },
+ },
+ Refund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "pending",
+ },
+ },
+ },
+ PartialRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "pending",
+ },
+ },
+ },
+ SyncRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "pending",
+ },
+ },
+ },
+ MandateSingleUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUse3DSManualCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ MandateSingleUseNo3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUseNo3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUseNo3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateMultiUseNo3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUse3DSManualCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCapture: {
+ 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: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ 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: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js b/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
new file mode 100644
index 0000000000..0969e4088d
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
@@ -0,0 +1,414 @@
+const successfulNo3DSCardDetails = {
+ card_number: "4242424242424242",
+ card_exp_month: "10",
+ card_exp_year: "30",
+ card_holder_name: "John",
+ card_cvc: "737",
+};
+
+const successfulThreeDSTestCardDetails = {
+ card_number: "4000000000001091",
+ card_exp_month: "10",
+ card_exp_year: "30",
+ card_holder_name: "Joseph",
+ card_cvc: "737",
+};
+
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ "3DSManualCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ No3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ Capture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 6500,
+ },
+ },
+ },
+ PartialCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "partially_captured",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 100,
+ },
+ },
+ },
+ Void: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "cancelled",
+ },
+ },
+ },
+ Refund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ PartialRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SyncRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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",
+ },
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 501,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Setup Mandate flow for Bluesnap is not implemented",
+ code: "IR_00",
+ },
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCapture: {
+ 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: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ 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: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/Commons.js b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
similarity index 100%
rename from cypress-tests/cypress/e2e/ConnectorUtils/Commons.js
rename to cypress-tests/cypress/e2e/PaymentUtils/Commons.js
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js
new file mode 100644
index 0000000000..d4818ce294
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js
@@ -0,0 +1,370 @@
+const successfulNo3DSCardDetails = {
+ card_number: "4242424242424242",
+ card_exp_month: "01",
+ card_exp_year: "25",
+ card_holder_name: "joseph Doe",
+ card_cvc: "123",
+};
+
+const successfulThreeDSTestCardDetails = {
+ card_number: "4000000000001091",
+ card_exp_month: "01",
+ card_exp_year: "25",
+ card_holder_name: "joseph Doe",
+ card_cvc: "123",
+};
+
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ "3DSManualCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ No3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ Capture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 6500,
+ },
+ },
+ },
+ PartialCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "partially_captured",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 100,
+ },
+ },
+ },
+ Void: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "cancelled",
+ },
+ },
+ },
+ Refund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "pending",
+ },
+ },
+ },
+ PartialRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "pending",
+ },
+ },
+ },
+ SyncRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "pending",
+ },
+ },
+ },
+ MandateSingleUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUse3DSManualCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ MandateSingleUseNo3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUseNo3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUseNo3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateMultiUseNo3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUse3DSManualCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCapture: {
+ 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: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ 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: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js b/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js
new file mode 100644
index 0000000000..c420bb8844
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js
@@ -0,0 +1,417 @@
+const successfulNo3DSCardDetails = {
+ card_number: "4000000000002503",
+ card_exp_month: "08",
+ card_exp_year: "25",
+ card_holder_name: "joseph Doe",
+ card_cvc: "999",
+};
+
+const successfulThreeDSTestCardDetails = {
+ card_number: "4000000000002503",
+ card_exp_month: "10",
+ card_exp_year: "25",
+ card_holder_name: "morino",
+ card_cvc: "999",
+};
+
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ "3DSManualCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ No3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ Capture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ amount: 6500,
+ amount_capturable: 6500,
+ },
+ },
+ },
+ PartialCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ amount: 6500,
+ amount_capturable: 6500,
+ },
+ },
+ },
+ Void: {
+ Request: {},
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ code: "IR_16",
+ message:
+ "You cannot cancel this payment because it has status processing",
+ type: "invalid_request",
+ },
+ },
+ },
+ },
+ Refund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "pending",
+ },
+ },
+ },
+ PartialRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "pending",
+ },
+ },
+ },
+ SyncRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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",
+ },
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 501,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Setup Mandate flow for Nmi is not implemented",
+ code: "IR_00",
+ },
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCapture: {
+ 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: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ 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: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js b/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
new file mode 100644
index 0000000000..69c39f0dc8
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
@@ -0,0 +1,429 @@
+const successfulNo3DSCardDetails = {
+ card_number: "4012000033330026",
+ card_exp_month: "01",
+ card_exp_year: "25",
+ card_holder_name: "joseph Doe",
+ card_cvc: "123",
+};
+
+const successfulThreeDSTestCardDetails = {
+ card_number: "4868719460707704",
+ card_exp_month: "01",
+ card_exp_year: "25",
+ card_holder_name: "joseph Doe",
+ card_cvc: "123",
+};
+
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ "3DSManualCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ No3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ Capture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ amount: 6500,
+ amount_capturable: 6500,
+ amount_received: 0,
+ },
+ },
+ },
+ PartialCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "processing",
+ amount: 6500,
+ amount_capturable: 6500,
+ amount_received: 0,
+ },
+ },
+ },
+ Void: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "cancelled",
+ },
+ },
+ },
+ Refund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message:
+ "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured",
+ code: "IR_14",
+ },
+ },
+ },
+ },
+ PartialRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message:
+ "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured",
+ code: "IR_14",
+ },
+ },
+ },
+ },
+ SyncRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message:
+ "This Payment could not be refund because it has a status of processing. The expected state is succeeded, partially_captured",
+ code: "IR_14",
+ },
+ },
+ },
+ },
+ MandateSingleUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ 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: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 501,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Setup Mandate flow for Paypal is not implemented",
+ code: "IR_00",
+ },
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCapture: {
+ 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: 200,
+ body: {
+ status: "processing",
+ },
+ },
+ },
+ 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: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
new file mode 100644
index 0000000000..841c40b873
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
@@ -0,0 +1,373 @@
+const successfulTestCard = "4242424242424242";
+const successful3DSCard = "4000002760003184";
+
+const successfulNo3DSCardDetails = {
+ card_number: "4242424242424242",
+ card_exp_month: "10",
+ card_exp_year: "25",
+ card_holder_name: "morino",
+ card_cvc: "737",
+};
+
+const successfulThreeDSTestCardDetails = {
+ card_number: "4000002760003184",
+ card_exp_month: "10",
+ card_exp_year: "25",
+ card_holder_name: "morino",
+ card_cvc: "737",
+};
+
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ "3DSManualCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ No3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ Capture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 6500,
+ },
+ },
+ },
+ PartialCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "partially_captured",
+ amount: 6500,
+ amount_capturable: 0,
+ amount_received: 100,
+ },
+ },
+ },
+ Void: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "cancelled",
+ },
+ },
+ },
+ Refund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ PartialRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SyncRefund: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ customer_acceptance: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUse3DSManualCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ MandateSingleUseNo3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateSingleUseNo3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUseNo3DSAutoCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MandateMultiUseNo3DSManualCapture: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUse3DSAutoCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUse3DSManualCapture: {
+ Request: {
+ card: successfulThreeDSTestCardDetails,
+ currency: "USD",
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ Request: {
+ card: successfulNo3DSCardDetails,
+ currency: "USD",
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCapture: {
+ 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: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ 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: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/Trustpay.js b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
similarity index 100%
rename from cypress-tests/cypress/e2e/ConnectorUtils/Trustpay.js
rename to cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
diff --git a/cypress-tests/cypress/e2e/ConnectorUtils/utils.js b/cypress-tests/cypress/e2e/PaymentUtils/utils.js
similarity index 100%
rename from cypress-tests/cypress/e2e/ConnectorUtils/utils.js
rename to cypress-tests/cypress/e2e/PaymentUtils/utils.js
diff --git a/cypress-tests/cypress/e2e/ConnectorTest/00000-AccountCreate.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00000-AccountCreate.cy.js
similarity index 83%
rename from cypress-tests/cypress/e2e/ConnectorTest/00000-AccountCreate.cy.js
rename to cypress-tests/cypress/e2e/PayoutTest/00000-AccountCreate.cy.js
index aed901c299..c1b62c883f 100644
--- a/cypress-tests/cypress/e2e/ConnectorTest/00000-AccountCreate.cy.js
+++ b/cypress-tests/cypress/e2e/PayoutTest/00000-AccountCreate.cy.js
@@ -4,16 +4,14 @@ import State from "../../utils/State";
let globalState;
describe("Account Create flow test", () => {
-
before("seed global state", () => {
-
- cy.task('getGlobalState').then((state) => {
+ cy.task("getGlobalState").then((state) => {
globalState = new State(state);
- })
- })
+ });
+ });
after("flush global state", () => {
- cy.task('setGlobalState', globalState.data);
- })
+ cy.task("setGlobalState", globalState.data);
+ });
it("merchant-create-call-test", () => {
cy.merchantCreateCallTest(merchantCreateBody, globalState);
@@ -21,5 +19,4 @@ describe("Account Create flow test", () => {
it("api-key-create-call-test", () => {
cy.apiKeyCreateTest(apiKeyCreateBody, globalState);
});
-
});
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00001-CustomerCreate.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00001-CustomerCreate.cy.js
new file mode 100644
index 0000000000..584296bdae
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PayoutTest/00001-CustomerCreate.cy.js
@@ -0,0 +1,18 @@
+import customerCreateBody from "../../fixtures/create-customer-body.json";
+import State from "../../utils/State";
+
+let globalState;
+
+describe("Customer Create flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+ after("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+ it("customer-create-call-test", () => {
+ cy.createCustomerCallTest(customerCreateBody, globalState);
+ });
+});
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js
new file mode 100644
index 0000000000..16292914aa
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js
@@ -0,0 +1,21 @@
+import createConnectorBody from "../../fixtures/create-connector-body.json";
+import State from "../../utils/State";
+
+let globalState;
+describe("Connector Account Create flow test", () => {
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ console.log("seeding globalState -> " + JSON.stringify(globalState));
+ });
+ });
+
+ after("flush global state", () => {
+ console.log("flushing globalState -> " + JSON.stringify(globalState));
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ it("connector-create-call-test", () => {
+ cy.createPayoutConnectorCallTest(createConnectorBody, globalState);
+ });
+});
diff --git a/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js b/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js
new file mode 100644
index 0000000000..4f563a689c
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PayoutTest/00003-CardTest.cy.js
@@ -0,0 +1,140 @@
+import createPayoutBody from "../../fixtures/create-payout-confirm-body.json";
+import State from "../../utils/State";
+import * as utils from "../PayoutUtils/utils";
+
+let globalState;
+
+describe("Card - Auto Fulfill", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ console.log("seeding globalState -> " + JSON.stringify(globalState));
+ cy.task(
+ "cli_log",
+ "SEEDING GLOBAL STATE -> " + JSON.stringify(globalState),
+ );
+ });
+ });
+
+ afterEach("flush global state", () => {
+ console.log("flushing globalState -> " + JSON.stringify(globalState));
+ cy.task("setGlobalState", globalState.data);
+ cy.task(
+ "cli_log",
+ " FLUSHING GLOBAL STATE -> " + JSON.stringify(globalState),
+ );
+ });
+
+ context("Payout Card with Auto Fulfill", () => {
+ it("confirm-payout-call-with-auto-fulfill-test", () => {
+ let data = utils.getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Fulfill"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPayoutTest(
+ createPayoutBody,
+ req_data,
+ res_data,
+ true,
+ true,
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payout-call-test", () => {
+ cy.retrievePayoutCallTest(globalState);
+ });
+ });
+
+ context("Payout Card with Manual Fulfill - Create Confirm", () => {
+ it("confirm-payout-call-with-manual-fulfill-test", () => {
+ let data = utils.getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Confirm"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPayoutTest(
+ createPayoutBody,
+ req_data,
+ res_data,
+ true,
+ false,
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("fulfill-payout-call-test", () => {
+ let data = utils.getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Fulfill"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.fulfillPayoutCallTest({}, req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payout-call-test", () => {
+ cy.retrievePayoutCallTest(globalState);
+ });
+ });
+
+ context("Payout Card with Manual Fulfill - Create Intent + Confirm", () => {
+ it("create-payout-call", () => {
+ let data = utils.getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Create"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.createConfirmPayoutTest(
+ createPayoutBody,
+ req_data,
+ res_data,
+ false,
+ false,
+ globalState,
+ );
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("confirm-payout-call", () => {
+ let data = utils.getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Confirm"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.updatePayoutCallTest({}, req_data, res_data, false, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("fulfill-payout-call-test", () => {
+ let data = utils.getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Fulfill"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+ cy.fulfillPayoutCallTest({}, req_data, res_data, globalState);
+ if (should_continue)
+ should_continue = utils.should_continue_further(res_data);
+ });
+
+ it("retrieve-payout-call-test", () => {
+ cy.retrievePayoutCallTest(globalState);
+ });
+ });
+});
diff --git a/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js b/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js
new file mode 100644
index 0000000000..eaa25e7fa2
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PayoutUtils/Adyen.js
@@ -0,0 +1,59 @@
+const card_data = {
+ card_number: "4111111111111111",
+ expiry_month: "3",
+ expiry_year: "2030",
+ card_holder_name: "John Smith",
+};
+
+export const connectorDetails = {
+ card_pm: {
+ Create: {
+ Request: {
+ payout_method_data: {
+ card: card_data,
+ },
+ currency: "EUR",
+ payout_type: "card",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_creation",
+ payout_type: "card",
+ },
+ },
+ },
+ Confirm: {
+ Request: {
+ payout_method_data: {
+ card: card_data,
+ },
+ currency: "EUR",
+ payout_type: "card",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_fulfillment",
+ payout_type: "card",
+ },
+ },
+ },
+ Fulfill: {
+ Request: {
+ payout_method_data: {
+ card: card_data,
+ },
+ currency: "EUR",
+ payout_type: "card",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "success",
+ payout_type: "card",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/PayoutUtils/utils.js b/cypress-tests/cypress/e2e/PayoutUtils/utils.js
new file mode 100644
index 0000000000..619fd313f2
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PayoutUtils/utils.js
@@ -0,0 +1,33 @@
+import { connectorDetails as adyenConnectorDetails } from "./Adyen.js";
+
+const connectorDetails = {
+ adyen: adyenConnectorDetails,
+};
+
+export const getConnectorDetails = (connectorId) => {
+ let x = getValueByKey(connectorDetails, connectorId);
+ return x;
+};
+
+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;
+ }
+}
+
+export const should_continue_further = (res_data) => {
+ if (
+ res_data.body.error !== undefined ||
+ res_data.body.error_code !== undefined ||
+ res_data.body.error_message !== undefined
+ ) {
+ return false;
+ } else {
+ return true;
+ }
+};
diff --git a/cypress-tests/cypress/fixtures/create-payout-confirm-body.json b/cypress-tests/cypress/fixtures/create-payout-confirm-body.json
new file mode 100644
index 0000000000..2eb32bf26d
--- /dev/null
+++ b/cypress-tests/cypress/fixtures/create-payout-confirm-body.json
@@ -0,0 +1,36 @@
+{
+ "amount": 1,
+ "currency": "EUR",
+ "customer_id": "payout_customer",
+ "email": "[email protected]",
+ "name": "John Doe",
+ "phone": "999999999",
+ "phone_country_code": "+65",
+ "description": "Its my first payout request",
+ "payout_type": "card",
+ "payout_method_data": {},
+ "billing": {
+ "address": {
+ "line1": "1467",
+ "line2": "Harrison Street",
+ "line3": "Harrison Street",
+ "city": "San Fransico",
+ "state": "NY",
+ "zip": "94122",
+ "country": "US",
+ "first_name": "John",
+ "last_name": "Doe"
+ },
+ "phone": {
+ "number": "8056594427",
+ "country_code": "+91"
+ }
+ },
+ "entity_type": "Individual",
+ "recurring": false,
+ "metadata": {
+ "ref": "123"
+ },
+ "auto_fulfill": true,
+ "confirm": true
+}
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index 4842ed0173..59a2016686 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -30,9 +30,9 @@ import { handleRedirection } from "./redirectionHandler";
function logRequestId(xRequestId) {
if (xRequestId) {
- cy.task('cli_log', "x-request-id -> " + xRequestId);
+ cy.task("cli_log", "x-request-id -> " + xRequestId);
} else {
- cy.task('cli_log', "x-request-id is not available in the response headers");
+ cy.task("cli_log", "x-request-id is not available in the response headers");
}
}
@@ -43,27 +43,30 @@ function defaultErrorHandler(response, response_data) {
}
}
-Cypress.Commands.add("merchantCreateCallTest", (merchantCreateBody, globalState) => {
- const randomMerchantId = RequestBodyUtils.generateRandomString();
- RequestBodyUtils.setMerchantId(merchantCreateBody, randomMerchantId);
- globalState.set("merchantId", randomMerchantId);
+Cypress.Commands.add(
+ "merchantCreateCallTest",
+ (merchantCreateBody, globalState) => {
+ const randomMerchantId = RequestBodyUtils.generateRandomString();
+ RequestBodyUtils.setMerchantId(merchantCreateBody, randomMerchantId);
+ globalState.set("merchantId", randomMerchantId);
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/accounts`,
- headers: {
- "Content-Type": "application/json",
- Accept: "application/json",
- "api-key": globalState.get("adminApiKey"),
- },
- body: merchantCreateBody,
- }).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/accounts`,
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "api-key": globalState.get("adminApiKey"),
+ },
+ body: merchantCreateBody,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
- // Handle the response as needed
- globalState.set("publishableKey", response.body.publishable_key);
- });
-});
+ // Handle the response as needed
+ globalState.set("publishableKey", response.body.publishable_key);
+ });
+ },
+);
Cypress.Commands.add("apiKeyCreateTest", (apiKeyCreateBody, globalState) => {
cy.request({
@@ -76,113 +79,191 @@ Cypress.Commands.add("apiKeyCreateTest", (apiKeyCreateBody, globalState) => {
},
body: apiKeyCreateBody,
}).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ logRequestId(response.headers["x-request-id"]);
// Handle the response as needed
globalState.set("apiKey", response.body.api_key);
});
});
-Cypress.Commands.add("createConnectorCallTest", (createConnectorBody, globalState) => {
- const merchantId = globalState.get("merchantId");
- createConnectorBody.connector_name = globalState.get("connectorId");
- // readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature
- // it is best to use then() to handle the response within the same block of code
- cy.readFile(globalState.get("connectorAuthFilePath")).then((jsonContent) => {
- const authDetails = getValueByKey(JSON.stringify(jsonContent), globalState.get("connectorId"));
- createConnectorBody.connector_account_details = authDetails;
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/account/${merchantId}/connectors`,
- headers: {
- "Content-Type": "application/json",
- Accept: "application/json",
- "api-key": globalState.get("adminApiKey"),
+Cypress.Commands.add(
+ "createConnectorCallTest",
+ (createConnectorBody, globalState) => {
+ const merchantId = globalState.get("merchantId");
+ createConnectorBody.connector_name = globalState.get("connectorId");
+ // readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature
+ // it is best to use then() to handle the response within the same block of code
+ cy.readFile(globalState.get("connectorAuthFilePath")).then(
+ (jsonContent) => {
+ const authDetails = getValueByKey(
+ JSON.stringify(jsonContent),
+ globalState.get("connectorId"),
+ );
+ createConnectorBody.connector_account_details = authDetails;
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/account/${merchantId}/connectors`,
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "api-key": globalState.get("adminApiKey"),
+ },
+ body: createConnectorBody,
+ failOnStatusCode: false,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
+
+ if (response.status === 200) {
+ expect(globalState.get("connectorId")).to.equal(
+ response.body.connector_name,
+ );
+ } else {
+ cy.task(
+ "cli_log",
+ "response status -> " + JSON.stringify(response.status),
+ );
+ }
+ });
},
- body: createConnectorBody,
- failOnStatusCode: false
- }).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ );
+ },
+);
- if (response.status === 200) {
- expect(globalState.get("connectorId")).to.equal(response.body.connector_name);
- } else {
- cy.task('cli_log', "response status -> " + JSON.stringify(response.status));
- }
- });
- });
-});
+Cypress.Commands.add(
+ "createPayoutConnectorCallTest",
+ (createConnectorBody, globalState) => {
+ const merchantId = globalState.get("merchantId");
+ let connectorName = globalState.get("connectorId");
+ createConnectorBody.connector_name = connectorName;
+ createConnectorBody.connector_type = "payout_processor";
+ // readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature
+ // it is best to use then() to handle the response within the same block of code
+ cy.readFile(globalState.get("connectorAuthFilePath")).then(
+ (jsonContent) => {
+ const authDetails = getValueByKey(
+ JSON.stringify(jsonContent),
+ `${connectorName}_payout`,
+ );
+ createConnectorBody.connector_account_details = authDetails;
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/account/${merchantId}/connectors`,
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "api-key": globalState.get("adminApiKey"),
+ },
+ body: createConnectorBody,
+ failOnStatusCode: false,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
+
+ if (response.status === 200) {
+ expect(globalState.get("connectorId")).to.equal(
+ response.body.connector_name,
+ );
+ } else {
+ cy.task(
+ "cli_log",
+ "response status -> " + JSON.stringify(response.status),
+ );
+ }
+ });
+ },
+ );
+ },
+);
function getValueByKey(jsonObject, key) {
- const data = typeof jsonObject === 'string' ? JSON.parse(jsonObject) : jsonObject;
- if (data && typeof data === 'object' && key in data) {
+ 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) => {
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/customers`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("apiKey"),
- },
- body: customerCreateBody,
- }).then((response) => {
- logRequestId(response.headers['x-request-id']);
+Cypress.Commands.add(
+ "createCustomerCallTest",
+ (customerCreateBody, globalState) => {
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/customers`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ body: customerCreateBody,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
- globalState.set("customerId", response.body.customer_id);
- });
-});
+ globalState.set("customerId", response.body.customer_id);
+ });
+ },
+);
-Cypress.Commands.add("createPaymentIntentTest", (request, req_data, res_data, authentication_type, capture_method, globalState) => {
- if (!request || typeof request !== "object" || !req_data.currency || !authentication_type) {
- throw new Error("Invalid parameters provided to createPaymentIntentTest command");
- }
- request.currency = req_data.currency;
- request.authentication_type = authentication_type;
- request.capture_method = capture_method;
- request.setup_future_usage = req_data.setup_future_usage;
- request.customer_acceptance = req_data.customer_acceptance;
- request.customer_id = globalState.get("customerId");
- globalState.set("paymentAmount", request.amount);
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/payments`,
- headers: {
- "Content-Type": "application/json",
- Accept: "application/json",
- "api-key": globalState.get("apiKey"),
- },
- failOnStatusCode: false,
- body: request,
- }).then((response) => {
- logRequestId(response.headers['x-request-id']);
+Cypress.Commands.add(
+ "createPaymentIntentTest",
+ (
+ request,
+ req_data,
+ res_data,
+ authentication_type,
+ capture_method,
+ globalState,
+ ) => {
+ if (
+ !request ||
+ typeof request !== "object" ||
+ !req_data.currency ||
+ !authentication_type
+ ) {
+ throw new Error(
+ "Invalid parameters provided to createPaymentIntentTest command",
+ );
+ }
+ request.currency = req_data.currency;
+ request.authentication_type = authentication_type;
+ request.capture_method = capture_method;
+ request.setup_future_usage = req_data.setup_future_usage;
+ request.customer_acceptance = req_data.customer_acceptance;
+ request.customer_id = globalState.get("customerId");
+ globalState.set("paymentAmount", request.amount);
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payments`,
+ headers: {
+ "Content-Type": "application/json",
+ Accept: "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ body: request,
+ }).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){
- expect(response.body).to.have.property("client_secret");
- const clientSecret = response.body.client_secret;
- globalState.set("clientSecret", clientSecret);
- globalState.set("paymentID", response.body.payment_id);
- cy.log(clientSecret);
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
+ expect(res_data.status).to.equal(response.status);
+ expect(response.headers["content-type"]).to.include("application/json");
+
+ if (response.status === 200) {
+ expect(response.body).to.have.property("client_secret");
+ const clientSecret = response.body.client_secret;
+ globalState.set("clientSecret", clientSecret);
+ globalState.set("paymentID", response.body.payment_id);
+ cy.log(clientSecret);
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ expect(request.amount).to.equal(response.body.amount);
+ expect(null).to.equal(response.body.amount_received);
+ expect(request.amount).to.equal(response.body.amount_capturable);
+ } else {
+ defaultErrorHandler(response, res_data);
}
- expect(request.amount).to.equal(response.body.amount);
- expect(null).to.equal(response.body.amount_received);
- expect(request.amount).to.equal(response.body.amount_capturable);
- }
- else {
- defaultErrorHandler(response, res_data);
- }
- });
-});
+ });
+ },
+);
Cypress.Commands.add("paymentMethodsCallTest", (globalState) => {
const clientSecret = globalState.get("clientSecret");
@@ -196,7 +277,7 @@ Cypress.Commands.add("paymentMethodsCallTest", (globalState) => {
"api-key": globalState.get("publishableKey"),
},
}).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ logRequestId(response.headers["x-request-id"]);
expect(response.headers["content-type"]).to.include("application/json");
expect(response.body).to.have.property("redirect_url");
@@ -206,60 +287,69 @@ Cypress.Commands.add("paymentMethodsCallTest", (globalState) => {
});
});
-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;
+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;
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/payments/${paymentIntentID}/confirm`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("publishableKey"),
- },
- failOnStatusCode: false,
- 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){
- globalState.set("paymentID", paymentIntentID);
- if (response.body.capture_method === "automatic") {
- if (response.body.authentication_type === "three_ds") {
- 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.authentication_type === "no_three_ds") {
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payments/${paymentIntentID}/confirm`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("publishableKey"),
+ },
+ failOnStatusCode: false,
+ 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) {
+ globalState.set("paymentID", paymentIntentID);
+ if (response.body.capture_method === "automatic") {
+ if (response.body.authentication_type === "three_ds") {
+ 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.authentication_type === "no_three_ds") {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, res_data);
}
- } else {
- defaultErrorHandler(response, res_data);
- }
- } else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- 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.authentication_type === "no_three_ds") {
- for (const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ 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.authentication_type === "no_three_ds") {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, res_data);
}
- } else {
- defaultErrorHandler(response, res_data);
}
+ } else {
+ defaultErrorHandler(response, res_data);
}
- }
- else {
- defaultErrorHandler(response, res_data);
- }
- });
-});
+ });
+ },
+);
Cypress.Commands.add(
"confirmBankRedirectCallTest",
@@ -294,8 +384,12 @@ Cypress.Commands.add(
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") {
+ 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")
@@ -306,11 +400,13 @@ Cypress.Commands.add(
.to.have.property("redirect_to_url");
globalState.set(
"nextActionUrl",
- response.body.next_action.redirect_to_url
+ 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);
+ expect(response.body.error_code).to.equal(
+ res_data.body.error_code,
+ );
}
} else {
defaultErrorHandler(response, res_data);
@@ -326,7 +422,7 @@ Cypress.Commands.add(
.to.have.property("redirect_to_url");
globalState.set(
"nextActionUrl",
- response.body.next_action.redirect_to_url
+ response.body.next_action.redirect_to_url,
);
} else {
defaultErrorHandler(response, res_data);
@@ -336,7 +432,7 @@ Cypress.Commands.add(
defaultErrorHandler(response, res_data);
}
});
- }
+ },
);
Cypress.Commands.add(
@@ -349,7 +445,7 @@ Cypress.Commands.add(
confirmBody.confirm = confirm;
confirmBody.client_secret = globalState.get("clientSecret");
globalState.set("paymentMethodType", confirmBody.payment_method_type);
-
+
cy.request({
method: "POST",
url: `${globalState.get("baseUrl")}/payments/${paymentIntentID}/confirm`,
@@ -376,7 +472,7 @@ Cypress.Commands.add(
.to.have.property("qr_code_url");
globalState.set(
"nextActionUrl", // This is intentionally kept as nextActionUrl to avoid issues during handleRedirection call,
- response.body.next_action.qr_code_url
+ response.body.next_action.qr_code_url,
);
break;
default:
@@ -385,7 +481,7 @@ Cypress.Commands.add(
.to.have.property("redirect_to_url");
globalState.set(
"nextActionUrl",
- response.body.next_action.redirect_to_url
+ response.body.next_action.redirect_to_url,
);
break;
}
@@ -396,190 +492,214 @@ Cypress.Commands.add(
defaultErrorHandler(response, res_data);
}
});
- }
+ },
);
-Cypress.Commands.add("createConfirmPaymentTest", (createConfirmPaymentBody, req_data, res_data, authentication_type, 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");
-
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/payments`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("apiKey"),
- },
- failOnStatusCode: false,
- 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 (response.body.capture_method === "automatic") {
- expect(response.body).to.have.property("status");
- globalState.set("paymentAmount", createConfirmPaymentBody.amount);
- globalState.set("paymentID", response.body.payment_id);
- if (response.body.authentication_type === "three_ds") {
- 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.authentication_type === "no_three_ds") {
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
- }
- } else {
- defaultErrorHandler(response, res_data);
- }
- }
- else if (response.body.capture_method === "manual") {
- expect(response.body).to.have.property("status");
- globalState.set("paymentAmount", createConfirmPaymentBody.amount);
- globalState.set("paymentID", response.body.payment_id);
- if (response.body.authentication_type === "three_ds") {
- 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.authentication_type === "no_three_ds") {
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
- }
- } else {
- defaultErrorHandler(response, res_data);
- }
- }
- }
- else{
- defaultErrorHandler(response, res_data);
- }
- });
-});
+Cypress.Commands.add(
+ "createConfirmPaymentTest",
+ (
+ createConfirmPaymentBody,
+ req_data,
+ res_data,
+ authentication_type,
+ 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");
-// This is consequent saved card payment confirm call test(Using payment token)
-Cypress.Commands.add("saveCardConfirmCallTest", (saveCardConfirmBody, req_data, res_data,globalState) => {
- const paymentIntentID = globalState.get("paymentID");
- saveCardConfirmBody.card_cvc = req_data.card.card_cvc;
- saveCardConfirmBody.payment_token = globalState.get("paymentToken");
- saveCardConfirmBody.client_secret = globalState.get("clientSecret");
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/payments/${paymentIntentID}/confirm`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("publishableKey"),
- },
- failOnStatusCode: false,
- body: saveCardConfirmBody,
- })
- .then((response) => {
- logRequestId(response.headers['x-request-id']);
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payments`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ 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");
- globalState.set("paymentID", paymentIntentID);
- if(response.status === 200){
+
+ if (response.status === 200) {
if (response.body.capture_method === "automatic") {
+ expect(response.body).to.have.property("status");
+ globalState.set("paymentAmount", createConfirmPaymentBody.amount);
+ globalState.set("paymentID", response.body.payment_id);
if (response.body.authentication_type === "three_ds") {
- expect(response.body).to.have.property("next_action")
+ expect(response.body)
+ .to.have.property("next_action")
.to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- } else if (response.body.authentication_type === "no_three_ds") {
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url,
+ );
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
}
- expect(response.body.customer_id).to.equal(globalState.get("customerId"));
} else {
- // Handle other authentication types as needed
defaultErrorHandler(response, res_data);
}
} else if (response.body.capture_method === "manual") {
+ expect(response.body).to.have.property("status");
+ globalState.set("paymentAmount", createConfirmPaymentBody.amount);
+ globalState.set("paymentID", response.body.payment_id);
if (response.body.authentication_type === "three_ds") {
- expect(response.body).to.have.property("next_action")
- .to.have.property("redirect_to_url")
+ 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.authentication_type === "no_three_ds") {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, res_data);
}
- else if (response.body.authentication_type === "no_three_ds") {
- for(const key in res_data.body) {
+ }
+ } else {
+ defaultErrorHandler(response, res_data);
+ }
+ });
+ },
+);
+
+// This is consequent saved card payment confirm call test(Using payment token)
+Cypress.Commands.add(
+ "saveCardConfirmCallTest",
+ (saveCardConfirmBody, req_data, res_data, globalState) => {
+ const paymentIntentID = globalState.get("paymentID");
+ saveCardConfirmBody.card_cvc = req_data.card.card_cvc;
+ saveCardConfirmBody.payment_token = globalState.get("paymentToken");
+ saveCardConfirmBody.client_secret = globalState.get("clientSecret");
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payments/${paymentIntentID}/confirm`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("publishableKey"),
+ },
+ failOnStatusCode: false,
+ body: saveCardConfirmBody,
+ }).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 (response.body.capture_method === "automatic") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
}
- expect(response.body.customer_id).to.equal(globalState.get("customerId"));
+ expect(response.body.customer_id).to.equal(
+ globalState.get("customerId"),
+ );
+ } else {
+ // Handle other authentication types as needed
+ defaultErrorHandler(response, res_data);
+ }
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ expect(response.body.customer_id).to.equal(
+ globalState.get("customerId"),
+ );
} else {
// Handle other authentication types as needed
defaultErrorHandler(response, res_data);
}
}
- }
- else {
+ } else {
defaultErrorHandler(response, res_data);
}
});
-});
+ },
+);
-Cypress.Commands.add("captureCallTest", (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`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("apiKey"),
- },
- failOnStatusCode: false,
- body: requestBody,
- }).then((response) => {
- logRequestId(response.headers['x-request-id']);
+Cypress.Commands.add(
+ "captureCallTest",
+ (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`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ 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.body.capture_method !== undefined) {
- expect(response.body.payment_id).to.equal(payment_id);
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
+ 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);
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, res_data);
}
- }
- else{
- defaultErrorHandler(response, res_data);
- }
- });
-});
+ });
+ },
+);
-Cypress.Commands.add("voidCallTest", (requestBody, req_data, res_data, globalState) => {
- const payment_id = globalState.get("paymentID");
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/payments/${payment_id}/cancel`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("apiKey"),
- },
- failOnStatusCode: false,
- body: requestBody,
- }).then((response) => {
- logRequestId(response.headers['x-request-id']);
+Cypress.Commands.add(
+ "voidCallTest",
+ (requestBody, req_data, res_data, globalState) => {
+ const payment_id = globalState.get("paymentID");
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payments/${payment_id}/cancel`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ 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) {
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
+ expect(res_data.status).to.equal(response.status);
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, res_data);
}
- }
- else{
- defaultErrorHandler(response, res_data);
- }
- });
-});
+ });
+ },
+);
Cypress.Commands.add("retrievePaymentCallTest", (globalState) => {
const payment_id = globalState.get("paymentID");
@@ -592,7 +712,7 @@ Cypress.Commands.add("retrievePaymentCallTest", (globalState) => {
},
failOnStatusCode: false,
}).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ logRequestId(response.headers["x-request-id"]);
expect(response.headers["content-type"]).to.include("application/json");
expect(response.body.payment_id).to.equal(payment_id);
@@ -601,168 +721,189 @@ Cypress.Commands.add("retrievePaymentCallTest", (globalState) => {
});
});
-Cypress.Commands.add("refundCallTest", (requestBody, req_data, res_data, refund_amount, globalState) => {
- const payment_id = globalState.get("paymentID");
- requestBody.payment_id = payment_id;
- requestBody.amount = refund_amount;
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/refunds`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("apiKey"),
- },
- failOnStatusCode: false,
- 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) {
- globalState.set("refundId", response.body.refund_id);
- for(const key in res_data.body) {
+Cypress.Commands.add(
+ "refundCallTest",
+ (requestBody, req_data, res_data, refund_amount, globalState) => {
+ const payment_id = globalState.get("paymentID");
+ requestBody.payment_id = payment_id;
+ requestBody.amount = refund_amount;
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/refunds`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ 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) {
+ globalState.set("refundId", response.body.refund_id);
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ expect(response.body.payment_id).to.equal(payment_id);
+ } else {
+ defaultErrorHandler(response, res_data);
+ }
+ });
+ },
+);
+
+Cypress.Commands.add(
+ "syncRefundCallTest",
+ (req_data, res_data, globalState) => {
+ const refundId = globalState.get("refundId");
+ cy.request({
+ method: "GET",
+ url: `${globalState.get("baseUrl")}/refunds/${refundId}`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ 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]);
}
- expect(response.body.payment_id).to.equal(payment_id);
- }
- else{
- defaultErrorHandler(response, res_data);
- }
-
- });
-});
+ });
+ },
+);
-Cypress.Commands.add("syncRefundCallTest", (req_data, res_data, globalState) => {
- const refundId = globalState.get("refundId");
- cy.request({
- method: "GET",
- url: `${globalState.get("baseUrl")}/refunds/${refundId}`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("apiKey"),
- },
- 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]);
- }
- });
-});
+Cypress.Commands.add(
+ "citForMandatesCallTest",
+ (
+ requestBody,
+ req_data,
+ res_data,
+ amount,
+ confirm,
+ capture_method,
+ payment_type,
+ globalState,
+ ) => {
+ requestBody.payment_method_data.card = req_data.card;
+ requestBody.payment_type = payment_type;
+ requestBody.confirm = confirm;
+ requestBody.amount = amount;
+ requestBody.currency = req_data.currency;
+ requestBody.capture_method = capture_method;
+ requestBody.mandate_data.mandate_type = req_data.mandate_type;
+ requestBody.customer_id = globalState.get("customerId");
+ globalState.set("paymentAmount", requestBody.amount);
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payments`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ 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("mandateId", response.body.mandate_id);
+ globalState.set("paymentID", response.body.payment_id);
-Cypress.Commands.add("citForMandatesCallTest", (requestBody, req_data, res_data, amount, confirm, capture_method, payment_type, globalState) => {
- requestBody.payment_method_data.card = req_data.card;
- requestBody.payment_type = payment_type;
- requestBody.confirm = confirm;
- requestBody.amount = amount;
- requestBody.currency = req_data.currency;
- requestBody.capture_method = capture_method;
- requestBody.mandate_data.mandate_type = req_data.mandate_type;
- requestBody.customer_id = globalState.get("customerId");
- globalState.set("paymentAmount", requestBody.amount);
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/payments`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("apiKey"),
- },
- failOnStatusCode: false,
- 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("mandateId", response.body.mandate_id);
- globalState.set("paymentID", response.body.payment_id);
+ if (response.status === 200) {
+ if (response.body.capture_method === "automatic") {
+ expect(response.body).to.have.property("mandate_id");
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url,
+ );
+ cy.log(response.body);
+ cy.log(nextActionUrl);
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ }
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.capture_method === "manual") {
+ expect(response.body).to.have.property("mandate_id");
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body).to.have.property("next_action");
+ }
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ }
+ } else {
+ defaultErrorHandler(response, res_data);
+ }
+ });
+ },
+);
- if(response.status === 200) {
+Cypress.Commands.add(
+ "mitForMandatesCallTest",
+ (requestBody, amount, confirm, capture_method, globalState) => {
+ requestBody.amount = amount;
+ requestBody.confirm = confirm;
+ requestBody.capture_method = capture_method;
+ requestBody.mandate_id = globalState.get("mandateId");
+ requestBody.customer_id = globalState.get("customerId");
+ globalState.set("paymentAmount", requestBody.amount);
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payments`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ body: requestBody,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
+ expect(response.headers["content-type"]).to.include("application/json");
+ globalState.set("paymentID", response.body.payment_id);
if (response.body.capture_method === "automatic") {
- expect(response.body).to.have.property("mandate_id");
if (response.body.authentication_type === "three_ds") {
- expect(response.body).to.have.property("next_action")
+ expect(response.body)
+ .to.have.property("next_action")
.to.have.property("redirect_to_url");
const nextActionUrl = response.body.next_action.redirect_to_url;
- globalState.set("nextActionUrl", response.body.next_action.redirect_to_url);
cy.log(response.body);
cy.log(nextActionUrl);
} else if (response.body.authentication_type === "no_three_ds") {
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
- }
- }
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
+ expect(response.body.status).to.equal("succeeded");
+ } else {
+ defaultErrorHandler(response, res_data);
}
- }
- else if (response.body.capture_method === "manual") {
- expect(response.body).to.have.property("mandate_id");
+ } else if (response.body.capture_method === "manual") {
if (response.body.authentication_type === "three_ds") {
- expect(response.body).to.have.property("next_action")
- }
- for(const key in res_data.body) {
- expect(res_data.body[key]).to.equal(response.body[key]);
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ cy.log(response.body);
+ cy.log(nextActionUrl);
+ } else if (response.body.authentication_type === "no_three_ds") {
+ expect(response.body.status).to.equal("requires_capture");
+ } else {
+ defaultErrorHandler(response, res_data);
}
}
- }
- else{
- defaultErrorHandler(response, res_data);
- }
- });
-});
-
-Cypress.Commands.add("mitForMandatesCallTest", (requestBody, amount, confirm, capture_method, globalState) => {
- requestBody.amount = amount;
- requestBody.confirm = confirm;
- requestBody.capture_method = capture_method;
- requestBody.mandate_id = globalState.get("mandateId");
- requestBody.customer_id = globalState.get("customerId");
- globalState.set("paymentAmount", requestBody.amount);
- cy.request({
- method: "POST",
- url: `${globalState.get("baseUrl")}/payments`,
- headers: {
- "Content-Type": "application/json",
- "api-key": globalState.get("apiKey"),
- },
- failOnStatusCode: false,
- body: requestBody,
- }).then((response) => {
- logRequestId(response.headers['x-request-id']);
- expect(response.headers["content-type"]).to.include("application/json");
- globalState.set("paymentID", response.body.payment_id);
- if (response.body.capture_method === "automatic") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body).to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- cy.log(response.body);
- cy.log(nextActionUrl);
- } else if (response.body.authentication_type === "no_three_ds") {
- expect(response.body.status).to.equal("succeeded");
- } else {
- defaultErrorHandler(response, res_data);
- }
- }
- else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body).to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- cy.log(response.body);
- cy.log(nextActionUrl);
- } else if (response.body.authentication_type === "no_three_ds") {
- expect(response.body.status).to.equal("requires_capture");
- } else {
- defaultErrorHandler(response, res_data);
- }
- }
- });
-});
-
+ });
+ },
+);
Cypress.Commands.add("listMandateCallTest", (globalState) => {
const customerId = globalState.get("customerId");
@@ -774,7 +915,7 @@ Cypress.Commands.add("listMandateCallTest", (globalState) => {
"api-key": globalState.get("apiKey"),
},
}).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ logRequestId(response.headers["x-request-id"]);
expect(response.headers["content-type"]).to.include("application/json");
@@ -783,7 +924,7 @@ Cypress.Commands.add("listMandateCallTest", (globalState) => {
if (response.body[i].mandate_id === globalState.get("mandateId")) {
expect(response.body[i].status).to.equal("active");
}
- };
+ }
});
});
@@ -796,9 +937,9 @@ Cypress.Commands.add("revokeMandateCallTest", (globalState) => {
"Content-Type": "application/json",
"api-key": globalState.get("apiKey"),
},
- failOnStatusCode: false
+ failOnStatusCode: false,
}).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ logRequestId(response.headers["x-request-id"]);
expect(response.headers["content-type"]).to.include("application/json");
if (response.body.status === 200) {
@@ -809,17 +950,20 @@ Cypress.Commands.add("revokeMandateCallTest", (globalState) => {
});
});
-Cypress.Commands.add("handleRedirection", (globalState, expected_redirection) => {
- let connectorId = globalState.get("connectorId");
- let expected_url = new URL(expected_redirection);
- let redirection_url = new URL(globalState.get("nextActionUrl"));
- handleRedirection(
- "three_ds",
- { redirection_url, expected_url },
- connectorId,
- null
- );
-});
+Cypress.Commands.add(
+ "handleRedirection",
+ (globalState, expected_redirection) => {
+ let connectorId = globalState.get("connectorId");
+ let expected_url = new URL(expected_redirection);
+ let redirection_url = new URL(globalState.get("nextActionUrl"));
+ handleRedirection(
+ "three_ds",
+ { redirection_url, expected_url },
+ connectorId,
+ null,
+ );
+ },
+);
Cypress.Commands.add(
"handleBankRedirectRedirection",
@@ -834,10 +978,10 @@ Cypress.Commands.add(
"bank_redirect",
{ redirection_url, expected_url },
connectorId,
- payment_method_type
+ payment_method_type,
);
}
- }
+ },
);
Cypress.Commands.add(
@@ -850,9 +994,9 @@ Cypress.Commands.add(
"bank_transfer",
{ redirection_url, expected_redirection },
connectorId,
- payment_method_type
+ payment_method_type,
);
- }
+ },
);
Cypress.Commands.add("listCustomerPMCallTest", (globalState) => {
@@ -865,15 +1009,15 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState) => {
"api-key": globalState.get("apiKey"),
},
}).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ 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 = response.body.customer_payment_methods[0].payment_token;
+ const paymentToken =
+ response.body.customer_payment_methods[0].payment_token;
globalState.set("paymentToken", paymentToken); // Set paymentToken in globalState
expect(paymentToken).to.equal(globalState.get("paymentToken")); // Verify paymentToken
- }
- else {
+ } else {
defaultErrorHandler(response, res_data);
}
});
@@ -889,8 +1033,144 @@ Cypress.Commands.add("listRefundCallTest", (requestBody, globalState) => {
},
body: requestBody,
}).then((response) => {
- logRequestId(response.headers['x-request-id']);
+ logRequestId(response.headers["x-request-id"]);
expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.data).to.be.an('array').and.not.empty;
+ expect(response.body.data).to.be.an("array").and.not.empty;
+ });
+});
+
+Cypress.Commands.add(
+ "createConfirmPayoutTest",
+ (
+ createConfirmPayoutBody,
+ req_data,
+ res_data,
+ confirm,
+ auto_fulfill,
+ globalState,
+ ) => {
+ for (const key in req_data) {
+ createConfirmPayoutBody[key] = req_data[key];
+ }
+ createConfirmPayoutBody.auto_fulfill = auto_fulfill;
+ createConfirmPayoutBody.confirm = confirm;
+ createConfirmPayoutBody.customer_id = globalState.get("customerId");
+
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payouts/create`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ 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) {
+ globalState.set("payoutAmount", createConfirmPayoutBody.amount);
+ globalState.set("payoutID", response.body.payout_id);
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ expect(response.body).to.have.property("error");
+ for (const key in res_data.body.error) {
+ expect(res_data.body.error[key]).to.equal(response.body.error[key]);
+ }
+ }
+ });
+ },
+);
+
+Cypress.Commands.add(
+ "fulfillPayoutCallTest",
+ (payoutFulfillBody, req_data, res_data, globalState) => {
+ payoutFulfillBody.payout_id = globalState.get("payoutID");
+
+ cy.request({
+ method: "POST",
+ url: `${globalState.get("baseUrl")}/payouts/${globalState.get("payoutID")}/fulfill`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ 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) {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ expect(response.body).to.have.property("error");
+ for (const key in res_data.body.error) {
+ expect(res_data.body.error[key]).to.equal(response.body.error[key]);
+ }
+ }
+ });
+ },
+);
+
+Cypress.Commands.add(
+ "updatePayoutCallTest",
+ (payoutConfirmBody, req_data, res_data, auto_fulfill, globalState) => {
+ payoutConfirmBody.confirm = true;
+ payoutConfirmBody.auto_fulfill = auto_fulfill;
+
+ cy.request({
+ method: "PUT",
+ url: `${globalState.get("baseUrl")}/payouts/${globalState.get("payoutID")}`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ 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) {
+ for (const key in res_data.body) {
+ expect(res_data.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ expect(response.body).to.have.property("error");
+ for (const key in res_data.body.error) {
+ expect(res_data.body.error[key]).to.equal(response.body.error[key]);
+ }
+ }
});
+ },
+);
+
+Cypress.Commands.add("retrievePayoutCallTest", (globalState) => {
+ const payout_id = globalState.get("payoutID");
+ cy.request({
+ method: "GET",
+ url: `${globalState.get("baseUrl")}/payouts/${payout_id}`,
+ headers: {
+ "Content-Type": "application/json",
+ "api-key": globalState.get("apiKey"),
+ },
+ failOnStatusCode: false,
+ }).then((response) => {
+ logRequestId(response.headers["x-request-id"]);
+
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.payout_id).to.equal(payout_id);
+ expect(response.body.amount).to.equal(globalState.get("payoutAmount"));
});
+});
diff --git a/cypress-tests/cypress/support/e2e.js b/cypress-tests/cypress/support/e2e.js
index 9b1ef71ce0..3a25224388 100644
--- a/cypress-tests/cypress/support/e2e.js
+++ b/cypress-tests/cypress/support/e2e.js
@@ -14,7 +14,7 @@
// ***********************************************************
// Import commands.js using ES2015 syntax:
-import './commands';
+import "./commands";
// Alternatively you can use CommonJS syntax:
-// require('./commands')
\ No newline at end of file
+// require('./commands')
diff --git a/cypress-tests/cypress/support/redirectionhandler.js b/cypress-tests/cypress/support/redirectionhandler.js
index 6e48185815..f6b65d8251 100644
--- a/cypress-tests/cypress/support/redirectionhandler.js
+++ b/cypress-tests/cypress/support/redirectionhandler.js
@@ -4,7 +4,7 @@ export function handleRedirection(
redirection_type,
urls,
connectorId,
- payment_method_type
+ payment_method_type,
) {
switch (redirection_type) {
case "three_ds":
@@ -15,7 +15,7 @@ export function handleRedirection(
urls.redirection_url,
urls.expected_url,
connectorId,
- payment_method_type
+ payment_method_type,
);
break;
case "bank_transfer":
@@ -23,7 +23,7 @@ export function handleRedirection(
urls.redirection_url,
urls.expected_url,
connectorId,
- payment_method_type
+ payment_method_type,
);
break;
default:
@@ -35,7 +35,7 @@ function bankTransferRedirection(
redirection_url,
expected_url,
connectorId,
- payment_method_type
+ payment_method_type,
) {
cy.request(redirection_url.href).then((response) => {
switch (connectorId) {
@@ -119,7 +119,7 @@ function bankRedirectRedirection(
redirection_url,
expected_url,
connectorId,
- payment_method_type
+ payment_method_type,
) {
let verifyUrl = false;
cy.visit(redirection_url.href);
@@ -136,7 +136,7 @@ function bankRedirectRedirection(
case "ideal":
cy.get(":nth-child(4) > td > p").should(
"contain.text",
- "Your Payment was Authorised/Refused/Cancelled (It may take up to five minutes to show on the Payment List)"
+ "Your Payment was Authorised/Refused/Cancelled (It may take up to five minutes to show on the Payment List)",
);
cy.get(".btnLink").click();
cy.url().should("include", "status=succeeded");
@@ -144,12 +144,12 @@ function bankRedirectRedirection(
break;
case "giropay":
cy.get(
- ".rds-cookies-overlay__allow-all-cookies-btn > .rds-button"
+ ".rds-cookies-overlay__allow-all-cookies-btn > .rds-button",
).click();
cy.wait(5000);
cy.get(".normal-3").should(
"contain.text",
- "Bank suchen ‑ mit giropay zahlen."
+ "Bank suchen ‑ mit giropay zahlen.",
);
cy.get("#bankSearch").type("giropay TestBank{enter}");
cy.get(".normal-2 > div").click();
@@ -186,14 +186,14 @@ function bankRedirectRedirection(
.should("contain", "Continue")
.click();
}
- }
+ },
);
break;
case "trustly":
break;
default:
throw new Error(
- `Unsupported payment method type: ${payment_method_type}`
+ `Unsupported payment method type: ${payment_method_type}`,
);
}
verifyUrl = true;
@@ -203,16 +203,16 @@ function bankRedirectRedirection(
case "eps":
cy.get("._transactionId__header__iXVd_").should(
"contain.text",
- "Bank suchen ‑ mit eps zahlen."
+ "Bank suchen ‑ mit eps zahlen.",
);
cy.get(".BankSearch_searchInput__uX_9l").type(
- "Allgemeine Sparkasse Oberösterreich Bank AG{enter}"
+ "Allgemeine Sparkasse Oberösterreich Bank AG{enter}",
);
cy.get(".BankSearch_searchResultItem__lbcKm").click();
cy.get("._transactionId__primaryButton__nCa0r").click();
cy.get("#loginTitle").should(
"contain.text",
- "eps Online-Überweisung Login"
+ "eps Online-Überweisung Login",
);
cy.get("#user")
.should("be.visible")
@@ -224,7 +224,7 @@ function bankRedirectRedirection(
case "ideal":
cy.get("p").should(
"contain.text",
- "Choose your iDeal Issuer Bank please"
+ "Choose your iDeal Issuer Bank please",
);
cy.get("#issuerSearchInput").click();
cy.get("#issuerSearchInput").type("ING{enter}");
@@ -233,10 +233,10 @@ function bankRedirectRedirection(
case "giropay":
cy.get("._transactionId__header__iXVd_").should(
"contain.text",
- "Bank suchen ‑ mit giropay zahlen."
+ "Bank suchen ‑ mit giropay zahlen.",
);
cy.get(".BankSearch_searchInput__uX_9l").type(
- "Volksbank Hildesheim{enter}"
+ "Volksbank Hildesheim{enter}",
);
cy.get(".BankSearch_searchIcon__EcVO7").click();
cy.get(".BankSearch_bankWrapper__R5fUK").click();
@@ -249,7 +249,7 @@ function bankRedirectRedirection(
break;
default:
throw new Error(
- `Unsupported payment method type: ${payment_method_type}`
+ `Unsupported payment method type: ${payment_method_type}`,
);
}
verifyUrl = false;
@@ -273,7 +273,7 @@ function verifyReturnUrl(redirection_url, expected_url, forward_flow) {
{ args: { expected_url: expected_url.origin } },
({ expected_url }) => {
cy.window().its("location.origin").should("eq", expected_url);
- }
+ },
);
}
}
@@ -303,7 +303,7 @@ async function fetchAndParseQRCode(url) {
const qrCodeData = jsQR(
imageData.data,
imageData.width,
- imageData.height
+ imageData.height,
);
if (qrCodeData) {
diff --git a/cypress-tests/cypress/utils/State.js b/cypress-tests/cypress/utils/State.js
index dae4963000..b7b96dae5e 100644
--- a/cypress-tests/cypress/utils/State.js
+++ b/cypress-tests/cypress/utils/State.js
@@ -5,7 +5,9 @@ class State {
this.data["connectorId"] = Cypress.env("CONNECTOR");
this.data["baseUrl"] = Cypress.env("BASEURL");
this.data["adminApiKey"] = Cypress.env("ADMINAPIKEY");
- this.data["connectorAuthFilePath"] = Cypress.env("CONNECTOR_AUTH_FILE_PATH");
+ this.data["connectorAuthFilePath"] = Cypress.env(
+ "CONNECTOR_AUTH_FILE_PATH",
+ );
}
set(key, val) {
diff --git a/cypress-tests/package.json b/cypress-tests/package.json
index af4b0244fb..b6602ece45 100644
--- a/cypress-tests/package.json
+++ b/cypress-tests/package.json
@@ -6,7 +6,9 @@
"scripts": {
"cypress": "npx cypress open",
"cypress-e2e": "npx cypress run --e2e",
- "cypress:ci": "npx cypress run --headless"
+ "cypress:ci": "npx cypress run --headless",
+ "cypress:payments": "cypress run --spec 'cypress/e2e/PaymentTest/**/*'",
+ "cypress:payouts": "cypress run --spec 'cypress/e2e/PayoutTest/**/*'"
},
"author": "",
"license": "ISC",
diff --git a/cypress-tests/readme.md b/cypress-tests/readme.md
index 511625cdbf..78251ef9c8 100644
--- a/cypress-tests/readme.md
+++ b/cypress-tests/readme.md
@@ -141,7 +141,7 @@ Cypress.Commands.add("listMandateCallTest", (globalState) => {
} else {
cy.task(
"cli_log",
- "x-request-id is not available in the response headers"
+ "x-request-id is not available in the response headers",
);
}
expect(response.headers["content-type"]).to.include("application/json");