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

fix(cypress): fixed payment account reference for stripe (#14600)

Vasanth063bf0ca0fcb
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js b/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
index f572c733f1..5c10cffbff 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
@@ -45,7 +45,7 @@ const parPositiveCardDetails = {
card_cvc: "737",
};
-const parNegativeCardDetails = {
+const parAmexCardDetails = {
card_number: "378282246310005",
card_exp_month: "10",
card_exp_year: "50",
@@ -428,7 +428,7 @@ export const connectorDetails = {
Request: {
payment_method: "card",
payment_method_data: {
- card: parNegativeCardDetails,
+ card: parAmexCardDetails,
},
currency: "USD",
customer_acceptance: null,
@@ -438,7 +438,10 @@ export const connectorDetails = {
status: 200,
body: {
status: "succeeded",
- payment_account_reference: null,
+ // Stripe now returns a payment_account_reference for Amex cards as
+ // well (connector-side behaviour change), so this scenario also
+ // verifies that the PAR is populated.
+ payment_account_reference: "dynamic_par",
},
},
},
diff --git a/cypress-tests/cypress/e2e/spec/Payment/16-PaymentAccountReference.cy.js b/cypress-tests/cypress/e2e/spec/Payment/16-PaymentAccountReference.cy.js
index da4bd1b767..961ec4330f 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/16-PaymentAccountReference.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/16-PaymentAccountReference.cy.js
@@ -8,6 +8,15 @@ import getConnectorDetails, {
let globalState;
+// Stripe now returns a payment_account_reference (PAR) for Amex cards as well
+// (a Stripe-side behaviour change), so for Stripe this is a second positive
+// scenario. Connectors whose card returns no PAR keep the genuine negative
+// scenario.
+const parVariantContext =
+ Cypress.env("CONNECTOR") === "stripe"
+ ? "PAR positive - Amex card returning payment_account_reference"
+ : "PAR negative - card without payment_account_reference";
+
describe("Card - Payment Account Reference and auth_code validation", () => {
before("seed global state", function () {
let skip = false;
@@ -108,7 +117,7 @@ describe("Card - Payment Account Reference and auth_code validation", () => {
});
});
- context("PAR negative - card without payment_account_reference", () => {
+ context(parVariantContext, () => {
before(function () {
if (
shouldIncludeConnector(