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 authorizedotnet connector (#8688)

likhinbopannab5dddbc1a8e0
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.js b/cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.js
new file mode 100644
index 0000000000..b468d1de64
--- /dev/null
+++ b/cypress-tests/cypress/e2e/configs/Payment/Authorizedotnet.js
@@ -0,0 +1,681 @@
+import {
+ customerAcceptance,
+ multiUseMandateData,
+ singleUseMandateData,
+} from "./Commons";
+
+const successfulNo3DSCardDetails = {
+ card_number: "4111111111111111",
+ card_exp_month: "12",
+ card_exp_year: "2029",
+ card_holder_name: "John Doe",
+ card_cvc: "123",
+};
+
+const successfulThreeDSTestCardDetails = {
+ card_number: "4000000000000002",
+ card_exp_month: "12",
+ card_exp_year: "2029",
+ card_holder_name: "John Doe",
+ card_cvc: "123",
+};
+
+const failedNo3DSCardDetails = {
+ card_number: "4000000000000127",
+ card_exp_month: "12",
+ card_exp_year: "2029",
+ card_holder_name: "John Doe",
+ card_cvc: "123",
+};
+
+const paymentMethodData = {
+ card: {
+ last4: "1111",
+ card_type: "CREDIT",
+ card_network: "Visa",
+ card_issuer: "JP Morgan",
+ card_issuing_country: "INDIA",
+ card_isin: "411111",
+ card_extended_bin: null,
+ card_exp_month: "12",
+ card_exp_year: "2029",
+ card_holder_name: "John Doe",
+ payment_checks: {
+ description: "The street address and postal code matched.",
+ avs_result_code: "Y",
+ },
+ authentication_data: null,
+ },
+ billing: null,
+};
+
+export const connectorDetails = {
+ card_pm: {
+ PaymentIntent: {
+ Request: {
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ PaymentIntentOffSession: {
+ Request: {
+ amount: 6000,
+ authentication_type: "no_three_ds",
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_payment_method",
+ },
+ },
+ },
+ PaymentIntentWithShippingCost: {
+ Request: {
+ currency: "USD",
+ 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,
+ },
+ },
+ },
+ "3DSManualCapture": {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ "3DSAutoCapture": {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ No3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ No3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ No3DSFailPayment: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: failedNo3DSCardDetails,
+ },
+ customer_acceptance: null,
+ setup_future_usage: "on_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded", // No Test card for failed payment in Authorizedotnet
+ },
+ },
+ },
+ 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",
+ },
+ },
+ },
+ Refund: {
+ Configs: {
+ TRIGGER_SKIP: true, // Refund will happen only after the payment is settled.
+ },
+ Request: {
+ amount: 6000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ },
+ },
+ },
+ PartialRefund: {
+ Configs: {
+ TRIGGER_SKIP: true, // Refund will happen only after the payment is settled.
+ },
+ Request: {
+ amount: 2000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ },
+ },
+ },
+ manualPaymentRefund: {
+ Configs: {
+ TRIGGER_SKIP: true, // Refund will happen only after the payment is settled.
+ },
+ Request: {
+ amount: 6000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ },
+ },
+ },
+ manualPaymentPartialRefund: {
+ Configs: {
+ TRIGGER_SKIP: true, // Refund will happen only after the payment is settled.
+ },
+ Request: {
+ amount: 2000,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ },
+ },
+ },
+ SyncRefund: {
+ Response: {
+ status: 200,
+ body: {
+ status: "failed",
+ },
+ },
+ },
+ MandateSingleUse3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ MandateSingleUse3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ MandateSingleUseNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ MandateSingleUseNo3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ MandateMultiUseNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ MandateMultiUseNo3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ MandateMultiUse3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ MandateMultiUse3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: multiUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ payment_method_data: paymentMethodData,
+ },
+ },
+ },
+ MITAutoCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ MITManualCapture: {
+ Request: {},
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ ZeroAuthMandate: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: singleUseMandateData,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ ZeroAuthPaymentIntent: {
+ Request: {
+ amount: 0,
+ setup_future_usage: "off_session",
+ currency: "USD",
+ },
+ 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",
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ setup_future_usage: "on_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SaveCardUseNo3DSAutoCaptureOffSession: {
+ Request: {
+ payment_method: "card",
+ payment_method_type: "debit",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ setup_future_usage: "off_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SaveCardUse3DSAutoCaptureOffSession: {
+ Request: {
+ payment_method: "card",
+ payment_method_type: "debit",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ setup_future_usage: "off_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ SaveCardUseNo3DSManualCaptureOffSession: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ setup_future_usage: "off_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ SaveCardConfirmAutoCaptureOffSession: {
+ Request: {
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ SaveCardConfirmManualCaptureOffSession: {
+ Request: {
+ setup_future_usage: "off_session",
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ SaveCardUseNo3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ setup_future_usage: "on_session",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "succeeded",
+ },
+ },
+ },
+ PaymentMethodIdMandateNo3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulNo3DSCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_capture",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSAutoCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ currency: "USD",
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ PaymentMethodIdMandate3DSManualCapture: {
+ Request: {
+ payment_method: "card",
+ payment_method_data: {
+ card: successfulThreeDSTestCardDetails,
+ },
+ mandate_data: null,
+ authentication_type: "three_ds",
+ customer_acceptance: customerAcceptance,
+ },
+ Response: {
+ status: 200,
+ body: {
+ status: "requires_customer_action",
+ },
+ },
+ },
+ },
+};
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
index 9ad5208536..78bd3b073f 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js
@@ -1,5 +1,5 @@
// This file is the default. To override, add to connector.js
-import { getCustomExchange, getCurrency } from "./Modifiers";
+import { getCurrency, getCustomExchange } from "./Modifiers";
export const customerAcceptance = {
acceptance_type: "offline",
@@ -33,7 +33,7 @@ const PaymentMethodCardDetails = {
card_holder_name: "Joseph Doe",
};
-const singleUseMandateData = {
+export const singleUseMandateData = {
customer_acceptance: customerAcceptance,
mandate_type: {
single_use: {
@@ -43,7 +43,7 @@ const singleUseMandateData = {
},
};
-const multiUseMandateData = {
+export const multiUseMandateData = {
customer_acceptance: customerAcceptance,
mandate_type: {
multi_use: {
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 5a2bfb4339..c95ee19cc1 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -7,6 +7,7 @@ import { connectorDetails as adyenConnectorDetails } from "./Adyen.js";
import { connectorDetails as airwallexConnectorDetails } from "./Airwallex.js";
import { connectorDetails as archipelConnectorDetails } from "./Archipel.js";
import { connectorDetails as authipayConnectorDetails } from "./Authipay.js";
+import { connectorDetails as authorizedotnetConnectorDetails } from "./Authorizedotnet.js";
import { connectorDetails as bamboraConnectorDetails } from "./Bambora.js";
import { connectorDetails as bamboraapacConnectorDetails } from "./Bamboraapac.js";
import { connectorDetails as bankOfAmericaConnectorDetails } from "./BankOfAmerica.js";
@@ -17,8 +18,8 @@ import { connectorDetails as checkoutConnectorDetails } from "./Checkout.js";
import { connectorDetails as commonConnectorDetails } from "./Commons.js";
import { connectorDetails as cybersourceConnectorDetails } from "./Cybersource.js";
import { connectorDetails as datatransConnectorDetails } from "./Datatrans.js";
-import { connectorDetails as dlocalConnectorDetails } from "./Dlocal.js";
import { connectorDetails as deutschebankConnectorDetails } from "./Deutschebank.js";
+import { connectorDetails as dlocalConnectorDetails } from "./Dlocal.js";
import { connectorDetails as elavonConnectorDetails } from "./Elavon.js";
import { connectorDetails as facilitapayConnectorDetails } from "./Facilitapay.js";
import { connectorDetails as fiservConnectorDetails } from "./Fiserv.js";
@@ -63,6 +64,7 @@ const connectorDetails = {
airwallex: airwallexConnectorDetails,
archipel: archipelConnectorDetails,
authipay: authipayConnectorDetails,
+ authorizedotnet: authorizedotnetConnectorDetails,
bambora: bamboraConnectorDetails,
bamboraapac: bamboraapacConnectorDetails,
bankofamerica: bankOfAmericaConnectorDetails,