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): billing descriptor testcases for adyen (#11853)
HS-QUALIBOT0f5eeea0b10e
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Adyen.js b/cypress-tests/cypress/e2e/configs/Payment/Adyen.jsindex 9f3853d77e..6a70e332a9 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Adyen.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Adyen.js@@ -1,4 +1,4 @@-import { customerAcceptance } from "./Commons";+import { customerAcceptance, multiUseMandateData } from "./Commons";import { getCustomExchange } from "./Modifiers";const successfulNo3DSCardDetails = {@@ -35,16 +35,6 @@ const singleUseMandateData = {},};-const multiUseMandateData = {- customer_acceptance: customerAcceptance,- mandate_type: {- multi_use: {- amount: 8000,- currency: "USD",- },- },-};-export const connectorDetails = {card_pm: {PaymentIntent: {@@ -821,6 +811,49 @@ export const connectorDetails = {},},},+ PaymentIntentWithBillingDescriptor: {+ Request: {+ currency: "USD",+ billing_descriptor: {+ name: "Juspay",+ city: "San Francisco",+ phone: "8056594427",+ statement_descriptor: "QA-BillingDesc",+ statement_descriptor_suffix: "SUFFIX1",+ reference: "ref-qa-001",+ },+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ },+ PaymentConfirmWithBillingDescriptor: {+ Request: {+ payment_method: "card",+ payment_method_data: {+ card: successfulNo3DSCardDetails,+ },+ customer_acceptance: null,+ setup_future_usage: "on_session",+ },+ Response: {+ status: 200,+ body: {+ status: "succeeded",+ billing_descriptor: {+ name: "Juspay",+ city: "San Francisco",+ phone: "8056594427",+ statement_descriptor: "QA-BillingDesc",+ statement_descriptor_suffix: "SUFFIX1",+ reference: "ref-qa-001",+ },+ },+ },+ },},bank_transfer_pm: {Pix: {diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex 2d5b1c6d32..c095197247 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -508,6 +508,7 @@ export const CONNECTOR_LISTS = {"stripe",],CARD_INSTALLMENTS: ["adyen"],+ BILLING_DESCRIPTOR: ["adyen"],AUTO_RETRY: ["cybersource","checkout",diff --git a/cypress-tests/cypress/e2e/spec/Payment/43-BillingDescriptor.cy.js b/cypress-tests/cypress/e2e/spec/Payment/43-BillingDescriptor.cy.jsnew file mode 100644index 0000000000..d1e50177bb--- /dev/null+++ b/cypress-tests/cypress/e2e/spec/Payment/43-BillingDescriptor.cy.js@@ -0,0 +1,105 @@+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 - Billing Descriptor payment 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.BILLING_DESCRIPTOR+ )+ ) {+ skip = true;+ return;+ }+ })+ .then(() => {+ if (skip) {+ this.skip();+ }+ });+ });++ afterEach("flush global state", () => {+ cy.task("setGlobalState", globalState.data);+ });++ context("Card-NoThreeDS payment with billing descriptor", () => {+ let shouldContinue = true;++ it("Create Payment Intent with billing descriptor", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntentWithBillingDescriptor"];++ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );++ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ it("Payment Methods Call", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Payment Methods Call");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ it("Confirm Payment with billing descriptor", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Confirm Payment with billing descriptor"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentConfirmWithBillingDescriptor"];++ cy.confirmCallTest(fixtures.confirmBody, data, true, globalState);++ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ it("Retrieve Payment with billing descriptor", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Retrieve Payment with billing descriptor"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentConfirmWithBillingDescriptor"];++ cy.retrievePaymentCallTest({ globalState, data });+ });+ });+});diff --git a/cypress-tests/cypress/e2e/spec/Payment/43-DynamicFields.cy.js b/cypress-tests/cypress/e2e/spec/Payment/44-DynamicFields.cy.jssimilarity index 100%rename from cypress-tests/cypress/e2e/spec/Payment/43-DynamicFields.cy.jsrename to cypress-tests/cypress/e2e/spec/Payment/44-DynamicFields.cy.jsdiff --git a/cypress-tests/cypress/e2e/spec/Payment/44-PaymentWebhook.cy.js b/cypress-tests/cypress/e2e/spec/Payment/45-PaymentWebhook.cy.jssimilarity index 100%rename from cypress-tests/cypress/e2e/spec/Payment/44-PaymentWebhook.cy.jsrename to cypress-tests/cypress/e2e/spec/Payment/45-PaymentWebhook.cy.jsdiff --git a/cypress-tests/cypress/e2e/spec/Payment/45-RefundWebhook.cy.js b/cypress-tests/cypress/e2e/spec/Payment/46-RefundWebhook.cy.jssimilarity index 100%rename from cypress-tests/cypress/e2e/spec/Payment/45-RefundWebhook.cy.jsrename to cypress-tests/cypress/e2e/spec/Payment/46-RefundWebhook.cy.js