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 support ali_pay_hk for adyen connector (#11903)
HS-QUALIBOT761f0af985d0
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Adyen.js b/cypress-tests/cypress/e2e/configs/Payment/Adyen.jsindex 6a70e332a9..1d92d2c7be 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Adyen.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Adyen.js@@ -1,5 +1,5 @@import { customerAcceptance, multiUseMandateData } from "./Commons";-import { getCustomExchange } from "./Modifiers";+import { getCurrency, getCustomExchange } from "./Modifiers";const successfulNo3DSCardDetails = {card_number: "4111111111111111",@@ -1060,6 +1060,55 @@ export const connectorDetails = {},},},+ wallet_pm: {+ PaymentIntent: (paymentMethodType) =>+ getCustomExchange({+ Request: {+ currency: getCurrency(paymentMethodType),+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ }),+ AliPayHk: getCustomExchange({+ Request: {+ payment_method: "wallet",+ payment_method_type: "ali_pay_hk",+ payment_method_data: {+ wallet: {+ ali_pay_hk_redirect: {},+ },+ },+ billing: {+ address: {+ line1: "1467",+ line2: "Harrison Street",+ line3: "Harrison Street",+ city: "Hong Kong",+ state: "HK",+ zip: "999077",+ country: "HK",+ first_name: "joseph",+ last_name: "Doe",+ },+ phone: {+ number: "9123456789",+ country_code: "+852",+ },+ },+ },+ Response: {+ status: 200,+ body: {+ status: "requires_customer_action",+ },+ },+ }),+ },+pm_list: {PmListResponse: {PmListNull: {diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.jsindex 4232d7b833..ffdd521a9a 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js@@ -501,6 +501,14 @@ export const payment_methods_enabled = [recurring_enabled: false,installment_payment_enabled: false,},+ {+ payment_method_type: "ali_pay_hk",+ payment_experience: "redirect_to_url",+ minimum_amount: 1,+ maximum_amount: 68607706,+ recurring_enabled: false,+ installment_payment_enabled: false,+ },],},{@@ -1009,6 +1017,27 @@ export const connectorDetails = {},},}),+ AliPayHk: getCustomExchange({+ Request: {+ payment_method: "wallet",+ payment_method_type: "ali_pay_hk",+ payment_method_data: {+ wallet: {+ ali_pay_hk_redirect: {},+ },+ },+ billing: {+ ...standardBillingAddress,+ address: {+ ...standardBillingAddress.address,+ country: "HK",+ },+ },+ },+ Configs: {+ TRIGGER_SKIP: true,+ },+ }),},real_time_payment_pm: {PaymentIntent: getCustomExchange({diff --git a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.jsindex b4954dd5d6..bf52252fed 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js@@ -131,6 +131,7 @@ const CURRENCY_MAP = {OpenBankingUk: "GBP", // Great British Pound payment methodOnlineBankingFpx: "MYR", // Malaysian payment methodsInterac: "CAD", // Canadian payment method+ AliPayHk: "HKD", // Hong Kong payment method};export const getCurrency = (paymentMethodType) => {diff --git a/cypress-tests/cypress/e2e/spec/Payment/19-Wallet.cy.js b/cypress-tests/cypress/e2e/spec/Payment/19-Wallet.cy.jsindex 699d9579c0..f61cdaccb0 100644--- a/cypress-tests/cypress/e2e/spec/Payment/19-Wallet.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/19-Wallet.cy.js@@ -87,4 +87,83 @@ describe("Wallet tests", () => {});});});++ context("AliPayHk Create and Confirm flow test", () => {+ let shouldContinue = true;++ 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"))[+ "wallet_pm"+ ]["PaymentIntent"]("AliPayHk");++ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (shouldContinue) shouldContinue = utils.should_continue_further(data);+ });++ it("payment_methods-call-test", () => {+ cy.paymentMethodsCallTest(globalState);+ });++ it("Confirm wallet redirect", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "wallet_pm"+ ]["AliPayHk"];++ cy.confirmBankRedirectCallTest(+ fixtures.confirmBody,+ data,+ true,+ globalState+ );++ if (shouldContinue) shouldContinue = utils.should_continue_further(data);+ });++ it("Handle wallet redirection", () => {+ const expected_redirection = fixtures.confirmBody["return_url"];+ const payment_method_type = globalState.get("paymentMethodType");+ const nextActionUrl = globalState.get("nextActionUrl");++ expect(+ nextActionUrl,+ "nextActionUrl should be defined before handling wallet redirection"+ ).to.be.a("string");++ cy.handleWalletRedirection(+ globalState,+ payment_method_type,+ expected_redirection+ );+ });++ it("Sync payment status", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "wallet_pm"+ ]["AliPayHk"];++ cy.retrievePaymentCallTest({+ globalState,+ data,+ expectedIntentStatus: "succeeded",+ });+ });+ });});diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.jsindex a7fbc2d327..e5ebc2e2d1 100644--- a/cypress-tests/cypress/support/redirectionHandler.js+++ b/cypress-tests/cypress/support/redirectionHandler.js@@ -402,6 +402,11 @@ function bankRedirectRedirection(cy.get('[value="authorised"]').click();verifyUrl = true;break;+ case "ali_pay_hk":+ cy.get("h1").should("contain.text", "Acquirer Simulator");+ cy.get('[value="authorised"]').click();+ verifyUrl = true;+ break;// The 'ideal' case is handled outside handleFlowdefault:throw new Error(