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): Fix bambora, forte, fiserv , facilitapay and fiservemea connectors (#11791)
likhinbopannac5899d3b6d68
diff --git a/crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs b/crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rsindex a2b5faff96..576464366c 100644--- a/crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs+++ b/crates/hyperswitch_connectors/src/connectors/fiservemea/transformers.rs@@ -17,7 +17,7 @@ use serde::{Deserialize, Serialize};use crate::{types::{RefundsResponseRouterData, ResponseRouterData},- utils::CardData as _,+ utils::{CardData as _, RouterData as _},};//TODO: Fill the struct with respective fields@@ -93,6 +93,13 @@ impl TryFrom<&FiservemeaRouterData<&PaymentsAuthorizeRouterData>> for Fiservemeafn try_from(item: &FiservemeaRouterData<&PaymentsAuthorizeRouterData>,) -> Result<Self, Self::Error> {+ if item.router_data.is_three_ds() {+ Err(errors::ConnectorError::NotSupported {+ message: "Cards 3DS".to_string(),+ connector: "Fiservemea",+ })?+ }+match item.router_data.request.payment_method_data.clone() {PaymentMethodData::Card(req_card) => {let card = FiservemeaPaymentCard {diff --git a/cypress-tests/cypress/e2e/configs/Payment/Bambora.js b/cypress-tests/cypress/e2e/configs/Payment/Bambora.jsindex 77270e2c5a..db873e5a3d 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Bambora.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Bambora.js@@ -272,6 +272,9 @@ export const connectorDetails = {},},PartialRefund: {+ Configs: {+ TRIGGER_SKIP: true, // Skip this test as multiple partial refunds are not supported for Bambora+ },Request: {amount: 2000,},diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.jsindex 8d310217f8..d8cd5aaaf8 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js@@ -992,10 +992,6 @@ export const connectorDetails = {customer_acceptance: null,setup_future_usage: "on_session",},- Response: {- status: 200,- body: {},- },}),ManualRetryPaymentDisabled: getCustomExchange({Request: {@@ -1779,7 +1775,7 @@ export const connectorDetails = {city: "San Fransico",state: "CA",zip: "94122",- country: "PL",+ country: "US",first_name: "joseph",last_name: "Doe",},diff --git a/cypress-tests/cypress/e2e/configs/Payment/Cybersource.js b/cypress-tests/cypress/e2e/configs/Payment/Cybersource.jsindex 4878e44211..1467a8ad28 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Cybersource.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Cybersource.js@@ -1214,7 +1214,7 @@ export const connectorDetails = {options: ["ALL"],},},- value: "PL",+ value: "US",},"billing.address.first_name": {required_field:diff --git a/cypress-tests/cypress/e2e/configs/Payment/Facilitapay.js b/cypress-tests/cypress/e2e/configs/Payment/Facilitapay.jsindex 9c9e2d6751..d593b6b66e 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Facilitapay.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Facilitapay.js@@ -35,6 +35,9 @@ export const connectorDetails = {},bank_transfer_pm: {Pix: getCustomExchange({+ Configs: {+ TRIGGER_SKIP: true, // Skip this test as HandleRedirection is not required to complete the payment flow for Pix.+ },Request: {payment_method: "bank_transfer",payment_method_type: "pix",@@ -59,7 +62,7 @@ export const connectorDetails = {Response: {status: 200,body: {- status: "requires_customer_action",+ status: "succeeded",},},ResponseCustom: {diff --git a/cypress-tests/cypress/e2e/configs/Payment/Fiserv.js b/cypress-tests/cypress/e2e/configs/Payment/Fiserv.jsindex 1037af6a43..a11f8c60a8 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Fiserv.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Fiserv.js@@ -119,10 +119,10 @@ const requiredFields = {const payment_method_data_no3ds = {card: {last4: "1111",- card_type: "CREDIT",+ card_type: "DEBIT",card_network: "Visa",- card_issuer: "JP Morgan",- card_issuing_country: "INDIA",+ card_issuer: "Conotoxia Sp Z Oo",+ card_issuing_country: "POLAND",card_isin: "411111",card_extended_bin: null,card_exp_month: "12",@@ -584,6 +584,9 @@ export const connectorDetails = {},},SaveCardUseNo3DSAutoCaptureOffSession: {+ Configs: {+ TRIGGER_SKIP: true, // Skip this test as off-session payments with future usage are not supported for Fiserv+ },Request: {payment_method: "card",payment_method_data: {@@ -623,6 +626,9 @@ export const connectorDetails = {},},SaveCardUseNo3DSManualCaptureOffSession: {+ Configs: {+ TRIGGER_SKIP: true, // Skip this test as off-session payments with future usage are not supported for Fiserv+ },Request: {payment_method: "card",payment_method_data: {@@ -651,6 +657,9 @@ export const connectorDetails = {},},SaveCardConfirmAutoCaptureOffSession: {+ Configs: {+ TRIGGER_SKIP: true, // Skip this test as off-session payments with future usage are not supported for Fiserv+ },Request: {setup_future_usage: "off_session",payment_method_data: {@@ -665,6 +674,9 @@ export const connectorDetails = {},},SaveCardConfirmManualCaptureOffSession: {+ Configs: {+ TRIGGER_SKIP: true, // Skip this test as off-session payments with future usage are not supported for Fiserv+ },Request: {setup_future_usage: "off_session",payment_method_data: {diff --git a/cypress-tests/cypress/e2e/configs/Payment/Fiservemea.js b/cypress-tests/cypress/e2e/configs/Payment/Fiservemea.jsindex 22893a9ff5..d8989e7f8c 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Fiservemea.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Fiservemea.js@@ -16,6 +16,19 @@ const failedNo3DSCardDetails = {card_cvc: "123",};+const blockedPaymentErrorBody = {+ status: 200,+ expectBlockedPayment: true,+ body: {+ error: {+ type: "blocked",+ message: "This payment method is blocked",+ code: "HE_03",+ reason: "Blocked",+ },+ },+};+const billingAddress = {address: {state: "New York",@@ -50,6 +63,15 @@ const multiUseMandateData = {},};+const threeDSNotSupportedError = {+ error: {+ code: "IR_19",+ message: "Payment method type not supported",+ reason: "Cards 3DS is not supported by Fiservemea",+ type: "invalid_request",+ },+};+export const connectorDetails = {card_pm: {PaymentIntent: {@@ -119,9 +141,6 @@ export const connectorDetails = {},},"3DSManualCapture": {- Configs: {- TRIGGER_SKIP: true,- },Request: {payment_method: "card",payment_method_data: {@@ -133,31 +152,24 @@ export const connectorDetails = {billing: billingAddress,},Response: {- status: 200,- body: {- status: "requires_capture",- },+ status: 400,+ body: threeDSNotSupportedError,},},"3DSAutoCapture": {- Configs: {- TRIGGER_SKIP: true,- },Request: {payment_method: "card",payment_method_data: {card: successfulNo3DSCardDetails,},- currency: "MYR",+ currency: "EUR",customer_acceptance: null,setup_future_usage: "on_session",billing: billingAddress,},Response: {- status: 200,- body: {- status: "succeeded",- },+ status: 400,+ body: threeDSNotSupportedError,},},Capture: {@@ -293,7 +305,7 @@ export const connectorDetails = {},PaymentIntentWithShippingCost: {Request: {- currency: "MYR",+ currency: "EUR",shipping_cost: 50,billing: billingAddress,},@@ -319,28 +331,26 @@ export const connectorDetails = {Response: {status: 200,body: {- status: "failed",- error_message: "No terminal setup",+ status: "succeeded",},},},MandateSingleUse3DSAutoCapture: {- Configs: {- TRIGGER_SKIP: true,- },Request: {payment_method: "card",payment_method_data: {card: successfulNo3DSCardDetails,},currency: "EUR",+ authentication_type: "three_ds",mandate_data: singleUseMandateData,},Response: {- status: 200,- body: {- status: "succeeded",- },+ status: 400,+ body: threeDSNotSupportedError,+ },+ Configs: {+ TRIGGER_SKIP: true,},},MandateSingleUse3DSManualCapture: {@@ -350,13 +360,12 @@ export const connectorDetails = {card: successfulNo3DSCardDetails,},currency: "EUR",+ authentication_type: "three_ds",mandate_data: singleUseMandateData,},Response: {- status: 200,- body: {- status: "requires_capture",- },+ status: 400,+ body: threeDSNotSupportedError,},},MandateSingleUseNo3DSAutoCapture: {@@ -446,13 +455,12 @@ export const connectorDetails = {card: successfulNo3DSCardDetails,},currency: "EUR",+ authentication_type: "three_ds",mandate_data: multiUseMandateData,},Response: {- status: 200,- body: {- status: "requires_capture",- },+ status: 400,+ body: threeDSNotSupportedError,},},MandateMultiUse3DSManualCapture: {@@ -462,13 +470,12 @@ export const connectorDetails = {card: successfulNo3DSCardDetails,},currency: "EUR",+ authentication_type: "three_ds",mandate_data: multiUseMandateData,},Response: {- status: 200,- body: {- status: "requires_capture",- },+ status: 400,+ body: threeDSNotSupportedError,},},MITAutoCapture: {@@ -552,9 +559,6 @@ export const connectorDetails = {},},SaveCardUse3DSAutoCaptureOffSession: {- Configs: {- TRIGGER_SKIP: true,- },Request: {payment_method: "card",payment_method_type: "debit",@@ -562,14 +566,13 @@ export const connectorDetails = {card: successfulNo3DSCardDetails,},setup_future_usage: "off_session",+ authentication_type: "three_ds",customer_acceptance: customerAcceptance,billing: billingAddress,},Response: {- status: 200,- body: {- status: "requires_customer_action",- },+ status: 400,+ body: threeDSNotSupportedError,},},SaveCardUseNo3DSManualCaptureOffSession: {@@ -642,6 +645,9 @@ export const connectorDetails = {},},PaymentMethodIdMandateNo3DSAutoCapture: {+ Configs: {+ TRIGGER_SKIP: true,+ },Request: {payment_method: "card",payment_method_data: {@@ -660,6 +666,9 @@ export const connectorDetails = {},},PaymentMethodIdMandateNo3DSManualCapture: {+ Configs: {+ TRIGGER_SKIP: true,+ },Request: {payment_method: "card",payment_method_data: {@@ -678,9 +687,6 @@ export const connectorDetails = {},},PaymentMethodIdMandate3DSAutoCapture: {- Configs: {- TRIGGER_SKIP: true,- },Request: {payment_method: "card",payment_method_data: {@@ -693,16 +699,11 @@ export const connectorDetails = {billing: billingAddress,},Response: {- status: 200,- body: {- status: "requires_customer_action",- },+ status: 400,+ body: threeDSNotSupportedError,},},PaymentMethodIdMandate3DSManualCapture: {- Configs: {- TRIGGER_SKIP: true,- },Request: {payment_method: "card",payment_method_data: {@@ -715,10 +716,8 @@ export const connectorDetails = {billing: billingAddress,},Response: {- status: 200,- body: {- status: "requires_capture",- },+ status: 400,+ body: threeDSNotSupportedError,},},No3DSFailPayment: {@@ -739,4 +738,78 @@ export const connectorDetails = {},},},+ payment_method_blocking_pm: {+ BlockIssuingCountry: {+ Request: {+ payment_method: "card",+ payment_method_data: {+ card: {+ card_number: "4000000000000002",+ card_exp_month: "03",+ card_exp_year: "30",+ card_holder_name: "joseph Doeeee",+ card_cvc: "737",+ card_network: "Visa",+ },+ },+ billing: billingAddress,+ currency: "EUR",+ },+ Response: blockedPaymentErrorBody,+ },+ BlockCardType: {+ Request: {+ payment_method: "card",+ payment_method_data: {+ card: {+ card_number: "4111111111111111",+ card_exp_month: "03",+ card_exp_year: "30",+ card_holder_name: "joseph Doeeee",+ card_cvc: "737",+ card_network: "Visa",+ },+ },+ billing: billingAddress,+ currency: "EUR",+ },+ Response: blockedPaymentErrorBody,+ },+ BlockCardSubtype: {+ Request: {+ payment_method: "card",+ payment_method_data: {+ card: {+ card_number: "378282246310005",+ card_exp_month: "03",+ card_exp_year: "30",+ card_holder_name: "joseph Doeeee",+ card_cvc: "737",+ card_network: "Visa",+ },+ },+ currency: "EUR",+ billing: billingAddress,+ },+ Response: blockedPaymentErrorBody,+ },+ BlockIfBinInfoUnavailable: {+ Request: {+ payment_method: "card",+ payment_method_data: {+ card: {+ card_number: "6304000000000000",+ card_exp_month: "03",+ card_exp_year: "30",+ card_holder_name: "joseph Doeeee",+ card_cvc: "737",+ card_network: "Visa",+ },+ },+ billing: billingAddress,+ currency: "EUR",+ },+ Response: blockedPaymentErrorBody,+ },+ },};diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.jsindex 14d7aa4063..8c1d6e46e8 100644--- a/cypress-tests/cypress/support/commands.js+++ b/cypress-tests/cypress/support/commands.js@@ -2621,21 +2621,24 @@ Cypress.Commands.add() {switch (response.body.payment_method_type) {case "pix":- expect(response.body)- .to.have.property("next_action")- .to.have.property("qr_code_url");- if (response.body.next_action.qr_code_url !== null) {- globalState.set(- "nextActionUrl", // This is intentionally kept as nextActionUrl to avoid issues during handleRedirection call,- response.body.next_action.qr_code_url- );- globalState.set("nextActionType", "qr_code_url");- } else {- globalState.set(- "nextActionUrl", // This is intentionally kept as nextActionUrl to avoid issues during handleRedirection call,- response.body.next_action.image_data_url- );- globalState.set("nextActionType", "image_data_url");+ // Skip qr_code_url validation for facilitapay connector+ if (globalState.get("connectorId") !== "facilitapay") {+ expect(response.body)+ .to.have.property("next_action")+ .to.have.property("qr_code_url");+ if (response.body.next_action.qr_code_url !== null) {+ globalState.set(+ "nextActionUrl", // This is intentionally kept as nextActionUrl to avoid issues during handleRedirection call,+ response.body.next_action.qr_code_url+ );+ globalState.set("nextActionType", "qr_code_url");+ } else {+ globalState.set(+ "nextActionUrl", // This is intentionally kept as nextActionUrl to avoid issues during handleRedirection call,+ response.body.next_action.image_data_url+ );+ globalState.set("nextActionType", "image_data_url");+ }}break;case "ach":