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): Add Globalpay connector test in cypress (#8403)

Gnanasundari2475d579a74cca
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Globalpay.js b/cypress-tests/cypress/e2e/configs/Payment/Globalpay.js
new file mode 100644
index 0000000000..a0a2e8a2fe
--- /dev/null
+++ b/cypress-tests/cypress/e2e/configs/Payment/Globalpay.js
@@ -0,0 +1,850 @@
+import { cardRequiredField, customerAcceptance } from "./Commons";
+import { getCustomExchange } from "./Modifiers";
+
+// Test card details for successful non-3DS transactions
+// Based on Global Payments test cards
+const successfulNo3DSCardDetails = {
+ card_number: "4263970000005262",
+ card_exp_month: "12",
+ card_exp_year: "2030",
+ card_holder_name: "Test Customer",
+ card_cvc: "123",
+};
+
+// Test card details for 3DS transactions
+const successfulThreeDSTestCardDetails = {
+ ...successfulNo3DSCardDetails,
+ card_number: "4012000000061026", // Global Payments approved 3DS v2.0 test card with Challenge flow
+};
+
+// Test card details for failed transactions
+const failedNo3DSCardDetails = {
+ ...successfulNo3DSCardDetails,
+ card_number: "4242420000000091", // Generic decline card
+};
+
+// Single-use mandate data structure
+const singleUseMandateData = {
+ customer_acceptance: customerAcceptance,
+ mandate_type: {
+ single_use: {
+ amount: 8000,
+ currency: "EUR",
+ },
+ },
+};
+
+// Multi-use mandate data structure
+const multiUseMandateData = {
+ customer_acceptance: customerAcceptance,
+ mandate_type: {
+ multi_use: {
+ amount: 8000,
+ currency: "EUR",
+ },
+ },
+};
+
+// Payment method data for non-3DS card transactions
+const payment_method_data_no3ds = {
+ card: {
+ last4: "5262",
+ card_type: "CREDIT",
+ card_network: "Visa",
+ card_issuer: "ALLIED IRISH BANKS, P.L.C.",
+ card_issuing_country: "IRELAND",
+ card_isin: "426397",
+ card_extended_bin: null,
+ card_exp_month: "12",
+ card_exp_year: "2030",
+ card_holder_name: "Test Customer",
+ payment_checks: null,
+ authentication_data: null,
+ },
+ billing: null,
+};
+
+// Required fields for payment methods
+const requiredFields = {
+ payment_methods: [
+ {
+ payment_method: "card",
+ payment_method_types: [
+ {
+ payment_method_type: "credit",
+ card_networks: [
+ {
+ eligible_connectors: ["globalpay"],
+ },
+ ],
+ required_fields: cardRequiredField,
+ },
+ {
+ payment_method_type: "debit",
+ card_networks: [
+ {
+ eligible_connectors: ["globalpay"],
+ },
+ ],
+ required_fields: cardRequiredField,
+ },
+ ],
+ },
+ ],
+};
+
+// Billing address for European payments
+const billingAddressEurope = {
+ address: {
+ line1: "123 Payment Street",
+ line2: "Apt 456",
+ line3: "District 7",
+ city: "Amsterdam",
+ state: "North Holland",
+ zip: "1011",
+ country: "NL",
+ first_name: "John",
+ last_name: "Doe",
+ },
+ phone: {
+ number: "1234567890",
+ country_code: "+31",
+ },
+ email: "[email protected]",
+};
+
+// Main connector details export
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ currency: "EUR",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ setup_future_usage: "on_session",
+ },
+ },
+ },
+ PaymentIntentOffSession: {
+ Request: {
+ currency: "EUR",
+ customer_acceptance: null,
+ amount: 6000,
+ authentication_type: "no_three_ds",
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ SessionToken: {
+ Response: {
+ status: 200,
+ body: {
+ session_token: [],
+ },
+ },
+ },
+ PaymentIntentWithShippingCost: {
+ Request: {
+ currency: "EUR",
+ shipping_cost: 50,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ shipping_cost: 50,
+ amount: 6000,
+ },
+ },
+ },
+ PaymentConfirmWithShippingCost: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ shipping_cost: 50,
+ amount_received: 6050,
+ amount: 6000,
+ net_amount: 6050,
+ },
+ },
+ },
+ // No3DS flows
+ No3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ payment_method: "card",
+ attempt_count: 1,
+ payment_method_data: payment_method_data_no3ds,
+ },
+ },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ payment_method: "card",
+ attempt_count: 1,
+ payment_method_data: payment_method_data_no3ds,
+ },
+ },
+ },
+ No3DSFailPayment: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: failedNo3DSCardDetails,
+ },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "111",
+ error_message:
+ "(111)[ test system ] Strong Customer Authentication Required",
+ unified_code: "UE_9000",
+ unified_message: "Something went wrong",
+ },
+ },
+ },
+ "3DSManualCapture": {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ authentication_type: "three_ds",
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "feature_not_supported",
+ error_message:
+ "3DS authentication is not supported by Globalpay connector",
+ unified_code: "UE_5004",
+ unified_message:
+ "The operation requested is not supported by the payment processor",
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "EUR",
+ customer_acceptance: null,
+ authentication_type: "three_ds",
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "feature_not_supported",
+ error_message:
+ "3DS authentication is not supported by Globalpay connector",
+ unified_code: "UE_5004",
+ unified_message:
+ "The operation requested is not supported by the payment processor",
+ },
+ },
+ },
+ Capture: {
+ Request: {
+ amount_to_capture: 6000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ amount: 6000,
+ amount_capturable: 0,
+ amount_received: 6000,
+ },
+ },
+ },
+ PartialCapture: {
+ Request: {
+ amount_to_capture: 2000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "partially_captured",
+ amount: 6000,
+ amount_capturable: 0,
+ amount_received: 2000,
+ },
+ },
+ },
+ Void: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "cancelled",
+ },
+ },
+ ResponseCustom: {
+ status: 400,
+ body: {
+ error: {
+ type: "invalid_request",
+ message:
+ "You cannot cancel this payment because it has status succeeded",
+ code: "IR_16",
+ },
+ },
+ },
+ },
+ Refund: {
+ Request: {
+ amount: 6000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ manualPaymentRefund: {
+ Request: {
+ amount: 6000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ manualPaymentPartialRefund: {
+ Request: {
+ amount: 2000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ PartialRefund: {
+ Request: {
+ amount: 2000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SyncRefund: {
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ // Mandate flows
+ MandateSingleUseNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ MandateSingleUseNo3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ MandateMultiUseNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ MandateMultiUseNo3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ MandateSingleUse3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: singleUseMandateData,
+ authentication_type: "three_ds",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "feature_not_supported",
+ error_message:
+ "3DS authentication is not supported by Globalpay connector",
+ unified_code: "UE_5004",
+ unified_message:
+ "The operation requested is not supported by the payment processor",
+ },
+ },
+ },
+ MandateSingleUse3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: singleUseMandateData,
+ authentication_type: "three_ds",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "feature_not_supported",
+ error_message:
+ "3DS authentication is not supported by Globalpay connector",
+ unified_code: "UE_5004",
+ unified_message:
+ "The operation requested is not supported by the payment processor",
+ },
+ },
+ },
+ MandateMultiUse3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: multiUseMandateData,
+ authentication_type: "three_ds",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "feature_not_supported",
+ error_message:
+ "3DS authentication is not supported by Globalpay connector",
+ unified_code: "UE_5004",
+ unified_message:
+ "The operation requested is not supported by the payment processor",
+ },
+ },
+ },
+ MandateMultiUse3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: multiUseMandateData,
+ authentication_type: "three_ds",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "feature_not_supported",
+ error_message:
+ "3DS authentication is not supported by Globalpay connector",
+ unified_code: "UE_5004",
+ unified_message:
+ "The operation requested is not supported by the payment processor",
+ },
+ },
+ },
+ MITAutoCapture: {
+ Request: {
+ currency: "EUR",
+ billing: billingAddressEurope,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ MITManualCapture: {
+ Request: {
+ currency: "EUR",
+ billing: billingAddressEurope,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 501,
+ body: {
+ code: "IR_00",
+ message: "Setup Mandate flow for Globalpay is not implemented",
+ type: "invalid_request",
+ },
+ },
+ },
+ ZeroAuthPaymentIntent: {
+ Configs: {
+ TRIGGER_SKIP: true,
+ },
+ Request: {
+ amount: 0,
+ setup_future_usage: "off_session",
+ currency: "EUR",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ ZeroAuthConfirmPayment: {
+ Request: {
+ payment_type: "setup_mandate",
+ payment_method: "card",
+ payment_method_type: "credit",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ // Saved card flows
+ SaveCardUseNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ setup_future_usage: "on_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "on_session",
+ },
+ },
+ },
+ SaveCardUseNo3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ setup_future_usage: "on_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ setup_future_usage: "on_session",
+ },
+ },
+ },
+ SaveCardUse3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "EUR",
+ setup_future_usage: "on_session",
+ customer_acceptance: customerAcceptance,
+ authentication_type: "three_ds",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "feature_not_supported",
+ error_message:
+ "3DS authentication is not supported by Globalpay connector",
+ unified_code: "UE_5004",
+ unified_message:
+ "The operation requested is not supported by the payment processor",
+ },
+ },
+ },
+ SaveCardUse3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "EUR",
+ setup_future_usage: "on_session",
+ customer_acceptance: customerAcceptance,
+ authentication_type: "three_ds",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ error_code: "feature_not_supported",
+ error_message:
+ "3DS authentication is not supported by Globalpay connector",
+ unified_code: "UE_5004",
+ unified_message:
+ "The operation requested is not supported by the payment processor",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSAutoCapture: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: null,
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "off_session",
+ },
+ },
+ }),
+ PaymentMethodIdMandateNo3DSManualCapture: getCustomExchange({
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ mandate_data: null,
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ setup_future_usage: "off_session",
+ },
+ },
+ }),
+ SaveCardUseNo3DSAutoCaptureOffSession: {
+ Request: {
+ payment_method: "card",
+ payment_method_type: "debit",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ setup_future_usage: "off_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ SaveCardUseNo3DSManualCaptureOffSession: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "EUR",
+ setup_future_usage: "off_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ SaveCardConfirmAutoCaptureOffSession: {
+ Request: {
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ SaveCardConfirmManualCaptureOffSession: {
+ Request: {
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ SaveCardConfirmAutoCaptureOffSessionWithoutBilling: {
+ Request: {
+ setup_future_usage: "off_session",
+ billing: null,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ setup_future_usage: "off_session",
+ },
+ },
+ },
+ },
+ pm_list: {
+ PmListResponse: {
+ PmListNull: {
+ payment_methods: [],
+ },
+ pmListDynamicFieldWithoutBilling: requiredFields,
+ pmListDynamicFieldWithBilling: requiredFields,
+ pmListDynamicFieldWithNames: requiredFields,
+ pmListDynamicFieldWithEmail: requiredFields,
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 9f359364f2..7f06daaca2 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -23,6 +23,7 @@ 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 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";
@@ -67,6 +68,7 @@ const connectorDetails = {
fiuu: fiuuConnectorDetails,
forte: forteConnectorDetails,
getnet: getnetConnectorDetails,
+ globalpay: globalpayConnectorDetails,
hipay: hipayConnectorDetails,
iatapay: iatapayConnectorDetails,
itaubank: itaubankConnectorDetails,
diff --git a/cypress-tests/cypress/fixtures/create-connector-body.json b/cypress-tests/cypress/fixtures/create-connector-body.json
index 724119e0df..c9af05cb1c 100644
--- a/cypress-tests/cypress/fixtures/create-connector-body.json
+++ b/cypress-tests/cypress/fixtures/create-connector-body.json
@@ -13,6 +13,7 @@
"city": "NY",
"unit": "245",
"endpoint_prefix": "AD",
- "merchant_name": "Cypress Test"
+ "merchant_name": "Cypress Test",
+ "account_name": "transaction_processing"
}
}