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
ci(cypress): Fix payment method id for non supported connectors (#5075)
likhinbopanna960046191687
diff --git a/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js b/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.jsindex affef3d148..6eea1bd682 100644--- a/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js+++ b/cypress-tests/cypress/e2e/PaymentTest/00018-MandatesUsingPMID.cy.js@@ -16,10 +16,8 @@ describe("Card - Mandates using Payment Method Id flow test", () => {});});- beforeEach(function () {- if (!should_continue) {- this.skip();- }+ after("flush global state", () => {+ cy.task("setGlobalState", globalState.data);});afterEach("flush global state", () => {@@ -30,6 +28,13 @@ describe("Card - Mandates using Payment Method Id flow test", () => {"Card - NoThreeDS Create and Confirm Automatic CIT and MIT payment flow test",() => {let should_continue = true;++ beforeEach(function () {+ if (!should_continue) {+ this.skip();+ }+ });+it("Create No 3DS Payment Intent", () => {let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"@@ -81,6 +86,12 @@ describe("Card - Mandates using Payment Method Id flow test", () => {() => {let should_continue = true;+ beforeEach(function () {+ if (!should_continue) {+ this.skip();+ }+ });+it("Create No 3DS Payment Intent", () => {let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"@@ -144,6 +155,12 @@ describe("Card - Mandates using Payment Method Id flow test", () => {() => {let should_continue = true;+ beforeEach(function () {+ if (!should_continue) {+ this.skip();+ }+ });+it("Confirm No 3DS CIT", () => {console.log("confirm -> " + globalState.get("connectorId"));let data = getConnectorDetails(globalState.get("connectorId"))[@@ -180,6 +197,12 @@ describe("Card - Mandates using Payment Method Id flow test", () => {() => {let should_continue = true;+ beforeEach(function () {+ if (!should_continue) {+ this.skip();+ }+ });+it("Confirm No 3DS CIT", () => {console.log("confirm -> " + globalState.get("connectorId"));let data = getConnectorDetails(globalState.get("connectorId"))[@@ -253,6 +276,12 @@ describe("Card - Mandates using Payment Method Id flow test", () => {() => {let should_continue = true;+ beforeEach(function () {+ if (!should_continue) {+ this.skip();+ }+ });+it("Confirm 3DS CIT", () => {console.log("confirm -> " + globalState.get("connectorId"));let data = getConnectorDetails(globalState.get("connectorId"))[@@ -294,6 +323,12 @@ describe("Card - Mandates using Payment Method Id flow test", () => {() => {let should_continue = true;+ beforeEach(function () {+ if (!should_continue) {+ this.skip();+ }+ });+it("Confirm 3DS CIT", () => {console.log("confirm -> " + globalState.get("connectorId"));let data = getConnectorDetails(globalState.get("connectorId"))[diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js b/cypress-tests/cypress/e2e/PaymentUtils/Paypal.jsindex a34d90cfb8..525bb17997 100644--- a/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js+++ b/cypress-tests/cypress/e2e/PaymentUtils/Paypal.js@@ -1,3 +1,5 @@+import { getCustomExchange } from "./Commons";+const successfulNo3DSCardDetails = {card_number: "4012000033330026",card_exp_month: "01",@@ -232,7 +234,7 @@ export const connectorDetails = {},MandateSingleUse3DSManualCapture: {Request: {- payment_method_data: {+ payment_method_data: {card: successfulThreeDSTestCardDetails,},currency: "USD",@@ -336,7 +338,7 @@ export const connectorDetails = {card: successfulThreeDSTestCardDetails,},currency: "USD",- mandate_data: multiUseMandateData,+ mandate_data: multiUseMandateData,},Response: {status: 400,@@ -545,4 +547,164 @@ export const connectorDetails = {},},},+ bank_redirect_pm: {+ PaymentIntent: getCustomExchange({+ Request: {+ currency: "EUR",+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ }),+ ideal: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "ideal",+ payment_method_data: {+ bank_redirect: {+ ideal: {+ bank_name: "ing",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "San Fransico",+ state: "California",+ zip: "94122",+ country: "NL",+ first_name: "joseph",+ last_name: "Doe",+ },+ phone: {+ number: "8056594427",+ country_code: "+91",+ },+ },+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ giropay: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "giropay",+ payment_method_data: {+ bank_redirect: {+ giropay: {+ bank_name: "",+ bank_account_bic: "",+ bank_account_iban: "",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "San Fransico",+ state: "California",+ zip: "94122",+ country: "DE",+ first_name: "joseph",+ last_name: "Doe",+ },+ phone: {+ number: "8056594427",+ country_code: "+91",+ },+ },+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ sofort: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "sofort",+ payment_method_data: {+ bank_redirect: {+ sofort: {+ preferred_language: "en",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "San Fransico",+ state: "California",+ zip: "94122",+ country: "AT",+ first_name: "joseph",+ last_name: "Doe",+ },+ phone: {+ number: "8056594427",+ country_code: "+91",+ },+ },+ },+ Response: {+ status: 200,+ body: {+ status: "failed",+ error_code: "PERMISSION_DENIED",+ },+ },+ },+ eps: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "eps",+ payment_method_data: {+ bank_redirect: {+ eps: {+ bank_name: "ing",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "San Fransico",+ state: "California",+ zip: "94122",+ country: "AT",+ first_name: "joseph",+ last_name: "Doe",+ },+ phone: {+ number: "8056594427",+ country_code: "+91",+ },+ },+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ },};diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.jsindex cb787ffab4..27f397fcf4 100644--- a/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js+++ b/cypress-tests/cypress/e2e/PaymentUtils/Trustpay.js@@ -227,7 +227,7 @@ export const connectorDetails = {card: successfulThreeDSTestCardDetails,},currency: "USD",- mandate_data: singleUseMandateData,+ mandate_data: singleUseMandateData,},Response: {status: 400,@@ -246,7 +246,7 @@ export const connectorDetails = {card: successfulThreeDSTestCardDetails,},currency: "USD",- mandate_data: singleUseMandateData,+ mandate_data: singleUseMandateData,},Response: {status: 400,@@ -265,7 +265,7 @@ export const connectorDetails = {card: successfulNo3DSCardDetails,},currency: "USD",- mandate_data: singleUseMandateData,+ mandate_data: singleUseMandateData,},Response: {status: 400,@@ -284,7 +284,7 @@ export const connectorDetails = {card: successfulNo3DSCardDetails,},currency: "USD",- mandate_data: singleUseMandateData,+ mandate_data: singleUseMandateData,},Response: {status: 400,@@ -303,7 +303,7 @@ export const connectorDetails = {card: successfulNo3DSCardDetails,},currency: "USD",- mandate_data: multiUseMandateData,+ mandate_data: multiUseMandateData,},Response: {status: 400,@@ -322,7 +322,7 @@ export const connectorDetails = {card: successfulNo3DSCardDetails,},currency: "USD",- mandate_data: multiUseMandateData,+ mandate_data: multiUseMandateData,},Response: {status: 400,@@ -485,7 +485,7 @@ export const connectorDetails = {type: "invalid_request",message: "Payment method type not supported",code: "HE_03",- reason: "debit mandate payment is not supported by trustpay",+ reason: "manual is not supported by trustpay",},},},@@ -542,7 +542,7 @@ export const connectorDetails = {type: "invalid_request",message: "Payment method type not supported",code: "HE_03",- reason: "debit mandate payment is not supported by trustpay",+ reason: "manual is not supported by trustpay",},},},diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.jsindex c290b4ae42..e36b7726b5 100644--- a/cypress-tests/cypress/support/redirectionHandler.js+++ b/cypress-tests/cypress/support/redirectionHandler.js@@ -198,6 +198,24 @@ function bankRedirectRedirection(}verifyUrl = true;break;+ case "paypal":+ switch (payment_method_type) {+ case "eps":+ cy.get('button[name="Successful"][value="SUCCEEDED"]').click();+ break;+ case "ideal":+ cy.get('button[name="Successful"][value="SUCCEEDED"]').click();+ break;+ case "giropay":+ cy.get('button[name="Successful"][value="SUCCEEDED"]').click();+ break;+ default:+ throw new Error(+ `Unsupported payment method type: ${payment_method_type}`+ );+ }+ verifyUrl = true;+ break;case "stripe":switch (payment_method_type) {case "eps":@@ -246,13 +264,8 @@ function bankRedirectRedirection(cy.get("input#submitButton.btn.btn-primary").click();break;case "ideal":- cy.get("p").should(- "contain.text",- "Choose your iDeal Issuer Bank please"- );- cy.get("#issuerSearchInput").click();- cy.get("#issuerSearchInput").type("ING{enter}");- cy.get("#trustpay__selectIssuer_submit").click();+ cy.contains("button", "Select your bank").click();+ cy.get('[data-testid="ideal-box-bank-item-INGBNL2A"]').click();break;case "giropay":cy.get("._transactionId__header__iXVd_").should(