Skip to content

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

ci(cypress): added Calida connector (#11169)

Vasanth8760423f8431
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Calida.js b/cypress-tests/cypress/e2e/configs/Payment/Calida.js
new file mode 100644
index 0000000000..47f04fe01f
--- /dev/null
+++ b/cypress-tests/cypress/e2e/configs/Payment/Calida.js
@@ -0,0 +1,35 @@
+import { standardBillingAddress } from "./Commons";
+
+const bluecodeBilling = {
+ ...standardBillingAddress,
+ address: {
+ ...standardBillingAddress.address,
+ country: "AT",
+ },
+};
+
+export const connectorDetails = {
+ wallet_pm: {
+ Bluecode: {
+ Request: {
+ payment_method: "wallet",
+ payment_method_type: "bluecode",
+ authentication_type: "no_three_ds",
+ billing: bluecodeBilling,
+ payment_method_data: {
+ wallet: {
+ bluecode_redirect: {},
+ },
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_type: "bluecode",
+ connector: "calida",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
index f188ca5932..4af0c0bcb3 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
@@ -417,6 +417,14 @@ export const payment_methods_enabled = [
installment_payment_enabled: true,
payment_experience: "invoke_sdk_client",
},
+ {
+ payment_method_type: "bluecode",
+ payment_experience: "redirect_to_url",
+ minimum_amount: 1,
+ maximum_amount: 68607706,
+ recurring_enabled: false,
+ installment_payment_enabled: false,
+ },
{
payment_method_type: "skrill",
payment_experience: "redirect_to_url",
@@ -803,6 +811,38 @@ export const connectorDetails = {
},
}),
},
+ wallet_pm: {
+ PaymentIntent: (paymentMethodType) =>
+ getCustomExchange({
+ Request: {
+ currency: getCurrency(paymentMethodType),
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ }),
+ Bluecode: getCustomExchange({
+ Request: {
+ payment_method: "wallet",
+ payment_method_type: "bluecode",
+ payment_method_data: {
+ wallet: {
+ bluecode_redirect: {},
+ },
+ },
+ billing: {
+ ...standardBillingAddress,
+ address: {
+ ...standardBillingAddress.address,
+ country: "AT",
+ },
+ },
+ },
+ }),
+ },
real_time_payment_pm: {
PaymentIntent: getCustomExchange({
Request: {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
index e574c30ec8..d35114f0bf 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Modifiers.js
@@ -119,6 +119,7 @@ const CURRENCY_MAP = {
Pix: "BRL",
// European payment methods (EUR)
+ Bluecode: "EUR",
Eps: "EUR",
Giropay: "EUR",
Ideal: "EUR",
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Peachpayments.js b/cypress-tests/cypress/e2e/configs/Payment/Peachpayments.js
index b8aff31eb0..b225804fd6 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Peachpayments.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Peachpayments.js
@@ -1,7 +1,7 @@
import { customerAcceptance } from "./Commons";
const successfulNo3DSCardDetails = {
- card_number: "5181030000183696",
+ card_number: "5200000000000015",
card_exp_month: "01",
card_exp_year: "28",
card_holder_name: "John",
@@ -16,6 +16,14 @@ const successfulThreeDSTestCardDetails = {
card_cvc: "576",
};
+const failedNo3DSCardDetails = {
+ card_number: "4111111111111111",
+ card_exp_month: "08",
+ card_exp_year: "30",
+ card_holder_name: "joseph Doe",
+ card_cvc: "999",
+};
+
const singleUseMandateData = {
customer_acceptance: customerAcceptance,
mandate_type: {
@@ -191,6 +199,25 @@ export const connectorDetails = {
},
},
},
+ No3DSFailPayment: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: failedNo3DSCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "15",
+ error_message: "No such issuer (invalid IIN)",
+ },
+ },
+ },
Capture: {
Request: {
amount_to_capture: 6000,
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 0596b65115..9553590d75 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -15,6 +15,7 @@ import { connectorDetails as barclaycardConnectorDetails } from "./Barclaycard.j
import { connectorDetails as billwerkConnectorDetails } from "./Billwerk.js";
import { connectorDetails as bluesnapConnectorDetails } from "./Bluesnap.js";
import { connectorDetails as braintreeConnectorDetails } from "./Braintree.js";
+import { connectorDetails as calidaConnectorDetails } from "./Calida.js";
import { connectorDetails as cashtocodeConnectorDetails } from "./Cashtocode.js";
import { connectorDetails as celeroConnectorDetails } from "./Celero.js";
import { connectorDetails as checkbookConnectorDetails } from "./Checkbook.js";
@@ -87,6 +88,7 @@ const connectorDetails = {
billwerk: billwerkConnectorDetails,
bluesnap: bluesnapConnectorDetails,
braintree: braintreeConnectorDetails,
+ calida: calidaConnectorDetails,
cashtocode: cashtocodeConnectorDetails,
celero: celeroConnectorDetails,
checkout: checkoutConnectorDetails,
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00040-Wallet.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00040-Wallet.cy.js
new file mode 100644
index 0000000000..699d9579c0
--- /dev/null
+++ b/cypress-tests/cypress/e2e/spec/Payment/00040-Wallet.cy.js
@@ -0,0 +1,90 @@
+import * as fixtures from "../../../fixtures/imports";
+import State from "../../../utils/State";
+import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
+
+let globalState;
+
+describe("Wallet tests", () => {
+ afterEach("flush global state", () => {
+ cy.task("setGlobalState", globalState.data);
+ });
+
+ context("Bluecode 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"]("Bluecode");
+
+ 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 wallet redirect", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "wallet_pm"
+ ]["Bluecode"];
+
+ 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"
+ ]["Bluecode"];
+
+ cy.retrievePaymentCallTest({
+ globalState,
+ data,
+ expectedIntentStatus: "requires_customer_action",
+ });
+ });
+ });
+});
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index ce57a2b86d..ec545be93d 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -3757,6 +3757,24 @@ Cypress.Commands.add(
}
);
+Cypress.Commands.add(
+ "handleWalletRedirection",
+ (globalState, paymentMethodType, expectedRedirection) => {
+ const connectorId = globalState.get("connectorId");
+ const nextActionUrl = globalState.get("nextActionUrl");
+
+ const expectedUrl = new URL(expectedRedirection);
+ const redirectionUrl = new URL(nextActionUrl);
+
+ handleRedirection(
+ "bank_redirect",
+ { redirectionUrl, expectedUrl },
+ connectorId,
+ paymentMethodType
+ );
+ }
+);
+
Cypress.Commands.add(
"confirmRealTimePaymentCallTest",
(confirmBody, data, confirm, globalState) => {
diff --git a/cypress-tests/cypress/support/redirectionHandler.js b/cypress-tests/cypress/support/redirectionHandler.js
index db5b8a70cb..29981cbf8a 100644
--- a/cypress-tests/cypress/support/redirectionHandler.js
+++ b/cypress-tests/cypress/support/redirectionHandler.js
@@ -725,6 +725,45 @@ function bankRedirectRedirection(
}
break;
+ case "calida":
+ switch (paymentMethodType) {
+ case "bluecode":
+ cy.log("Handling Bluecode redirect flow");
+
+ cy.contains("body", /Open your Bluecode compatible App/i, {
+ timeout: constants.TIMEOUT / 3,
+ }).should("be.visible");
+
+ // Bluecode shows a QR that the shopper scans inside their wallet app.
+ cy.get(
+ "canvas:visible, img:visible, svg:visible, picture:visible",
+ {
+ timeout: constants.TIMEOUT / 2,
+ }
+ )
+ .first()
+ .scrollIntoView()
+ .should("be.visible")
+ .then(($el) => {
+ cy.log(
+ "Verified Bluecode QR code is visible",
+ $el.prop("tagName")
+ );
+ });
+
+ cy.contains("button, a", /Cancel/i, {
+ timeout: constants.TIMEOUT / 3,
+ }).should("be.visible");
+
+ verifyUrl = false;
+ break;
+ default:
+ throw new Error(
+ `Unsupported Calida payment method type: ${paymentMethodType}`
+ );
+ }
+ break;
+
case "volt":
if (paymentMethodType === "open_banking_uk") {
cy.log("Handling Volt OpenBankingUk redirect flow");