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 payu cypress tests (#14385)
likhinbopannae12a94964a0a
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Payu.js b/cypress-tests/cypress/e2e/configs/Payment/Payu.jsindex f2353f6256..041f177a45 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Payu.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Payu.js@@ -76,6 +76,62 @@ const paymentMethodData = {billing: null,};+export const blockedPaymentErrorBodyForIssuingCountry = {+ status: 200,+ expectBlockedPayment: true,+ body: {+ error: {+ type: "blocked",+ message:+ "Cards issued in your region aren't supported for this transaction, please try a different card",+ code: "HE_03",+ reason: "Blocked",+ },+ },+};++export const blockedPaymentErrorBodyForDebitCard = {+ status: 200,+ expectBlockedPayment: true,+ body: {+ error: {+ type: "blocked",+ message:+ "Debit cards are not accepted for this transaction, please try a different card",+ code: "HE_03",+ reason: "Blocked",+ },+ },+};++export const blockedPaymentErrorBodyForCardSubtype = {+ status: 200,+ expectBlockedPayment: true,+ body: {+ error: {+ type: "blocked",+ message:+ "This card is not accepted for this transaction, please try a different card",+ code: "HE_03",+ reason: "Blocked",+ },+ },+};++export const blockedPaymentErrorBodyForBinUnavailable = {+ status: 200,+ expectBlockedPayment: true,+ body: {+ error: {+ type: "blocked",+ message:+ "We couldn't verify this card's information, please try a different card",+ code: "HE_03",+ reason: "Blocked",+ },+ },+};+export const connectorDetails = {card_pm: {PaymentIntent: {@@ -153,6 +209,7 @@ export const connectorDetails = {STATUS: true,TIMEOUT: 5000,},+ TRIGGER_SKIP: true, // status "processing" is returned for 3DSManualCapture flow},Request: {payment_method: "card",@@ -203,6 +260,7 @@ export const connectorDetails = {STATUS: true,TIMEOUT: 5000,},+ TRIGGER_SKIP: true, // status "processing" is returned for 3DSManualCapture flow},Request: {payment_method: "card",@@ -271,6 +329,11 @@ export const connectorDetails = {},},Capture: {+ Configs: {+ // Payu returns "pending" status on authorize and requires PSync to get the actual status,+ // hence the payment method status is not updated to "active" on retrieve+ skipPaymentMethodStatusAssertion: true,+ },Request: {amount_to_capture: 6000,},@@ -286,6 +349,11 @@ export const connectorDetails = {},},PartialCapture: {+ Configs: {+ // Payu returns "pending" status on authorize and requires PSync to get the actual status,+ // hence the payment method status is not updated to "active" on retrieve+ skipPaymentMethodStatusAssertion: true,+ },Request: {amount_to_capture: 2000,},@@ -614,6 +682,9 @@ export const connectorDetails = {STATUS: true,TIMEOUT: 5000,},+ // Payu returns "pending" status on authorize and requires PSync to get the actual status,+ // hence the payment method status is not updated to "active" on retrieve+ skipPaymentMethodStatusAssertion: true,},Request: {payment_method: "card",@@ -629,7 +700,6 @@ export const connectorDetails = {status: 200,body: {status: "processing",- payment_method_data: paymentMethodData,},},},@@ -723,6 +793,12 @@ export const connectorDetails = {},},SaveCardUseNo3DSManualCapture: {+ Configs: {+ // Payu returns "pending" status on authorize and requires PSync to get the actual status,+ // hence the payment method status is not updated to "active" on retrieve+ skipPaymentMethodStatusAssertion: true,+ TRIGGER_SKIP: true, // status "processing" is returned for No3DSManualCapture flow+ },Request: {payment_method: "card",payment_method_data: {@@ -831,5 +907,105 @@ export const connectorDetails = {},},},+ PaymentWithBilling: {+ Request: {+ currency: "USD",+ setup_future_usage: "on_session",+ billing: {+ address: {+ line1: "1467",+ line2: "CA",+ line3: "Harrison Street",+ city: "San Fransico",+ state: "CA",+ zip: "94122",+ country: "PL",+ first_name: "joseph",+ last_name: "Doe",+ },+ phone: {+ number: "9111222333",+ country_code: "+91",+ },+ },+ email: "[email protected]",+ },+ Response: {+ status: 200,+ body: {+ status: "requires_payment_method",+ },+ },+ },+ },+ 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: polishBillingAddress,+ },+ Response: blockedPaymentErrorBodyForIssuingCountry,+ },+ 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: polishBillingAddress,+ },+ Response: blockedPaymentErrorBodyForDebitCard,+ },+ 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",+ },+ },+ billing: polishBillingAddress,+ },+ Response: blockedPaymentErrorBodyForCardSubtype,+ },+ 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: polishBillingAddress,+ },+ Response: blockedPaymentErrorBodyForBinUnavailable,+ },},};diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex d92bd8d5fc..5478e8148e 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -86,9 +86,9 @@ import { connectorDetails as stripeConnectorDetails } from "./Stripe.js";import { connectorDetails as stripeconnectConnectorDetails } from "./StripeConnect.js";import { connectorDetails as tesouroConnectorDetails } from "./Tesouro.js";import { connectorDetails as truelayerConnectorDetails } from "./Truelayer.js";+import { connectorDetails as trustlyConnectorDetails } from "./Trustly.js";import { connectorDetails as trustpayConnectorDetails } from "./Trustpay.js";import { connectorDetails as trustpaymentsConnectorDetails } from "./TrustPayments.js";-import { connectorDetails as trustlyConnectorDetails } from "./Trustly.js";import { connectorDetails as tsysConnectorDetails } from "./Tsys.js";import { connectorDetails as tsysTransitConnectorDetails } from "./TsysTransit.js";import { connectorDetails as voltConnectorDetails } from "./Volt.js";@@ -584,7 +584,7 @@ export const CONNECTOR_LISTS = {// asserted as an expected error either — skip these save-card-confirm// tests in 40-ExternalVault.cy.js until the connector-service side// adds a fallback.- EXTERNAL_VAULT: ["fiservcommercehub", "ilixium", "finix"],+ EXTERNAL_VAULT: ["fiservcommercehub", "ilixium", "finix", "payu"],// Connectors that never return a `connector_mandate_id` on the payments// response. Recurring payments for them go through connector agnostic MIT,// so the "connector_mandate_id must not be null" assertion is skipped