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 assertions for `requires_cvv` (#7296)

likhinbopanna8457d3c0b49e
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index fc25220b80..2257b9ffe5 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -1275,6 +1275,7 @@ Cypress.Commands.add(
createPaymentBody.profile_id = profile_id;
globalState.set("paymentAmount", createPaymentBody.amount);
+ globalState.set("setupFutureUsage", createPaymentBody.setup_future_usage);
cy.request({
method: "POST",
@@ -3054,6 +3055,7 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState) => {
Cypress.Commands.add("listCustomerPMByClientSecret", (globalState) => {
const clientSecret = globalState.get("clientSecret");
+ const setupFutureUsage = globalState.get("setupFutureUsage");
cy.request({
method: "GET",
@@ -3078,6 +3080,18 @@ Cypress.Commands.add("listCustomerPMByClientSecret", (globalState) => {
response.body.customer_payment_methods[0].payment_method_id,
"payment_method_id"
).to.not.be.null;
+
+ if (setupFutureUsage === "off_session") {
+ expect(
+ response.body.customer_payment_methods[0].requires_cvv,
+ "requires_cvv"
+ ).to.be.false;
+ } else if (setupFutureUsage === "on_session") {
+ expect(
+ response.body.customer_payment_methods[0].requires_cvv,
+ "requires_cvv"
+ ).to.be.true;
+ }
} else {
// We only get an empty array if something's wrong. One exception is a 4xx when no customer exist but it is handled in the test
expect(response.body)