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
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
test(cypress): Add ConnectorTestingData test for Adyen holder_name (#11933)
likhinbopanna1cbcf9fabc10
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Adyen.js b/cypress-tests/cypress/e2e/configs/Payment/Adyen.jsindex fad8baea00..a7340c4da2 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Adyen.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Adyen.js@@ -918,6 +918,53 @@ export const connectorDetails = {},},},+ ConnectorTestingData: {+ Request: {+ currency: "USD",+ connector_metadata: {+ adyen: {+ testing: {+ holder_name: "Test Holder Name Override",+ },+ },+ },+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ },+ ConnectorTestingDataConfirm: {+ Request: {+ payment_method: "card",+ payment_method_data: {+ card: {+ card_number: "4111111111111111",+ card_exp_month: "12",+ card_exp_year: "2030",+ card_cvc: "123",+ card_holder_name: "Original Card Holder",+ },+ },+ connector_metadata: {+ adyen: {+ testing: {+ holder_name: "Test Holder Name Override",+ },+ },+ },+ customer_acceptance: null,+ setup_future_usage: "on_session",+ },+ Response: {+ status: 200,+ body: {+ status: "failed",+ },+ },+ },},bank_transfer_pm: {Pix: {diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex 6751de1b85..b0c0adb014 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -458,6 +458,7 @@ export const CONNECTOR_LISTS = {// "stripe",],DDC_RACE_CONDITION: ["worldpay"],+ CONNECTOR_TESTING_DATA: ["adyen"],// ucs connectorsUCS_CONNECTORS: ["authorizedotnet"],OVERCAPTURE: ["adyen"],diff --git a/cypress-tests/cypress/e2e/spec/Payment/43-ExternalThreeDS.cy.js b/cypress-tests/cypress/e2e/spec/Payment/44-ExternalThreeDS.cy.jssimilarity index 100%rename from cypress-tests/cypress/e2e/spec/Payment/43-ExternalThreeDS.cy.jsrename to cypress-tests/cypress/e2e/spec/Payment/44-ExternalThreeDS.cy.jsdiff --git a/cypress-tests/cypress/e2e/spec/Payment/44-BankDebit.cy.js b/cypress-tests/cypress/e2e/spec/Payment/45-BankDebit.cy.jssimilarity index 100%rename from cypress-tests/cypress/e2e/spec/Payment/44-BankDebit.cy.jsrename to cypress-tests/cypress/e2e/spec/Payment/45-BankDebit.cy.jsdiff --git a/cypress-tests/cypress/e2e/spec/Payment/46-ConnectorTestingData.cy.js b/cypress-tests/cypress/e2e/spec/Payment/46-ConnectorTestingData.cy.jsnew file mode 100644index 0000000000..19463eadb7--- /dev/null+++ b/cypress-tests/cypress/e2e/spec/Payment/46-ConnectorTestingData.cy.js@@ -0,0 +1,109 @@+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;+let connector;++describe("Card - Connector Testing Data flow test", () => {+ before("seed global state", function () {+ let skip = false;++ cy.task("getGlobalState")+ .then((state) => {+ globalState = new State(state);+ connector = globalState.get("connectorId");++ if (+ shouldIncludeConnector(+ connector,+ CONNECTOR_LISTS.INCLUDE.CONNECTOR_TESTING_DATA+ )+ ) {+ skip = true;+ return;+ }+ })+ .then(() => {+ if (skip) {+ this.skip();+ }+ });+ });++ after("flush global state", () => {+ cy.task("setGlobalState", globalState.data);+ });++ context("Card-ConnectorTestingData payment flow test Create+Confirm", () => {+ it("Create Payment Intent with connector testing data -> Payment Methods Call -> Confirm Payment with connector testing data -> Retrieve Payment", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent with connector testing data", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ConnectorTestingData"];++ 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 connector testing data", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Confirm Payment with connector testing data"+ );+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ConnectorTestingDataConfirm"];++ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );++ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Payment", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Retrieve Payment");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ConnectorTestingDataConfirm"];++ cy.retrievePaymentCallTest({ globalState, data: confirmData });+ });+ });+ });+});diff --git a/cypress-tests/cypress/e2e/spec/Payment/44-DynamicFields.cy.js b/cypress-tests/cypress/e2e/spec/Payment/47-DynamicFields.cy.jssimilarity index 100%rename from cypress-tests/cypress/e2e/spec/Payment/44-DynamicFields.cy.jsrename to cypress-tests/cypress/e2e/spec/Payment/47-DynamicFields.cy.jsdiff --git a/cypress-tests/cypress/e2e/spec/Payment/45-PaymentWebhook.cy.js b/cypress-tests/cypress/e2e/spec/Payment/48-PaymentWebhook.cy.jssimilarity index 100%rename from cypress-tests/cypress/e2e/spec/Payment/45-PaymentWebhook.cy.jsrename to cypress-tests/cypress/e2e/spec/Payment/48-PaymentWebhook.cy.jsdiff --git a/cypress-tests/cypress/e2e/spec/Payment/46-RefundWebhook.cy.js b/cypress-tests/cypress/e2e/spec/Payment/49-RefundWebhook.cy.jssimilarity index 100%rename from cypress-tests/cypress/e2e/spec/Payment/46-RefundWebhook.cy.jsrename to cypress-tests/cypress/e2e/spec/Payment/49-RefundWebhook.cy.js