Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

ci(cypress): Add Payment Method Id mandate flows (#5035)

likhinbopanna61571625dccf
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js
new file mode 100644
index 0000000000..affef3d148
--- /dev/null
+++ b/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js
@@ -0,0 +1,341 @@
+import captureBody from "../../fixtures/capture-flow-body.json";
+import citConfirmBody from "../../fixtures/create-mandate-cit.json";
+import createPaymentBody from "../../fixtures/create-payment-body";
+import pmIdConfirmBody from "../../fixtures/create-pm-id-mit.json";
+import State from "../../utils/State";
+import getConnectorDetails, * as utils from "../PaymentUtils/utils";
+
+let globalState;
+
+describe("Card - Mandates using Payment Method Id flow test", () => {
+ let should_continue = true; // variable that will be used to skip tests if a previous test fails
+
+ before("seed global state", () => {
+ cy.task("getGlobalState").then((state) => {
+ globalState = new State(state);
+ });
+ });
+
+ beforeEach(function () {
+ if (!should_continue) {
+ this.skip();
+ }
+ });
+
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context(
+ "Card - NoThreeDS Create and Confirm Automatic CIT and MIT payment flow test",
+ () => {
+ let should_continue = true;
+ it("Create No 3DS Payment Intent", () => {
+ 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 No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSAutoCapture"];
+ 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.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ });
+ }
+ );
+
+ context(
+ "Card - NoThreeDS Create and Confirm Manual CIT and MIT payment flow test",
+ () => {
+ let should_continue = true;
+
+ it("Create No 3DS Payment Intent", () => {
+ 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 No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSManualCapture"];
+ 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.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ });
+ }
+ );
+
+ context(
+ "Card - NoThreeDS Create + Confirm Automatic CIT and MIT payment flow test",
+ () => {
+ let should_continue = true;
+
+ it("Confirm No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSAutoCapture"];
+ 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.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ });
+ it("Confirm No 3DS MIT", () => {
+ cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ });
+ }
+ );
+
+ context(
+ "Card - NoThreeDS Create + Confirm Manual CIT and MIT payment flow test",
+ () => {
+ let should_continue = true;
+
+ it("Confirm No 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandateNo3DSManualCapture"];
+ 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.mitUsingPMId(pmIdConfirmBody, 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.mitUsingPMId(pmIdConfirmBody, 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 Automatic CIT and MIT payment flow test",
+ () => {
+ let should_continue = true;
+
+ it("Confirm 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandate3DSAutoCapture"];
+ 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("Handle redirection", () => {
+ let expected_redirection = citConfirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ });
+ it("Confirm No 3DS MIT", () => {
+ cy.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ });
+ }
+ );
+
+ context(
+ "Card - ThreeDS Create + Confirm Manual CIT and MIT payment flow",
+ () => {
+ let should_continue = true;
+
+ it("Confirm 3DS CIT", () => {
+ console.log("confirm -> " + globalState.get("connectorId"));
+ let data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentMethodIdMandate3DSManualCapture"];
+ let req_data = data["Request"];
+ let res_data = data["Response"];
+
+ 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("Handle redirection", () => {
+ let expected_redirection = citConfirmBody["return_url"];
+ cy.handleRedirection(globalState, expected_redirection);
+ });
+
+ 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.mitUsingPMId(pmIdConfirmBody, 7000, true, "automatic", globalState);
+ });
+ }
+ );
+});
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
index 8b61c819cb..2a6d0fac7b 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Adyen.js
@@ -16,6 +16,40 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "737",
};
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -165,14 +199,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -183,14 +214,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -201,14 +229,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -219,32 +244,26 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
body: {
- status: "processing",
+ status: "requires_capture",
},
},
},
MandateMultiUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -255,14 +274,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -273,14 +289,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -291,14 +304,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -309,14 +319,11 @@ export const connectorDetails = {
},
ZeroAuthMandate: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 200,
@@ -367,6 +374,99 @@ export const connectorDetails = {
},
},
},
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
},
bank_transfer_pm: {
PaymentIntent: {
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js b/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js
index a34190c209..596b520343 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/BankOfAmerica.js
@@ -13,6 +13,41 @@ const successfulThreeDSTestCardDetails = {
card_holder_name: "joseph Doe",
card_cvc: "123",
};
+
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -163,15 +198,12 @@ export const connectorDetails = {
},
MandateSingleUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ mandate_data: singleUseMandateData
},
- },
Response: {
status: 200,
body: {
@@ -181,14 +213,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 200,
@@ -199,14 +228,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 200,
@@ -217,14 +243,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 200,
@@ -235,14 +258,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData
},
Response: {
status: 200,
@@ -253,14 +273,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData
},
Response: {
status: 200,
@@ -271,14 +288,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData
},
Response: {
status: 200,
@@ -289,14 +303,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData
},
Response: {
status: 200,
@@ -307,14 +318,11 @@ export const connectorDetails = {
},
ZeroAuthMandate: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 200,
@@ -365,5 +373,98 @@ export const connectorDetails = {
},
},
},
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
},
};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js b/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
index 0969e4088d..19fcb6e1f0 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Bluesnap.js
@@ -14,6 +14,40 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "737",
};
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -164,14 +198,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -187,14 +218,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -210,14 +238,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -233,14 +258,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -256,14 +278,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -279,14 +298,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -302,14 +318,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -325,14 +338,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -348,14 +358,11 @@ export const connectorDetails = {
},
ZeroAuthMandate: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 501,
@@ -410,5 +417,118 @@ export const connectorDetails = {
},
},
},
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by bluesnap",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by bluesnap",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by bluesnap",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by bluesnap",
+ },
+ },
+ },
+ },
},
};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
index 63ab38f5b8..31d779106f 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Commons.js
@@ -512,6 +512,75 @@ export const connectorDetails = {
},
},
}),
+ PaymentMethodIdMandateNo3DSAutoCapture: getCustomExchange({
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ }),
+ PaymentMethodIdMandateNo3DSManualCapture: getCustomExchange({
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ }),
+ PaymentMethodIdMandate3DSAutoCapture: getCustomExchange({
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ }),
+ PaymentMethodIdMandate3DSManualCapture: getCustomExchange({
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ }),
},
bank_transfer_pm: {
PaymentIntent: getCustomExchange({
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js
index d4818ce294..0ed998e74e 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Cybersource.js
@@ -14,6 +14,40 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "123",
};
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -164,15 +198,12 @@ export const connectorDetails = {
},
MandateSingleUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ mandate_data: singleUseMandateData,
},
- },
Response: {
status: 200,
body: {
@@ -182,14 +213,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -200,14 +228,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -218,14 +243,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -236,14 +258,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -254,14 +273,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -272,14 +288,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -290,14 +303,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -308,14 +318,11 @@ export const connectorDetails = {
},
ZeroAuthMandate: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 200,
@@ -366,5 +373,98 @@ export const connectorDetails = {
},
},
},
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
},
};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js b/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js
index c420bb8844..f637def7fe 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Nmi.js
@@ -14,6 +14,40 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "999",
};
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -167,14 +201,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -190,14 +221,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -213,14 +241,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -236,14 +261,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -259,14 +281,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -282,14 +301,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -305,14 +321,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -328,14 +341,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -351,14 +361,11 @@ export const connectorDetails = {
},
ZeroAuthMandate: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 501,
@@ -413,5 +420,118 @@ export const connectorDetails = {
},
},
},
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by nmi",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by nmi",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by nmi",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by nmi",
+ },
+ },
+ },
+ },
},
};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js b/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
index 69c39f0dc8..a34d90cfb8 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js
@@ -14,6 +14,40 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "123",
};
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -179,14 +213,10 @@ export const connectorDetails = {
},
MandateSingleUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ mandate_data:singleUseMandateData,
},
Response: {
status: 400,
@@ -202,14 +232,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data:singleUseMandateData,
},
Response: {
status: 400,
@@ -225,14 +252,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data:singleUseMandateData,
},
Response: {
status: 400,
@@ -248,14 +272,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data:singleUseMandateData,
},
Response: {
status: 400,
@@ -271,14 +292,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -294,14 +312,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -317,14 +332,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -340,14 +352,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -363,14 +372,11 @@ export const connectorDetails = {
},
ZeroAuthMandate: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 501,
@@ -425,5 +431,118 @@ export const connectorDetails = {
},
},
},
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by paypal",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by paypal",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by paypal",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by paypal",
+ },
+ },
+ },
+ },
},
};
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
index 72495bf40f..6283da1f94 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Stripe.js
@@ -1,7 +1,7 @@
import { getCustomExchange } from "./Commons";
const successfulTestCard = "4242424242424242";
-const successful3DSCard = "4000002760003184";
+const successful3DSCard = "4000002500003155";
const successfulNo3DSCardDetails = {
card_number: "4242424242424242",
@@ -12,13 +12,47 @@ const successfulNo3DSCardDetails = {
};
const successfulThreeDSTestCardDetails = {
- card_number: "4000002760003184",
+ card_number: "4000002500003155",
card_exp_month: "10",
card_exp_year: "25",
card_holder_name: "morino",
card_cvc: "737",
};
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: {
@@ -169,14 +203,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -187,14 +218,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -205,14 +233,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -223,14 +248,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 200,
@@ -241,14 +263,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -259,14 +278,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -277,14 +293,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -295,14 +308,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -313,14 +323,11 @@ export const connectorDetails = {
},
ZeroAuthMandate: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData
},
Response: {
status: 200,
@@ -371,6 +378,99 @@ export const connectorDetails = {
},
},
},
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
},
bank_redirect_pm: {
PaymentIntent: getCustomExchange({
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
index 742f96f37a..cb787ffab4 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js
@@ -16,6 +16,40 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "737",
};
+const singleUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
+const multiUseMandateData = {
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "USD",
+ },
+ },
+};
+
export const connectorDetails = {
card_pm: {
PaymentIntent: getCustomExchange({
@@ -189,14 +223,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -211,14 +242,11 @@ export const connectorDetails = {
},
MandateSingleUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -233,14 +261,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -255,14 +280,11 @@ export const connectorDetails = {
},
MandateSingleUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: singleUseMandateData,
},
Response: {
status: 400,
@@ -277,14 +299,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSAutoCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -299,14 +318,11 @@ export const connectorDetails = {
},
MandateMultiUseNo3DSManualCapture: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -321,14 +337,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSAutoCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 200,
@@ -339,14 +352,11 @@ export const connectorDetails = {
},
MandateMultiUse3DSManualCapture: {
Request: {
- card: successfulThreeDSTestCardDetails,
- currency: "USD",
- mandate_type: {
- multi_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 400,
@@ -361,14 +371,11 @@ export const connectorDetails = {
},
ZeroAuthMandate: {
Request: {
- card: successfulNo3DSCardDetails,
- currency: "USD",
- mandate_type: {
- single_use: {
- amount: 8000,
- currency: "USD",
- },
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
},
+ currency: "USD",
+ mandate_data: multiUseMandateData,
},
Response: {
status: 501,
@@ -427,6 +434,119 @@ export const connectorDetails = {
},
},
},
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by trustpay",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by trustpay",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by trustpay",
+ },
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: {
+ acceptance_type: "offline",
+ accepted_at: "1963-05-03T04:07:52.723Z",
+ online: {
+ ip_address: "125.0.0.1",
+ user_agent: "amet irure esse",
+ },
+ },
+ },
+ Response: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message: "Payment method type not supported",
+ code: "HE_03",
+ reason: "debit mandate payment is not supported by trustpay",
+ },
+ },
+ },
+ },
},
bank_redirect_pm: {
PaymentIntent: getCustomExchange({
diff --git a/cypress-tests/cypress/fixtures/create-pm-id-mit.json b/cypress-tests/cypress/fixtures/create-pm-id-mit.json
new file mode 100644
index 0000000000..0a8111234d
--- /dev/null
+++ b/cypress-tests/cypress/fixtures/create-pm-id-mit.json
@@ -0,0 +1,41 @@
+{
+ "amount": 999,
+ "currency": "USD",
+ "confirm": true,
+ "customer_id": "customer098765",
+ "return_url": "https://hyperswitch.io",
+ "recurring_details": {
+ "type": "payment_method_id",
+ "data": "{{payment_method_id}}"
+ },
+ "off_session": true,
+ "billing": {
+ "address": {
+ "first_name": "John",
+ "last_name": "Doe",
+ "line1": "1467",
+ "line2": "Harrison Street",
+ "line3": "Harrison Street",
+ "city": "San Fransico",
+ "state": "California",
+ "zip": "94122",
+ "country": "US"
+ },
+ "phone": {
+ "number": "8056594427",
+ "country_code": "+91"
+ }
+ },
+ "browser_info": {
+ "ip_address": "129.0.0.1",
+ "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
+ "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
+ "language": "en-US",
+ "color_depth": 30,
+ "screen_height": 1117,
+ "screen_width": 1728,
+ "time_zone": -330,
+ "java_enabled": true,
+ "java_script_enabled": true
+ }
+}
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index c886ebe832..dbad47ab2c 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -841,13 +841,13 @@ Cypress.Commands.add(
payment_type,
globalState
) => {
- requestBody.payment_method_data.card = req_data.card;
+ for (const key in req_data) {
+ requestBody[key] = req_data[key];
+ }
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({
@@ -863,10 +863,17 @@ Cypress.Commands.add(
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) {
+ globalState.set("paymentID", response.body.payment_id);
+ if (requestBody.mandate_data === null) {
+ expect(response.body).to.have.property("payment_method_id");
+ globalState.set("paymentMethodId", response.body.payment_method_id);
+ } else {
+ expect(response.body).to.have.property("mandate_id");
+ globalState.set("mandateId", response.body.mandate_id);
+ }
if (response.body.capture_method === "automatic") {
expect(response.body).to.have.property("mandate_id");
if (response.body.authentication_type === "three_ds") {
@@ -889,9 +896,13 @@ Cypress.Commands.add(
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");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
+ );
}
for (const key in res_data.body) {
expect(res_data.body[key]).to.equal(response.body[key]);
@@ -957,6 +968,58 @@ Cypress.Commands.add(
}
);
+Cypress.Commands.add(
+ "mitUsingPMId",
+ (requestBody, amount, confirm, capture_method, globalState) => {
+ requestBody.amount = amount;
+ requestBody.confirm = confirm;
+ requestBody.capture_method = capture_method;
+ requestBody.recurring_details.data = globalState.get("paymentMethodId");
+ requestBody.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: 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");
cy.request({