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): add loonio and gigadat connector (#10881)
likhinbopannaa77c875988f2
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.jsindex 2f3e3adf9c..edceb88fa4 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js@@ -254,6 +254,17 @@ export const payment_methods_enabled = [recurring_enabled: true,installment_payment_enabled: true,},+ {+ payment_method_type: "interac",+ payment_experience: null,+ card_networks: null,+ accepted_currencies: null,+ accepted_countries: null,+ minimum_amount: 1,+ maximum_amount: 68607706,+ recurring_enabled: true,+ installment_payment_enabled: true,+ },],},{@@ -771,6 +782,26 @@ export const connectorDetails = {},},}),+ Interac: getCustomExchange({+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "interac",+ payment_method_data: {+ bank_redirect: {+ interac: {+ bank_name: "ing",+ },+ },+ },+ billing: {+ ...standardBillingAddress,+ address: {+ ...standardBillingAddress.address,+ country: "CA",+ },+ },+ },+ }),},real_time_payment_pm: {PaymentIntent: getCustomExchange({diff --git a/cypress-tests/cypress/e2e/configs/Payment/Gigadat.js b/cypress-tests/cypress/e2e/configs/Payment/Gigadat.jsnew file mode 100644index 0000000000..29a2aa9e49--- /dev/null+++ b/cypress-tests/cypress/e2e/configs/Payment/Gigadat.js@@ -0,0 +1,60 @@+export const connectorDetails = {+ card_pm: {+ PaymentIntent: {+ Request: {+ currency: "CAD",+ customer_acceptance: null,+ setup_future_usage: "on_session",+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ },+ },+ bank_redirect_pm: {+ Interac: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "interac",+ payment_method_data: {+ bank_redirect: {+ interac: {},+ },+ billing: {+ email: "[email protected]",+ address: {+ first_name: "John",+ last_name: "Doe",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "San Fransico",+ state: "California",+ zip: "94122",+ country: "CA",+ first_name: "joseph",+ last_name: "Doe",+ },+ phone: {+ number: "9123456789",+ country_code: "+91",+ },+ },+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ },+};diff --git a/cypress-tests/cypress/e2e/configs/Payment/Loonio.js b/cypress-tests/cypress/e2e/configs/Payment/Loonio.jsnew file mode 100644index 0000000000..29a2aa9e49--- /dev/null+++ b/cypress-tests/cypress/e2e/configs/Payment/Loonio.js@@ -0,0 +1,60 @@+export const connectorDetails = {+ card_pm: {+ PaymentIntent: {+ Request: {+ currency: "CAD",+ customer_acceptance: null,+ setup_future_usage: "on_session",+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ },+ },+ bank_redirect_pm: {+ Interac: {+ Request: {+ payment_method: "bank_redirect",+ payment_method_type: "interac",+ payment_method_data: {+ bank_redirect: {+ interac: {},+ },+ billing: {+ email: "[email protected]",+ address: {+ first_name: "John",+ last_name: "Doe",+ },+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "San Fransico",+ state: "California",+ zip: "94122",+ country: "CA",+ first_name: "joseph",+ last_name: "Doe",+ },+ phone: {+ number: "9123456789",+ country_code: "+91",+ },+ },+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ },+ },+};diff --git a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.jsindex 79fbb674af..5d2b6d085a 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js@@ -127,6 +127,7 @@ const CURRENCY_MAP = {Sofort: "EUR",OpenBankingUk: "GBP", // Great British Pound payment methodOnlineBankingFpx: "MYR", // Malaysian payment methods+ Interac: "CAD", // Canadian payment method};export const getCurrency = (paymentMethodType) => {diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex d27ac50a57..a53f797138 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -33,11 +33,13 @@ import { connectorDetails as fiservemeaConnectorDetails } from "./Fiservemea.js"import { connectorDetails as fiuuConnectorDetails } from "./Fiuu.js";import { connectorDetails as forteConnectorDetails } from "./Forte.js";import { connectorDetails as getnetConnectorDetails } from "./Getnet.js";+import { connectorDetails as gigadatConnectorDetails } from "./Gigadat.js";import { connectorDetails as globalpayConnectorDetails } from "./Globalpay.js";import { connectorDetails as hipayConnectorDetails } from "./Hipay.js";import { connectorDetails as iatapayConnectorDetails } from "./Iatapay.js";import { connectorDetails as itaubankConnectorDetails } from "./ItauBank.js";import { connectorDetails as jpmorganConnectorDetails } from "./Jpmorgan.js";+import { connectorDetails as loonioConnectorDetails } from "./Loonio.js";import { connectorDetails as mollieConnectorDetails } from "./Mollie.js";import { connectorDetails as monerisConnectorDetails } from "./Moneris.js";import { connectorDetails as multisafepayConnectorDetails } from "./Multisafepay.js";@@ -103,6 +105,7 @@ const connectorDetails = {finix: finixConnectorDetails,forte: forteConnectorDetails,getnet: getnetConnectorDetails,+ gigadat: gigadatConnectorDetails,globalpay: globalpayConnectorDetails,hipay: hipayConnectorDetails,iatapay: iatapayConnectorDetails,@@ -141,6 +144,7 @@ const connectorDetails = {worldpayxml: worldpayxmlConnectorDetails,xendit: xenditConnectorDetails,zift: ziftConnectorDetails,+ loonio: loonioConnectorDetails,};export default function getConnectorDetails(connectorId) {diff --git a/cypress-tests/cypress/e2e/configs/Payment/WorldPay.js b/cypress-tests/cypress/e2e/configs/Payment/WorldPay.jsindex a3a0038d59..29fbddb24c 100644--- a/cypress-tests/cypress/e2e/configs/Payment/WorldPay.js+++ b/cypress-tests/cypress/e2e/configs/Payment/WorldPay.js@@ -74,7 +74,7 @@ const paymentMethodDataNoThreeDsResponse = {const paymentMethodDataThreeDsResponse = {card: {last4: "1091",- card_type: "CREDIT",+ card_type: "Credit",card_network: "Visa",card_issuer: "Intl Hdqtrs Center Owned",card_issuing_country: "UNITED STATES OF AMERICA",@@ -667,8 +667,8 @@ export const connectorDetails = {status: "failed",error_code: "13",error_message: "INVALID AMOUNT",- unified_code: "UE_9000",- unified_message: "Something went wrong",+ unified_code: "UE_1000",+ unified_message: "Issue with Payment Method details",},},},diff --git a/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.jsindex 5c4851c32e..e402de4bec 100644--- a/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/00018-BankRedirect.cy.js@@ -433,4 +433,72 @@ describe("Bank Redirect tests", () => {cy.retrievePaymentCallTest(globalState, data);});});++ context("Interac Create and Confirm flow test", () => {+ let shouldContinue = 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 (!shouldContinue) {+ this.skip();+ }+ });+ it("create-payment-call-test", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "bank_redirect_pm"+ ]["PaymentIntent"]("Interac");++ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "three_ds",+ "automatic",+ globalState+ );+ if (shouldContinue) shouldContinue = utils.should_continue_further(data);+ });++ it("payment_methods-call-test", () => {+ cy.paymentMethodsCallTest(globalState);+ });++ it("Confirm bank redirect", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "bank_redirect_pm"+ ]["Interac"];++ cy.confirmBankRedirectCallTest(+ fixtures.confirmBody,+ data,+ true,+ globalState+ );++ if (shouldContinue) shouldContinue = utils.should_continue_further(data);+ });++ it("Handle bank redirect redirection", () => {+ // return_url is a static url (https://example.com) taken from confirm-body fixture and is not updated+ const expected_redirection = fixtures.confirmBody["return_url"];+ const payment_method_type = globalState.get("paymentMethodType");+ cy.handleBankRedirectRedirection(+ globalState,+ payment_method_type,+ expected_redirection+ );+ });++ it("Sync payment status", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "bank_redirect_pm"+ ]["Interac"];++ cy.retrievePaymentCallTest(globalState, data);+ });+ });});diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.jsindex 9ce471fe78..7e69bd22e1 100644--- a/cypress-tests/cypress/support/redirectionHandler.js+++ b/cypress-tests/cypress/support/redirectionHandler.js@@ -674,6 +674,44 @@ function bankRedirectRedirection(}break;+ case "loonio":+ switch (paymentMethodType) {+ case "interac":+ cy.contains("p", "Pay with Interac e-transfer").click();++ verifyUrl = true;+ break;+ default:+ throw new Error(+ `Unsupported loonio payment method type: ${paymentMethodType}`+ );+ }+ break;++ case "gigadat":+ switch (paymentMethodType) {+ case "interac":+ cy.contains("button", /Return To Merchant/i, {+ timeout: constants.TIMEOUT / 3,+ })+ .should("be.visible")+ .click();++ cy.contains("button", /^Yes$/i, {+ timeout: constants.TIMEOUT / 3,+ })+ .should("be.visible")+ .click();++ verifyUrl = true;+ break;+ default:+ throw new Error(+ `Unsupported loonio payment method type: ${paymentMethodType}`+ );+ }+ break;+case "multisafepay":if (["sofort", "eps", "mbway"].includes(paymentMethodType)) {// Multisafe pay has CSRF blocking cannot actually test redirection flow via cypress