Skip to content

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

test(cypress): add processing_method_id coverage for Payload (#13964)

venkatakarthikm-maker978dc6199eeb
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Payload.js b/cypress-tests/cypress/e2e/configs/Payment/Payload.js
index df25902e1b..456bb9144f 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Payload.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Payload.js
@@ -140,6 +140,45 @@ export const connectorDetails = {
},
},
},
+ PaymentIntentWithProcessingMethodId: {
+ Request: {
+ currency: "USD",
+ metadata: {
+ processing_method_id: "pm_3fNsdcDR2fSf0PpqzXgwR",
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ metadata: {
+ processing_method_id: "pm_3fNsdcDR2fSf0PpqzXgwR",
+ },
+ },
+ },
+ },
+ PaymentConfirmWithProcessingMethodId: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ metadata: {
+ processing_method_id: "pm_3fNsdcDR2fSf0PpqzXgwR",
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ metadata: {
+ processing_method_id: "pm_3fNsdcDR2fSf0PpqzXgwR",
+ },
+ },
+ },
+ },
"3DSManualCapture": {
Configs: {
TRIGGER_SKIP: true,
@@ -575,6 +614,34 @@ export const connectorDetails = {
},
},
},
+ MandateSingleUseNo3DSAutoCaptureWithProcessingMethodId: {
+ Configs: {
+ DELAY: {
+ STATUS: true,
+ TIMEOUT: DUPLICATION_TIMEOUT,
+ },
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ metadata: {
+ processing_method_id: "pm_3fNsdcDR2fSf0PpqzXgwR",
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ metadata: {
+ processing_method_id: "pm_3fNsdcDR2fSf0PpqzXgwR",
+ },
+ },
+ },
+ },
MandateSingleUseNo3DSManualCapture: {
Configs: {
DELAY: {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 711a46a70e..fc828d70fc 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -589,6 +589,7 @@ export const CONNECTOR_LISTS = {
INCLUDE: {
// Tracking extension to other connectors: #13520
SPLIT_PAYMENTS: ["stripeconnect", "payloadconnect"],
+ PROCESSING_METHOD_ID: ["payload"],
MANDATES_USING_NTID_PROXY: ["cybersource", "checkout"],
// Card and mandate flows of 54-TsysTransitMandates. The mandates need a
// profile with connector agnostic MIT enabled, which keeps them out of the
diff --git a/cypress-tests/cypress/e2e/spec/Payment/54-ProcessingMethodId.cy.js b/cypress-tests/cypress/e2e/spec/Payment/54-ProcessingMethodId.cy.js
new file mode 100644
index 0000000000..7c5584cfa1
--- /dev/null
+++ b/cypress-tests/cypress/e2e/spec/Payment/54-ProcessingMethodId.cy.js
@@ -0,0 +1,142 @@
+import * as fixtures from "../../../fixtures/imports";
+import State from "../../../utils/State";
+import getConnectorDetails, {
+ CONNECTOR_LISTS,
+ shouldIncludeConnector,
+} from "../../configs/Payment/Utils";
+import * as utils from "../../configs/Payment/Utils";
+
+let globalState;
+
+describe("Card - Processing Method ID payment flow test", () => {
+ before("seed global state", function () {
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+ const connector = globalState.get("connectorId");
+
+ if (
+ shouldIncludeConnector(
+ connector,
+ CONNECTOR_LISTS.INCLUDE.PROCESSING_METHOD_ID
+ )
+ ) {
+ skip = true;
+ return;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
+ });
+
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context("Card-NoThreeDS payment with metadata.processing_method_id", () => {
+ it("Create Payment Intent -> Payment Methods -> Confirm Payment -> Retrieve Payment", () => {
+ let shouldContinue = true;
+
+ cy.step(
+ "Create Payment Intent with processing_method_id metadata",
+ () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentIntentWithProcessingMethodId"];
+
+ cy.createPaymentIntentTest(
+ fixtures.createPaymentBody,
+ data,
+ "no_three_ds",
+ "automatic",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ }
+ );
+
+ cy.step("Payment Methods Call", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Payment Methods Call");
+ return;
+ }
+ cy.paymentMethodsCallTest(globalState);
+ });
+
+ cy.step("Confirm Payment with processing_method_id metadata", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Confirm Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentConfirmWithProcessingMethodId"];
+
+ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ cy.step("Retrieve Payment with processing_method_id metadata", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["PaymentConfirmWithProcessingMethodId"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+ });
+ });
+
+ context(
+ "Card - Mandate CIT payment with metadata.processing_method_id",
+ () => {
+ let shouldContinue = true;
+
+ it("Confirm No 3DS CIT with processing_method_id metadata", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateSingleUseNo3DSAutoCaptureWithProcessingMethodId"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState
+ );
+
+ if (!utils.should_continue_further(data)) {
+ shouldContinue = false;
+ }
+ });
+
+ it("Retrieve Payment with processing_method_id metadata", () => {
+ if (!shouldContinue) {
+ cy.task("cli_log", "Skipping step: Retrieve Payment");
+ return;
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateSingleUseNo3DSAutoCaptureWithProcessingMethodId"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+ }
+ );
+});