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): log `x-request-id` for failed requests (#7118)

likhinbopanna05c81a704cbb
diff --git a/.github/data/cards_info.csv b/.github/data/cards_info.csv
index 4e7a19e4b2..f358214cc9 100644
--- a/.github/data/cards_info.csv
+++ b/.github/data/cards_info.csv
@@ -11,3 +11,4 @@ card_iin,card_issuer,card_network,card_type,card_subtype,card_issuing_country,ba
491761,BANKPOLSKAKASAOPIEKIS.A.(BANKPEKAOSA),Visa,CREDIT,BUSINESS,POLAND,,,,2015-09-07 12:58:50,,
510510,BANKOFHAWAII,Mastercard,CREDIT,,UNITEDSTATES,,,,2015-07-30 05:18:28,,
520474,MASTERCARD INTERNATIONAL,Visa,DEBIT,,UNITEDSTATES,,,840,2016-05-12 18:51:16,2022-12-12 15:17:33,Visa
+378282,AmericanExpress,AmericanExpress,CREDIT,SMALLCORPORATE,INDIA,107,JP_AMEX,,2015-07-25 06:22:06,2021-02-23 07:37:55,
\ No newline at end of file
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js b/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
index 1bfc1bff97..d4d3c30fe2 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Stripe.js
@@ -5,7 +5,7 @@ import {
import { getCustomExchange } from "./Modifiers";
const successfulNo3DSCardDetails = {
- card_number: "4242424242424242",
+ card_number: "378282246310005",
card_exp_month: "10",
card_exp_year: "50",
card_holder_name: "morino",
@@ -82,12 +82,12 @@ const payment_method_data_3ds = {
const payment_method_data_no3ds = {
card: {
- last4: "4242",
+ last4: "0005",
card_type: "CREDIT",
- card_network: "Visa",
- card_issuer: "STRIPE PAYMENTS UK LIMITED",
- card_issuing_country: "UNITEDKINGDOM",
- card_isin: "424242",
+ card_network: "AmericanExpress",
+ card_issuer: "AmericanExpress",
+ card_issuing_country: "INDIA",
+ card_isin: "378282",
card_extended_bin: null,
card_exp_month: "10",
card_exp_year: "50",
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index 9d01f924b5..60691899f7 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -63,13 +63,15 @@ Cypress.Commands.add("healthCheck", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.body).to.equal("health is good");
- } else {
- throw new Error(
- `Health Check failed with status: \`${response.status}\` and body: \`${response.body}\``
- );
- }
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(response.body).to.equal("health is good");
+ } else {
+ throw new Error(
+ `Health Check failed with status: \`${response.status}\` and body: \`${response.body}\``
+ );
+ }
+ });
});
});
@@ -92,10 +94,12 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- // Handle the response as needed
- globalState.set("profileId", response.body.default_profile);
- globalState.set("publishableKey", response.body.publishable_key);
- globalState.set("merchantDetails", response.body.merchant_details);
+ cy.wrap(response).then(() => {
+ // Handle the response as needed
+ globalState.set("profileId", response.body.default_profile);
+ globalState.set("publishableKey", response.body.publishable_key);
+ globalState.set("merchantDetails", response.body.merchant_details);
+ });
});
}
);
@@ -114,17 +118,19 @@ Cypress.Commands.add("merchantRetrieveCall", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.merchant_id).to.equal(merchant_id);
- expect(response.body.payment_response_hash_key).to.not.be.empty;
- expect(response.body.publishable_key).to.not.be.empty;
- expect(response.body.default_profile).to.not.be.empty;
- expect(response.body.organization_id).to.not.be.empty;
- globalState.set("organizationId", response.body.organization_id);
-
- if (globalState.get("publishableKey") === undefined) {
- globalState.set("publishableKey", response.body.publishable_key);
- }
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.merchant_id).to.equal(merchant_id);
+ expect(response.body.payment_response_hash_key).to.not.be.empty;
+ expect(response.body.publishable_key).to.not.be.empty;
+ expect(response.body.default_profile).to.not.be.empty;
+ expect(response.body.organization_id).to.not.be.empty;
+ globalState.set("organizationId", response.body.organization_id);
+
+ if (globalState.get("publishableKey") === undefined) {
+ globalState.set("publishableKey", response.body.publishable_key);
+ }
+ });
});
});
@@ -141,8 +147,10 @@ Cypress.Commands.add("merchantDeleteCall", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.body.merchant_id).to.equal(merchant_id);
- expect(response.body.deleted).to.equal(true);
+ cy.wrap(response).then(() => {
+ expect(response.body.merchant_id).to.equal(merchant_id);
+ expect(response.body.deleted).to.equal(true);
+ });
});
});
@@ -159,12 +167,15 @@ Cypress.Commands.add("ListConnectorsFeatureMatrixCall", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.body).to.have.property("connectors").and.not.empty;
- expect(response.body.connectors).to.be.an("array").and.not.empty;
- response.body.connectors.forEach((item) => {
- expect(item).to.have.property("description").and.not.empty;
- expect(item).to.have.property("category").and.not.empty;
- expect(item).to.have.property("supported_payment_methods").and.not.empty;
+ cy.wrap(response).then(() => {
+ expect(response.body).to.have.property("connectors").and.not.empty;
+ expect(response.body.connectors).to.be.an("array").and.not.empty;
+ response.body.connectors.forEach((item) => {
+ expect(item).to.have.property("description").and.not.empty;
+ expect(item).to.have.property("category").and.not.empty;
+ expect(item).to.have.property("supported_payment_methods").and.not
+ .empty;
+ });
});
});
});
@@ -182,14 +193,18 @@ Cypress.Commands.add("merchantListCall", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- for (const key in response.body) {
- expect(response.body[key]).to.have.property("merchant_id").and.not.empty;
- expect(response.body[key]).to.have.property("organization_id").and.not
- .empty;
- expect(response.body[key]).to.have.property("default_profile").and.not
- .empty;
- }
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ for (const key in response.body) {
+ expect(response.body[key]).to.have.property("merchant_id").and.not
+ .empty;
+ expect(response.body[key]).to.have.property("organization_id").and.not
+ .empty;
+ expect(response.body[key]).to.have.property("default_profile").and.not
+ .empty;
+ }
+ });
});
});
@@ -214,11 +229,14 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.merchant_id).to.equal(merchant_id);
- expect(response.body.publishable_key).to.equal(publishable_key);
- expect(response.body.organization_id).to.equal(organization_id);
- expect(response.body.merchant_details).to.not.equal(merchant_details);
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.merchant_id).to.equal(merchant_id);
+ expect(response.body.publishable_key).to.equal(publishable_key);
+ expect(response.body.organization_id).to.equal(organization_id);
+ expect(response.body.merchant_details).to.not.equal(merchant_details);
+ });
});
}
);
@@ -248,15 +266,16 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- globalState.set(`${profilePrefix}Id`, response.body.profile_id);
-
- if (response.status === 200) {
- expect(response.body.profile_id).to.not.to.be.null;
- } else {
- throw new Error(
- `Business Profile call failed ${response.body.error.message}`
- );
- }
+ cy.wrap(response).then(() => {
+ globalState.set(`${profilePrefix}Id`, response.body.profile_id);
+ if (response.status === 200) {
+ expect(response.body.profile_id).to.not.to.be.null;
+ } else {
+ throw new Error(
+ `Business Profile call failed ${response.body.error.message}`
+ );
+ }
+ });
});
}
);
@@ -300,24 +319,27 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- globalState.set(
- "collectBillingDetails",
- response.body.collect_billing_details_from_wallet_connector
- );
- globalState.set(
- "collectShippingDetails",
- response.body.collect_shipping_details_from_wallet_connector
- );
- globalState.set(
- "alwaysCollectBillingDetails",
- response.body.always_collect_billing_details_from_wallet_connector
- );
- globalState.set(
- "alwaysCollectShippingDetails",
- response.body.always_collect_shipping_details_from_wallet_connector
- );
- }
+
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ globalState.set(
+ "collectBillingDetails",
+ response.body.collect_billing_details_from_wallet_connector
+ );
+ globalState.set(
+ "collectShippingDetails",
+ response.body.collect_shipping_details_from_wallet_connector
+ );
+ globalState.set(
+ "alwaysCollectBillingDetails",
+ response.body.always_collect_billing_details_from_wallet_connector
+ );
+ globalState.set(
+ "alwaysCollectShippingDetails",
+ response.body.always_collect_shipping_details_from_wallet_connector
+ );
+ }
+ });
});
}
);
@@ -351,24 +373,28 @@ Cypress.Commands.add("apiKeyCreateTest", (apiKeyCreateBody, globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.body.merchant_id).to.equal(merchantId);
- expect(response.body.description).to.equal(apiKeyCreateBody.description);
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(response.body.merchant_id).to.equal(merchantId);
+ expect(response.body.description).to.equal(
+ apiKeyCreateBody.description
+ );
- // API Key assertions are intentionally excluded to avoid being exposed in the logs
- expect(response.body).to.have.property(keyIdType).and.to.include(keyId)
- .and.to.not.be.empty;
+ // API Key assertions are intentionally excluded to avoid being exposed in the logs
+ expect(response.body).to.have.property(keyIdType).and.to.include(keyId)
+ .and.to.not.be.empty;
- globalState.set("apiKeyId", response.body.key_id);
- globalState.set("apiKey", response.body.api_key);
+ globalState.set("apiKeyId", response.body.key_id);
+ globalState.set("apiKey", response.body.api_key);
- cy.task("setGlobalState", globalState.data);
- } else {
- // to be updated
- throw new Error(
- `API Key create call failed with status ${response.status} and message: "${response.body.error.message}"`
- );
- }
+ cy.task("setGlobalState", globalState.data);
+ } else {
+ // to be updated
+ throw new Error(
+ `API Key create call failed with status ${response.status} and message: "${response.body.error.message}"`
+ );
+ }
+ });
});
});
@@ -395,18 +421,20 @@ Cypress.Commands.add("apiKeyUpdateCall", (apiKeyUpdateBody, globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.body.name).to.equal("Updated API Key");
- expect(response.body.merchant_id).to.equal(merchantId);
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(response.body.name).to.equal("Updated API Key");
+ expect(response.body.merchant_id).to.equal(merchantId);
- // API Key assertions are intentionally excluded to avoid being exposed in the logs
- expect(response.body.key_id).to.equal(apiKeyId);
- } else {
- // to be updated
- throw new Error(
- `API Key create call failed with status ${response.status} and message: "${response.body.error.message}"`
- );
- }
+ // API Key assertions are intentionally excluded to avoid being exposed in the logs
+ expect(response.body.key_id).to.equal(apiKeyId);
+ } else {
+ // to be updated
+ throw new Error(
+ `API Key create call failed with status ${response.status} and message: "${response.body.error.message}"`
+ );
+ }
+ });
});
});
@@ -426,10 +454,12 @@ Cypress.Commands.add("apiKeyRetrieveCall", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.name).to.equal("Updated API Key");
- expect(response.body.key_id).to.equal(api_key_id);
- expect(response.body.merchant_id).to.equal(merchant_id);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.name).to.equal("Updated API Key");
+ expect(response.body.key_id).to.equal(api_key_id);
+ expect(response.body.merchant_id).to.equal(merchant_id);
+ });
});
});
@@ -447,19 +477,21 @@ Cypress.Commands.add("apiKeyListCall", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body).to.be.an("array").and.not.empty;
- for (const key in response.body) {
- expect(response.body[key]).to.have.property("name").and.not.empty;
- if (base_url.includes("sandbox") || base_url.includes("integ")) {
- expect(response.body[key]).to.have.property("key_id").include("snd_")
- .and.not.empty;
- } else if (base_url.includes("localhost")) {
- expect(response.body[key]).to.have.property("key_id").include("dev_")
- .and.not.empty;
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body).to.be.an("array").and.not.empty;
+ for (const key in response.body) {
+ expect(response.body[key]).to.have.property("name").and.not.empty;
+ if (base_url.includes("sandbox") || base_url.includes("integ")) {
+ expect(response.body[key]).to.have.property("key_id").include("snd_")
+ .and.not.empty;
+ } else if (base_url.includes("localhost")) {
+ expect(response.body[key]).to.have.property("key_id").include("dev_")
+ .and.not.empty;
+ }
+ expect(response.body[key].merchant_id).to.equal(merchant_id);
}
- expect(response.body[key].merchant_id).to.equal(merchant_id);
- }
+ });
});
});
@@ -479,10 +511,12 @@ Cypress.Commands.add("apiKeyDeleteCall", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.merchant_id).to.equal(merchant_id);
- expect(response.body.key_id).to.equal(api_key_id);
- expect(response.body.revoked).to.equal(true);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.merchant_id).to.equal(merchant_id);
+ expect(response.body.key_id).to.equal(api_key_id);
+ expect(response.body.revoked).to.equal(true);
+ });
});
});
@@ -529,22 +563,24 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(connectorName).to.equal(response.body.connector_name);
- globalState.set(
- `${mcaPrefix}Id`,
- response.body.merchant_connector_id
- );
- } else {
- cy.task(
- "cli_log",
- "response status -> " + JSON.stringify(response.status)
- );
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(connectorName).to.equal(response.body.connector_name);
+ globalState.set(
+ `${mcaPrefix}Id`,
+ response.body.merchant_connector_id
+ );
+ } else {
+ cy.task(
+ "cli_log",
+ "response status -> " + JSON.stringify(response.status)
+ );
- throw new Error(
- `Connector Create Call Failed ${response.body.error.message}`
- );
- }
+ throw new Error(
+ `Connector Create Call Failed ${response.body.error.message}`
+ );
+ }
+ });
});
}
);
@@ -614,24 +650,26 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(globalState.get("connectorId")).to.equal(
- response.body.connector_name
- );
- globalState.set(
- `${mcaPrefix}Id`,
- response.body.merchant_connector_id
- );
- } else {
- cy.task(
- "cli_log",
- "response status -> " + JSON.stringify(response.status)
- );
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(globalState.get("connectorId")).to.equal(
+ response.body.connector_name
+ );
+ globalState.set(
+ `${mcaPrefix}Id`,
+ response.body.merchant_connector_id
+ );
+ } else {
+ cy.task(
+ "cli_log",
+ "response status -> " + JSON.stringify(response.status)
+ );
- throw new Error(
- `Connector Create Call Failed ${response.body.error.message}`
- );
- }
+ throw new Error(
+ `Connector Create Call Failed ${response.body.error.message}`
+ );
+ }
+ });
});
}
);
@@ -688,24 +726,26 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(globalState.get("connectorId")).to.equal(
- response.body.connector_name
- );
- globalState.set(
- "merchantConnectorId",
- response.body.merchant_connector_id
- );
- } else {
- cy.task(
- "cli_log",
- "response status -> " + JSON.stringify(response.status)
- );
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(globalState.get("connectorId")).to.equal(
+ response.body.connector_name
+ );
+ globalState.set(
+ "merchantConnectorId",
+ response.body.merchant_connector_id
+ );
+ } else {
+ cy.task(
+ "cli_log",
+ "response status -> " + JSON.stringify(response.status)
+ );
- throw new Error(
- `Connector Create Call Failed ${response.body.error.message}`
- );
- }
+ throw new Error(
+ `Connector Create Call Failed ${response.body.error.message}`
+ );
+ }
+ });
});
}
);
@@ -729,9 +769,14 @@ Cypress.Commands.add("connectorRetrieveCall", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.connector_name).to.equal(connector_id);
- expect(response.body.merchant_connector_id).to.equal(merchant_connector_id);
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.connector_name).to.equal(connector_id);
+ expect(response.body.merchant_connector_id).to.equal(
+ merchant_connector_id
+ );
+ });
});
});
@@ -750,9 +795,13 @@ Cypress.Commands.add("connectorDeleteCall", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.body.merchant_id).to.equal(merchant_id);
- expect(response.body.merchant_connector_id).to.equal(merchant_connector_id);
- expect(response.body.deleted).to.equal(true);
+ cy.wrap(response).then(() => {
+ expect(response.body.merchant_id).to.equal(merchant_id);
+ expect(response.body.merchant_connector_id).to.equal(
+ merchant_connector_id
+ );
+ expect(response.body.deleted).to.equal(true);
+ });
});
});
@@ -783,12 +832,15 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.connector_name).to.equal(connector_id);
- expect(response.body.merchant_connector_id).to.equal(
- merchant_connector_id
- );
- expect(response.body.connector_label).to.equal(connectorLabel);
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.connector_name).to.equal(connector_id);
+ expect(response.body.merchant_connector_id).to.equal(
+ merchant_connector_id
+ );
+ expect(response.body.connector_label).to.equal(connectorLabel);
+ });
});
}
);
@@ -807,12 +859,15 @@ Cypress.Commands.add("connectorListByMid", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body).to.be.an("array").and.not.empty;
- response.body.forEach((item) => {
- expect(item).to.not.have.property("metadata");
- expect(item).to.not.have.property("additional_merchant_data");
- expect(item).to.not.have.property("connector_wallets_details");
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body).to.be.an("array").and.not.empty;
+ response.body.forEach((item) => {
+ expect(item).to.not.have.property("metadata");
+ expect(item).to.not.have.property("additional_merchant_data");
+ expect(item).to.not.have.property("connector_wallets_details");
+ });
});
});
});
@@ -831,20 +886,23 @@ Cypress.Commands.add(
}).then((response) => {
globalState.set("customerId", response.body.customer_id);
logRequestId(response.headers["x-request-id"]);
- expect(response.body.customer_id, "customer_id").to.not.be.empty;
- expect(customerCreateBody.email, "email").to.equal(response.body.email);
- expect(customerCreateBody.name, "name").to.equal(response.body.name);
- expect(customerCreateBody.phone, "phone").to.equal(response.body.phone);
- expect(customerCreateBody.metadata, "metadata").to.deep.equal(
- response.body.metadata
- );
- expect(customerCreateBody.address, "address").to.deep.equal(
- response.body.address
- );
- expect(
- customerCreateBody.phone_country_code,
- "phone_country_code"
- ).to.equal(response.body.phone_country_code);
+
+ cy.wrap(response).then(() => {
+ expect(response.body.customer_id, "customer_id").to.not.be.empty;
+ expect(customerCreateBody.email, "email").to.equal(response.body.email);
+ expect(customerCreateBody.name, "name").to.equal(response.body.name);
+ expect(customerCreateBody.phone, "phone").to.equal(response.body.phone);
+ expect(customerCreateBody.metadata, "metadata").to.deep.equal(
+ response.body.metadata
+ );
+ expect(customerCreateBody.address, "address").to.deep.equal(
+ response.body.address
+ );
+ expect(
+ customerCreateBody.phone_country_code,
+ "phone_country_code"
+ ).to.equal(response.body.phone_country_code);
+ });
});
}
);
@@ -860,9 +918,12 @@ Cypress.Commands.add("customerListCall", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- for (const key in response.body) {
- expect(response.body[key]).to.not.be.empty;
- }
+
+ cy.wrap(response).then(() => {
+ for (const key in response.body) {
+ expect(response.body[key]).to.not.be.empty;
+ }
+ });
});
});
@@ -879,7 +940,10 @@ Cypress.Commands.add("customerRetrieveCall", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.body.customer_id).to.equal(customer_id).and.not.be.empty;
+
+ cy.wrap(response).then(() => {
+ expect(response.body.customer_id).to.equal(customer_id).and.not.be.empty;
+ });
});
});
@@ -899,7 +963,10 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.body.customer_id).to.equal(customer_id);
+
+ cy.wrap(response).then(() => {
+ expect(response.body.customer_id).to.equal(customer_id);
+ });
});
}
);
@@ -919,10 +986,13 @@ Cypress.Commands.add("ephemeralGenerateCall", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.body.customer_id).to.equal(customer_id);
- expect(response.body.merchant_id).to.equal(merchant_id);
- expect(response.body.id).to.exist.and.not.be.empty;
- expect(response.body.secret).to.exist.and.not.be.empty;
+
+ cy.wrap(response).then(() => {
+ expect(response.body.customer_id).to.equal(customer_id);
+ expect(response.body.merchant_id).to.equal(merchant_id);
+ expect(response.body.id).to.exist.and.not.be.empty;
+ expect(response.body.secret).to.exist.and.not.be.empty;
+ });
});
});
@@ -939,10 +1009,13 @@ Cypress.Commands.add("customerDeleteCall", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.body.customer_id).to.equal(customer_id).and.not.be.empty;
- expect(response.body.customer_deleted).to.equal(true);
- expect(response.body.address_deleted).to.equal(true);
- expect(response.body.payment_methods_deleted).to.equal(true);
+
+ cy.wrap(response).then(() => {
+ expect(response.body.customer_id).to.equal(customer_id).and.not.be.empty;
+ expect(response.body.customer_deleted).to.equal(true);
+ expect(response.body.address_deleted).to.equal(true);
+ expect(response.body.payment_methods_deleted).to.equal(true);
+ });
});
});
@@ -960,24 +1033,27 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- expect(response.body).to.have.property("currency");
- if (resData["payment_methods"].length == 1) {
- function getPaymentMethodType(obj) {
- return obj["payment_methods"][0]["payment_method_types"][0][
- "payment_method_type"
- ];
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ expect(response.body).to.have.property("currency");
+ if (resData["payment_methods"].length == 1) {
+ function getPaymentMethodType(obj) {
+ return obj["payment_methods"][0]["payment_method_types"][0][
+ "payment_method_type"
+ ];
+ }
+ expect(getPaymentMethodType(resData)).to.equal(
+ getPaymentMethodType(response.body)
+ );
+ } else {
+ expect(0).to.equal(response.body["payment_methods"].length);
}
- expect(getPaymentMethodType(resData)).to.equal(
- getPaymentMethodType(response.body)
- );
} else {
- expect(0).to.equal(response.body["payment_methods"].length);
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -1001,41 +1077,43 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- const responsePaymentMethods = response.body["payment_methods"];
- const responseRequiredFields =
- responsePaymentMethods[0]["payment_method_types"][0][
- "required_fields"
- ];
-
- const expectedRequiredFields =
- data["payment_methods"][0]["payment_method_types"][0][
- "required_fields"
- ];
-
- Object.keys(expectedRequiredFields).forEach((key) => {
- const expectedField = expectedRequiredFields[key];
- const responseField = responseRequiredFields[key];
-
- expect(responseField).to.exist;
- expect(responseField.required_field).to.equal(
- expectedField.required_field
- );
- expect(responseField.display_name).to.equal(
- expectedField.display_name
- );
- expect(responseField.field_type).to.deep.equal(
- expectedField.field_type
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ const responsePaymentMethods = response.body["payment_methods"];
+ const responseRequiredFields =
+ responsePaymentMethods[0]["payment_method_types"][0][
+ "required_fields"
+ ];
+
+ const expectedRequiredFields =
+ data["payment_methods"][0]["payment_method_types"][0][
+ "required_fields"
+ ];
+
+ Object.keys(expectedRequiredFields).forEach((key) => {
+ const expectedField = expectedRequiredFields[key];
+ const responseField = responseRequiredFields[key];
+
+ expect(responseField).to.exist;
+ expect(responseField.required_field).to.equal(
+ expectedField.required_field
+ );
+ expect(responseField.display_name).to.equal(
+ expectedField.display_name
+ );
+ expect(responseField.field_type).to.deep.equal(
+ expectedField.field_type
+ );
+ expect(responseField.value).to.equal(expectedField.value);
+ });
+ } else {
+ throw new Error(
+ `List payment methods failed with status code "${response.status}" and error message "${response.body.error.message}"`
);
- expect(responseField.value).to.equal(expectedField.value);
- });
- } else {
- throw new Error(
- `List payment methods failed with status code "${response.status}" and error message "${response.body.error.message}"`
- );
- }
+ }
+ });
});
}
);
@@ -1054,32 +1132,35 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- expect(response.body).to.have.property("currency");
- if (resData["payment_methods"].length > 0) {
- function getPaymentMethodType(obj) {
- return obj["payment_methods"][0]["payment_method_types"][0][
- "card_networks"
- ][0]["eligible_connectors"]
- .slice()
- .sort();
- }
- const config_payment_method_type = getPaymentMethodType(resData);
- const response_payment_method_type = getPaymentMethodType(
- response.body
- );
- for (let i = 0; i < response_payment_method_type.length; i++) {
- expect(config_payment_method_type[i]).to.equal(
- response_payment_method_type[i]
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ expect(response.body).to.have.property("currency");
+ if (resData["payment_methods"].length > 0) {
+ function getPaymentMethodType(obj) {
+ return obj["payment_methods"][0]["payment_method_types"][0][
+ "card_networks"
+ ][0]["eligible_connectors"]
+ .slice()
+ .sort();
+ }
+ const config_payment_method_type = getPaymentMethodType(resData);
+ const response_payment_method_type = getPaymentMethodType(
+ response.body
);
+ for (let i = 0; i < response_payment_method_type.length; i++) {
+ expect(config_payment_method_type[i]).to.equal(
+ response_payment_method_type[i]
+ );
+ }
+ } else {
+ expect(0).to.equal(response.body["payment_methods"].length);
}
} else {
- expect(0).to.equal(response.body["payment_methods"].length);
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -1107,30 +1188,32 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- const expectedTokens = resData.body.session_token;
- const actualTokens = response.body.session_token;
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ const expectedTokens = resData.body.session_token;
+ const actualTokens = response.body.session_token;
- // Verifying length of array
- expect(actualTokens.length, "arrayLength").to.equal(
- expectedTokens.length
- );
+ // Verifying length of array
+ expect(actualTokens.length, "arrayLength").to.equal(
+ expectedTokens.length
+ );
- // Verify specific fields in each session_token object
- expectedTokens.forEach((expectedToken, index) => {
- const actualToken = actualTokens[index];
+ // Verify specific fields in each session_token object
+ expectedTokens.forEach((expectedToken, index) => {
+ const actualToken = actualTokens[index];
- // Check specific fields only
- expect(actualToken.wallet_name, "wallet_name").to.equal(
- expectedToken.wallet_name
- );
- expect(actualToken.connector, "connector").to.equal(
- expectedToken.connector
- );
- });
- } else {
- defaultErrorHandler(response, resData);
- }
+ // Check specific fields only
+ expect(actualToken.wallet_name, "wallet_name").to.equal(
+ expectedToken.wallet_name
+ );
+ expect(actualToken.connector, "connector").to.equal(
+ expectedToken.connector
+ );
+ });
+ } else {
+ defaultErrorHandler(response, resData);
+ }
+ });
});
}
);
@@ -1186,91 +1269,95 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
-
- if (resData.status === 200) {
- expect(response.body).to.have.property("client_secret");
- const clientSecret = response.body.client_secret;
- globalState.set("clientSecret", clientSecret);
- globalState.set("paymentID", response.body.payment_id);
- cy.log(clientSecret);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(
- response.body[key],
- `Expected ${resData.body[key]} but got ${response.body[key]}`
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (resData.status === 200) {
+ expect(response.body).to.have.property("client_secret");
+ const clientSecret = response.body.client_secret;
+ globalState.set("clientSecret", clientSecret);
+ globalState.set("paymentID", response.body.payment_id);
+ cy.log(clientSecret);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(
+ response.body[key],
+ `Expected ${resData.body[key]} but got ${response.body[key]}`
+ );
+ }
+ expect(response.body.payment_id, "payment_id").to.not.be.null;
+ expect(response.body.merchant_id, "merchant_id").to.not.be.null;
+ expect(createPaymentBody.amount, "amount").to.equal(
+ response.body.amount
);
- }
- expect(response.body.payment_id, "payment_id").to.not.be.null;
- expect(response.body.merchant_id, "merchant_id").to.not.be.null;
- expect(createPaymentBody.amount, "amount").to.equal(
- response.body.amount
- );
- expect(createPaymentBody.currency, "currency").to.equal(
- response.body.currency
- );
- expect(createPaymentBody.capture_method, "capture_method").to.equal(
- response.body.capture_method
- );
- expect(
- createPaymentBody.authentication_type,
- "authentication_type"
- ).to.equal(response.body.authentication_type);
- expect(createPaymentBody.description, "description").to.equal(
- response.body.description
- );
- expect(createPaymentBody.email, "email").to.equal(response.body.email);
- expect(createPaymentBody.email, "customer.email").to.equal(
- response.body.customer.email
- );
- expect(createPaymentBody.customer_id, "customer.id").to.equal(
- response.body.customer.id
- );
- expect(createPaymentBody.metadata, "metadata").to.deep.equal(
- response.body.metadata
- );
- expect(
- createPaymentBody.setup_future_usage,
- "setup_future_usage"
- ).to.equal(response.body.setup_future_usage);
- // If 'shipping_cost' is not included in the request, the 'amount' in 'createPaymentBody' should match the 'amount_capturable' in the response.
- if (typeof createPaymentBody?.shipping_cost === "undefined") {
- expect(createPaymentBody.amount, "amount_capturable").to.equal(
- response.body.amount_capturable
+ expect(createPaymentBody.currency, "currency").to.equal(
+ response.body.currency
+ );
+ expect(createPaymentBody.capture_method, "capture_method").to.equal(
+ response.body.capture_method
);
- } else {
expect(
- createPaymentBody.amount + createPaymentBody.shipping_cost,
- "amount_capturable"
- ).to.equal(response.body.amount_capturable);
- }
- expect(response.body.amount_received, "amount_received").to.be.oneOf([
- 0,
- null,
- ]);
- expect(response.body.connector, "connector").to.be.null;
- expect(createPaymentBody.capture_method, "capture_method").to.equal(
- response.body.capture_method
- );
- expect(response.body.payment_method, "payment_method").to.be.null;
- expect(response.body.payment_method_data, "payment_method_data").to.be
- .null;
- expect(response.body.merchant_connector_id, "merchant_connector_id").to
- .be.null;
- expect(response.body.payment_method_id, "payment_method_id").to.be.null;
- expect(response.body.payment_method_id, "payment_method_status").to.be
- .null;
- expect(response.body.profile_id, "profile_id").to.not.be.null;
- expect(
- response.body.merchant_order_reference_id,
- "merchant_order_reference_id"
- ).to.be.null;
- expect(response.body.connector_mandate_id, "connector_mandate_id").to.be
- .null;
+ createPaymentBody.authentication_type,
+ "authentication_type"
+ ).to.equal(response.body.authentication_type);
+ expect(createPaymentBody.description, "description").to.equal(
+ response.body.description
+ );
+ expect(createPaymentBody.email, "email").to.equal(
+ response.body.email
+ );
+ expect(createPaymentBody.email, "customer.email").to.equal(
+ response.body.customer.email
+ );
+ expect(createPaymentBody.customer_id, "customer.id").to.equal(
+ response.body.customer.id
+ );
+ expect(createPaymentBody.metadata, "metadata").to.deep.equal(
+ response.body.metadata
+ );
+ expect(
+ createPaymentBody.setup_future_usage,
+ "setup_future_usage"
+ ).to.equal(response.body.setup_future_usage);
+ // If 'shipping_cost' is not included in the request, the 'amount' in 'createPaymentBody' should match the 'amount_capturable' in the response.
+ if (typeof createPaymentBody?.shipping_cost === "undefined") {
+ expect(createPaymentBody.amount, "amount_capturable").to.equal(
+ response.body.amount_capturable
+ );
+ } else {
+ expect(
+ createPaymentBody.amount + createPaymentBody.shipping_cost,
+ "amount_capturable"
+ ).to.equal(response.body.amount_capturable);
+ }
+ expect(response.body.amount_received, "amount_received").to.be.oneOf([
+ 0,
+ null,
+ ]);
+ expect(response.body.connector, "connector").to.be.null;
+ expect(createPaymentBody.capture_method, "capture_method").to.equal(
+ response.body.capture_method
+ );
+ expect(response.body.payment_method, "payment_method").to.be.null;
+ expect(response.body.payment_method_data, "payment_method_data").to.be
+ .null;
+ expect(response.body.merchant_connector_id, "merchant_connector_id")
+ .to.be.null;
+ expect(response.body.payment_method_id, "payment_method_id").to.be
+ .null;
+ expect(response.body.payment_method_id, "payment_method_status").to.be
+ .null;
+ expect(response.body.profile_id, "profile_id").to.not.be.null;
+ expect(
+ response.body.merchant_order_reference_id,
+ "merchant_order_reference_id"
+ ).to.be.null;
+ expect(response.body.connector_mandate_id, "connector_mandate_id").to
+ .be.null;
- validateErrorMessage(response, resData);
- } else {
- defaultErrorHandler(response, resData);
- }
+ validateErrorMessage(response, resData);
+ } else {
+ defaultErrorHandler(response, resData);
+ }
+ });
});
}
);
@@ -1289,38 +1376,40 @@ Cypress.Commands.add("paymentMethodsCallTest", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body).to.have.property("redirect_url");
- expect(response.body).to.have.property("payment_methods");
- if (
- globalState.get("collectBillingDetails") === true ||
- globalState.get("alwaysCollectBillingDetails") === true
- ) {
- expect(
- response.body.collect_billing_details_from_wallets,
- "collectBillingDetailsFromWallets"
- ).to.be.true;
- } else
- expect(
- response.body.collect_billing_details_from_wallets,
- "collectBillingDetailsFromWallets"
- ).to.be.false;
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body).to.have.property("redirect_url");
+ expect(response.body).to.have.property("payment_methods");
+ if (
+ globalState.get("collectBillingDetails") === true ||
+ globalState.get("alwaysCollectBillingDetails") === true
+ ) {
+ expect(
+ response.body.collect_billing_details_from_wallets,
+ "collectBillingDetailsFromWallets"
+ ).to.be.true;
+ } else
+ expect(
+ response.body.collect_billing_details_from_wallets,
+ "collectBillingDetailsFromWallets"
+ ).to.be.false;
- if (
- globalState.get("collectShippingDetails") === true ||
- globalState.get("alwaysCollectShippingDetails") === true
- ) {
- expect(
- response.body.collect_shipping_details_from_wallets,
- "collectShippingDetailsFromWallets"
- ).to.be.true;
- } else
- expect(
- response.body.collect_shipping_details_from_wallets,
- "collectShippingDetailsFromWallets"
- ).to.be.false;
- globalState.set("paymentID", paymentIntentID);
- cy.log(response);
+ if (
+ globalState.get("collectShippingDetails") === true ||
+ globalState.get("alwaysCollectShippingDetails") === true
+ ) {
+ expect(
+ response.body.collect_shipping_details_from_wallets,
+ "collectShippingDetailsFromWallets"
+ ).to.be.true;
+ } else
+ expect(
+ response.body.collect_shipping_details_from_wallets,
+ "collectShippingDetailsFromWallets"
+ ).to.be.false;
+ globalState.set("paymentID", paymentIntentID);
+ cy.log(response);
+ });
});
});
@@ -1343,28 +1432,30 @@ Cypress.Commands.add("createPaymentMethodTest", (globalState, data) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- expect(response.body.client_secret, "client_secret").to.include(
- "_secret_"
- ).and.to.not.be.null;
- expect(response.body.payment_method_id, "payment_method_id").to.not.be
- .null;
- expect(response.body.merchant_id, "merchant_id").to.equal(merchant_id);
- expect(reqData.payment_method_type, "payment_method_type").to.equal(
- response.body.payment_method_type
- );
- expect(reqData.payment_method, "payment_method").to.equal(
- response.body.payment_method
- );
- expect(response.body.last_used_at, "last_used_at").to.not.be.null;
- expect(reqData.customer_id, "customer_id").to.equal(
- response.body.customer_id
- );
- globalState.set("paymentMethodId", response.body.payment_method_id);
- } else {
- defaultErrorHandler(response, resData);
- }
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ expect(response.body.client_secret, "client_secret").to.include(
+ "_secret_"
+ ).and.to.not.be.null;
+ expect(response.body.payment_method_id, "payment_method_id").to.not.be
+ .null;
+ expect(response.body.merchant_id, "merchant_id").to.equal(merchant_id);
+ expect(reqData.payment_method_type, "payment_method_type").to.equal(
+ response.body.payment_method_type
+ );
+ expect(reqData.payment_method, "payment_method").to.equal(
+ response.body.payment_method
+ );
+ expect(response.body.last_used_at, "last_used_at").to.not.be.null;
+ expect(reqData.customer_id, "customer_id").to.equal(
+ response.body.customer_id
+ );
+ globalState.set("paymentMethodId", response.body.payment_method_id);
+ } else {
+ defaultErrorHandler(response, resData);
+ }
+ });
});
});
@@ -1384,20 +1475,22 @@ Cypress.Commands.add("deletePaymentMethodTest", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
-
- if (response.status === 200) {
- expect(response.body.payment_method_id).to.equal(paymentMethodId);
- expect(response.body.deleted).to.be.true;
- } else if (response.status === 500 && baseUrl.includes("localhost")) {
- // delete payment method api endpoint requires tartarus (hyperswitch card vault) to be set up since it makes a call to the locker service to delete the payment method
- expect(response.body.error.code).to.include("HE_00");
- expect(response.body.error.message).to.include("Something went wrong");
- } else {
- throw new Error(
- `Payment Method Delete Call Failed with error message: ${response.body.error.message}`
- );
- }
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ expect(response.body.payment_method_id).to.equal(paymentMethodId);
+ expect(response.body.deleted).to.be.true;
+ } else if (response.status === 500 && baseUrl.includes("localhost")) {
+ // delete payment method api endpoint requires tartarus (hyperswitch card vault) to be set up since it makes a call to the locker service to delete the payment method
+ expect(response.body.error.code).to.include("HE_00");
+ expect(response.body.error.message).to.include("Something went wrong");
+ } else {
+ throw new Error(
+ `Payment Method Delete Call Failed with error message: ${response.body.error.message}`
+ );
+ }
+ });
});
});
@@ -1414,16 +1507,19 @@ Cypress.Commands.add("setDefaultPaymentMethodTest", (globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- expect(response.body).to.have.property(
- "default_payment_method_id",
- payment_method_id
- );
- expect(response.body).to.have.property("customer_id", customer_id);
- } else {
- defaultErrorHandler(response);
- }
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ expect(response.body).to.have.property(
+ "default_payment_method_id",
+ payment_method_id
+ );
+ expect(response.body).to.have.property("customer_id", customer_id);
+ } else {
+ defaultErrorHandler(response);
+ }
+ });
});
});
@@ -1465,86 +1561,89 @@ Cypress.Commands.add(
body: confirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("paymentID", paymentIntentID);
- globalState.set("connectorId", response.body.connector);
- expect(response.body.connector, "connector").to.equal(
- globalState.get("connectorId")
- );
- expect(paymentIntentID, "payment_id").to.equal(
- response.body.payment_id
- );
- expect(response.body.payment_method_data, "payment_method_data").to.not
- .be.empty;
- expect(merchantConnectorId, "connector_id").to.equal(
- response.body.merchant_connector_id
- );
- expect(response.body.customer, "customer").to.not.be.empty;
- expect(response.body.billing, "billing_address").to.not.be.empty;
- expect(response.body.profile_id, "profile_id").to.equal(profileId).and
- .to.not.be.null;
-
- validateErrorMessage(response, resData);
-
- if (response.body.capture_method === "automatic") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.deep.equal(
- response.body[key]
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ globalState.set("paymentID", paymentIntentID);
+ globalState.set("connectorId", response.body.connector);
+ expect(response.body.connector, "connector").to.equal(
+ globalState.get("connectorId")
+ );
+ expect(paymentIntentID, "payment_id").to.equal(
+ response.body.payment_id
+ );
+ expect(response.body.payment_method_data, "payment_method_data").to
+ .not.be.empty;
+ expect(merchantConnectorId, "connector_id").to.equal(
+ response.body.merchant_connector_id
+ );
+ expect(response.body.customer, "customer").to.not.be.empty;
+ expect(response.body.billing, "billing_address").to.not.be.empty;
+ expect(response.body.profile_id, "profile_id").to.equal(profileId).and
+ .to.not.be.null;
+
+ validateErrorMessage(response, resData);
+
+ if (response.body.capture_method === "automatic") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
);
- }
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.deep.equal(
- response.body[key]
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
);
}
- } else {
- throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
- );
- }
- } else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.deep.equal(
- response.body[key]
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
);
- }
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.deep.equal(
- response.body[key]
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
);
}
} else {
throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
+ `Invalid capture method ${response.body.capture_method}`
);
}
} else {
- throw new Error(
- `Invalid capture method ${response.body.capture_method}`
- );
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -1581,78 +1680,83 @@ Cypress.Commands.add(
body: confirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.headers["content-type"]).to.include("application/json");
- globalState.set("paymentID", paymentIntentId);
- globalState.set("connectorId", response.body.connector);
- globalState.set("paymentMethodType", confirmBody.payment_method_type);
+ cy.wrap(response).then(() => {
if (response.status === 200) {
- validateErrorMessage(response, resData);
+ expect(response.headers["content-type"]).to.include(
+ "application/json"
+ );
+ globalState.set("paymentID", paymentIntentId);
+ globalState.set("connectorId", response.body.connector);
+ globalState.set("paymentMethodType", confirmBody.payment_method_type);
- switch (response.body.authentication_type) {
- case "three_ds":
- if (
- response.body.capture_method === "automatic" ||
- response.body.capture_method === "manual"
- ) {
- if (response.body.status !== "failed") {
- // we get many statuses here, hence this verification
- if (
- connectorId === "adyen" &&
- response.body.payment_method_type === "blik"
- ) {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("type")
- .to.equal("wait_screen_information");
- } else {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
+ if (response.status === 200) {
+ validateErrorMessage(response, resData);
+
+ switch (response.body.authentication_type) {
+ case "three_ds":
+ if (
+ response.body.capture_method === "automatic" ||
+ response.body.capture_method === "manual"
+ ) {
+ if (response.body.status !== "failed") {
+ // we get many statuses here, hence this verification
+ if (
+ connectorId === "adyen" &&
+ response.body.payment_method_type === "blik"
+ ) {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("type")
+ .to.equal("wait_screen_information");
+ } else {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
+ );
+ }
+ } else if (response.body.status === "failed") {
+ expect(response.body.error_code).to.equal(
+ resData.body.error_code
);
}
- } else if (response.body.status === "failed") {
- expect(response.body.error_code).to.equal(
- resData.body.error_code
+ } else {
+ throw new Error(
+ `Invalid capture method ${response.body.capture_method}`
);
}
- } else {
- throw new Error(
- `Invalid capture method ${response.body.capture_method}`
- );
- }
- break;
- case "no_three_ds":
- if (
- response.body.capture_method === "automatic" ||
- response.body.capture_method === "manual"
- ) {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- } else {
+ break;
+ case "no_three_ds":
+ if (
+ response.body.capture_method === "automatic" ||
+ response.body.capture_method === "manual"
+ ) {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
+ );
+ } else {
+ throw new Error(
+ `Invalid capture method ${response.body.capture_method}`
+ );
+ }
+ break;
+ default:
throw new Error(
- `Invalid capture method ${response.body.capture_method}`
+ `Invalid authentication type ${response.body.authentication_type}`
);
- }
- break;
- default:
- throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
- );
+ }
}
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -1690,53 +1794,56 @@ Cypress.Commands.add(
body: confirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("paymentID", paymentIntentID);
- validateErrorMessage(response, resData);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ globalState.set("paymentID", paymentIntentID);
+
+ validateErrorMessage(response, resData);
- if (
- response.body.capture_method === "automatic" ||
- response.body.capture_method === "manual"
- ) {
- 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 {
+ if (
+ response.body.capture_method === "automatic" ||
+ response.body.capture_method === "manual"
+ ) {
+ 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");
+ }
+ break;
+ default:
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
globalState.set(
- "nextActionUrl", // This is intentionally kept as nextActionUrl to avoid issues during handleRedirection call,
- response.body.next_action.image_data_url
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
);
- globalState.set("nextActionType", "image_data_url");
- }
- break;
- default:
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- break;
+ break;
+ }
+ } else {
+ throw new Error(
+ `Invalid capture method ${response.body.capture_method}`
+ );
}
} else {
- throw new Error(
- `Invalid capture method ${response.body.capture_method}`
- );
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -1774,39 +1881,42 @@ Cypress.Commands.add(
body: confirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- validateErrorMessage(response, resData);
- if (
- response.body.capture_method === "automatic" ||
- response.body.capture_method === "manual"
- ) {
- if (response.body.payment_method_type === "upi_collect") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- } else if (response.body.payment_method_type === "upi_intent") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("qr_code_fetch_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.qr_code_fetch_url
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ validateErrorMessage(response, resData);
+
+ if (
+ response.body.capture_method === "automatic" ||
+ response.body.capture_method === "manual"
+ ) {
+ if (response.body.payment_method_type === "upi_collect") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
+ );
+ } else if (response.body.payment_method_type === "upi_intent") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("qr_code_fetch_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.qr_code_fetch_url
+ );
+ }
+ } else {
+ throw new Error(
+ `Invalid capture method ${response.body.capture_method}`
);
}
} else {
- throw new Error(
- `Invalid capture method ${response.body.capture_method}`
- );
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -1852,85 +1962,86 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- globalState.set("clientSecret", response.body.client_secret);
+ cy.wrap(response).then(() => {
+ globalState.set("clientSecret", response.body.client_secret);
+ expect(response.headers["content-type"]).to.include("application/json");
- expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ globalState.set("paymentAmount", createConfirmPaymentBody.amount);
+ globalState.set("paymentID", response.body.payment_id);
+ expect(response.body.connector, "connector").to.equal(
+ globalState.get("connectorId")
+ );
+ expect(response.body.payment_id, "payment_id").to.equal(
+ globalState.get("paymentID")
+ );
+ expect(response.body.payment_method_data, "payment_method_data").to
+ .not.be.empty;
+ expect(response.body.merchant_connector_id, "connector_id").to.equal(
+ merchant_connector_id
+ );
+ expect(response.body.customer, "customer").to.not.be.empty;
+ expect(response.body.billing, "billing_address").to.not.be.empty;
+ expect(response.body.profile_id, "profile_id").to.not.be.null;
+ expect(response.body).to.have.property("status");
- if (response.status === 200) {
- globalState.set("paymentAmount", createConfirmPaymentBody.amount);
- globalState.set("paymentID", response.body.payment_id);
- expect(response.body.connector, "connector").to.equal(
- globalState.get("connectorId")
- );
- expect(response.body.payment_id, "payment_id").to.equal(
- globalState.get("paymentID")
- );
- expect(response.body.payment_method_data, "payment_method_data").to.not
- .be.empty;
- expect(response.body.merchant_connector_id, "connector_id").to.equal(
- merchant_connector_id
- );
- expect(response.body.customer, "customer").to.not.be.empty;
- expect(response.body.billing, "billing_address").to.not.be.empty;
- expect(response.body.profile_id, "profile_id").to.not.be.null;
- expect(response.body).to.have.property("status");
-
- validateErrorMessage(response, resData);
-
- if (response.body.capture_method === "automatic") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.deep.equal(
- response.body[key]
+ validateErrorMessage(response, resData);
+
+ if (response.body.capture_method === "automatic") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
);
- }
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.deep.equal(
- response.body[key]
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type: ${response.body.authentication_type}`
);
}
- } else {
- throw new Error(
- `Invalid authentication type: ${response.body.authentication_type}`
- );
- }
- } else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.deep.equal(
- response.body[key]
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
);
- }
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.deep.equal(
- response.body[key]
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.deep.equal(
+ response.body[key]
+ );
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type: ${response.body.authentication_type}`
);
}
- } else {
- throw new Error(
- `Invalid authentication type: ${response.body.authentication_type}`
- );
}
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -1974,77 +2085,79 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("paymentID", paymentIntentID);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ globalState.set("paymentID", paymentIntentID);
- globalState.set("paymentID", paymentIntentID);
- globalState.set("connectorId", response.body.connector);
- expect(response.body.connector, "connector").to.equal(
- globalState.get("connectorId")
- );
- expect(paymentIntentID, "payment_id").to.equal(
- response.body.payment_id
- );
- expect(response.body.payment_method_data, "payment_method_data").to.not
- .be.empty;
- expect(merchant_connector_id, "connector_id").to.equal(
- response.body.merchant_connector_id
- );
- expect(response.body.customer, "customer").to.not.be.empty;
- if (reqData.billing !== null) {
- expect(response.body.billing, "billing_address").to.not.be.empty;
- }
- expect(response.body.profile_id, "profile_id").to.not.be.null;
- expect(response.body.payment_token, "payment_token").to.not.be.null;
-
- validateErrorMessage(response, resData);
-
- if (response.body.capture_method === "automatic") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
- }
- expect(response.body.customer_id).to.equal(
- globalState.get("customerId")
- );
- } else {
- // Handle other authentication types as needed
- throw new Error(
- `Invalid authentication type: ${response.body.authentication_type}`
- );
+ globalState.set("paymentID", paymentIntentID);
+ globalState.set("connectorId", response.body.connector);
+ expect(response.body.connector, "connector").to.equal(
+ globalState.get("connectorId")
+ );
+ expect(paymentIntentID, "payment_id").to.equal(
+ response.body.payment_id
+ );
+ expect(response.body.payment_method_data, "payment_method_data").to
+ .not.be.empty;
+ expect(merchant_connector_id, "connector_id").to.equal(
+ response.body.merchant_connector_id
+ );
+ expect(response.body.customer, "customer").to.not.be.empty;
+ if (reqData.billing !== null) {
+ expect(response.body.billing, "billing_address").to.not.be.empty;
}
- } else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ expect(response.body.profile_id, "profile_id").to.not.be.null;
+ expect(response.body.payment_token, "payment_token").to.not.be.null;
+
+ validateErrorMessage(response, resData);
+
+ if (response.body.capture_method === "automatic") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ expect(response.body.customer_id).to.equal(
+ globalState.get("customerId")
+ );
+ } else {
+ // Handle other authentication types as needed
+ throw new Error(
+ `Invalid authentication type: ${response.body.authentication_type}`
+ );
+ }
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ expect(response.body.customer_id).to.equal(
+ globalState.get("customerId")
+ );
+ } else {
+ // Handle other authentication types as needed
+ throw new Error(
+ `Invalid authentication type: ${response.body.authentication_type}`
+ );
}
- expect(response.body.customer_id).to.equal(
- globalState.get("customerId")
- );
} else {
- // Handle other authentication types as needed
+ // Handle other capture methods as needed
throw new Error(
- `Invalid authentication type: ${response.body.authentication_type}`
+ `Invalid capture method: ${response.body.capture_method}`
);
}
} else {
- // Handle other capture methods as needed
- throw new Error(
- `Invalid capture method: ${response.body.capture_method}`
- );
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -2073,15 +2186,17 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.body.capture_method !== undefined) {
- expect(response.body.payment_id).to.equal(payment_id);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.body.capture_method !== undefined) {
+ expect(response.body.payment_id).to.equal(payment_id);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -2107,14 +2222,16 @@ Cypress.Commands.add("voidCallTest", (requestBody, data, globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
});
@@ -2140,55 +2257,57 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.payment_id).to.equal(payment_id);
- expect(response.body.amount).to.equal(globalState.get("paymentAmount"));
- expect(response.body.profile_id, "profile_id").to.not.be.null;
- expect(response.body.billing, "billing_address").to.not.be.empty;
- expect(response.body.customer, "customer").to.not.be.empty;
- if (
- ["succeeded", "processing", "requires_customer_action"].includes(
- response.body.status
- )
- ) {
- expect(response.body.connector, "connector").to.equal(
- globalState.get("connectorId")
- );
- expect(response.body.payment_method_data, "payment_method_data").to.not
- .be.empty;
- expect(response.body.payment_method, "payment_method").to.not.be.null;
- expect(response.body.merchant_connector_id, "connector_id").to.equal(
- merchant_connector_id
- );
- }
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.payment_id).to.equal(payment_id);
+ expect(response.body.amount).to.equal(globalState.get("paymentAmount"));
+ expect(response.body.profile_id, "profile_id").to.not.be.null;
+ expect(response.body.billing, "billing_address").to.not.be.empty;
+ expect(response.body.customer, "customer").to.not.be.empty;
+ if (
+ ["succeeded", "processing", "requires_customer_action"].includes(
+ response.body.status
+ )
+ ) {
+ expect(response.body.connector, "connector").to.equal(
+ globalState.get("connectorId")
+ );
+ expect(response.body.payment_method_data, "payment_method_data").to
+ .not.be.empty;
+ expect(response.body.payment_method, "payment_method").to.not.be.null;
+ expect(response.body.merchant_connector_id, "connector_id").to.equal(
+ merchant_connector_id
+ );
+ }
- if (autoretries) {
- expect(response.body).to.have.property("attempts");
- expect(response.body.attempts).to.be.an("array").and.not.empty;
- expect(response.body.attempts.length).to.equal(attempt);
- expect(response.body.attempts[0].attempt_id).to.include(
- `${payment_id}_`
- );
- for (const key in response.body.attempts) {
- if (
- response.body.attempts[key].attempt_id ===
- `${payment_id}_${attempt}` &&
- response.body.status === "succeeded"
- ) {
- expect(response.body.attempts[key].status).to.equal("charged");
- } else if (
- response.body.attempts[key].attempt_id ===
- `${payment_id}_${attempt}` &&
- response.body.status === "requires_customer_action"
- ) {
- expect(response.body.attempts[key].status).to.equal(
- "authentication_pending"
- );
- } else {
- expect(response.body.attempts[key].status).to.equal("failure");
+ if (autoretries) {
+ expect(response.body).to.have.property("attempts");
+ expect(response.body.attempts).to.be.an("array").and.not.empty;
+ expect(response.body.attempts.length).to.equal(attempt);
+ expect(response.body.attempts[0].attempt_id).to.include(
+ `${payment_id}_`
+ );
+ for (const key in response.body.attempts) {
+ if (
+ response.body.attempts[key].attempt_id ===
+ `${payment_id}_${attempt}` &&
+ response.body.status === "succeeded"
+ ) {
+ expect(response.body.attempts[key].status).to.equal("charged");
+ } else if (
+ response.body.attempts[key].attempt_id ===
+ `${payment_id}_${attempt}` &&
+ response.body.status === "requires_customer_action"
+ ) {
+ expect(response.body.attempts[key].status).to.equal(
+ "authentication_pending"
+ );
+ } else {
+ expect(response.body.attempts[key].status).to.equal("failure");
+ }
}
}
- }
+ });
});
}
);
@@ -2217,17 +2336,19 @@ Cypress.Commands.add(
body: requestBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("refundId", response.body.refund_id);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ globalState.set("refundId", response.body.refund_id);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ expect(response.body.payment_id).to.equal(payment_id);
+ } else {
+ defaultErrorHandler(response, resData);
}
- expect(response.body.payment_id).to.equal(payment_id);
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -2248,10 +2369,12 @@ Cypress.Commands.add("syncRefundCallTest", (data, globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
- }
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ });
});
});
@@ -2301,88 +2424,91 @@ Cypress.Commands.add(
body: requestBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("paymentID", response.body.payment_id);
- expect(response.body.payment_method_data, "payment_method_data").to.not
- .be.empty;
- expect(response.body.connector, "connector").to.equal(
- globalState.get("connectorId")
- );
- expect(merchant_connector_id, "connector_id").to.equal(
- response.body.merchant_connector_id
- );
- expect(response.body.customer, "customer").to.not.be.empty;
- expect(response.body.profile_id, "profile_id").to.not.be.null;
- if (response.body.status !== "failed") {
- expect(response.body.payment_method_id, "payment_method_id").to.not.be
- .null;
- }
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ globalState.set("paymentID", response.body.payment_id);
- if (requestBody.mandate_data === null) {
- expect(response.body).to.have.property("payment_method_id");
- globalState.set("paymentMethodId", response.body.payment_method_id);
- } else {
- expect(response.body).to.have.property("mandate_id");
- globalState.set("mandateId", response.body.mandate_id);
- }
+ expect(response.body.payment_method_data, "payment_method_data").to
+ .not.be.empty;
+ expect(response.body.connector, "connector").to.equal(
+ globalState.get("connectorId")
+ );
+ expect(merchant_connector_id, "connector_id").to.equal(
+ response.body.merchant_connector_id
+ );
+ expect(response.body.customer, "customer").to.not.be.empty;
+ expect(response.body.profile_id, "profile_id").to.not.be.null;
+ if (response.body.status !== "failed") {
+ expect(response.body.payment_method_id, "payment_method_id").to.not
+ .be.null;
+ }
- if (response.body.capture_method === "automatic") {
- expect(response.body).to.have.property("mandate_id");
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- cy.log(nextActionUrl);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
- }
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
- }
+ if (requestBody.mandate_data === null) {
+ expect(response.body).to.have.property("payment_method_id");
+ globalState.set("paymentMethodId", response.body.payment_method_id);
} else {
- throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
- );
+ expect(response.body).to.have.property("mandate_id");
+ globalState.set("mandateId", response.body.mandate_id);
}
- } else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- globalState.set(
- "nextActionUrl",
- response.body.next_action.redirect_to_url
- );
- cy.log(nextActionUrl);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+
+ if (response.body.capture_method === "automatic") {
+ expect(response.body).to.have.property("mandate_id");
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
+ );
+ cy.log(nextActionUrl);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
+ );
}
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ globalState.set(
+ "nextActionUrl",
+ response.body.next_action.redirect_to_url
+ );
+ cy.log(nextActionUrl);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
+ );
}
} else {
throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
+ `Invalid capture method ${response.body.capture_method}`
);
}
} else {
- throw new Error(
- `Invalid capture method ${response.body.capture_method}`
- );
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -2425,77 +2551,80 @@ Cypress.Commands.add(
body: requestBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("paymentID", response.body.payment_id);
- expect(response.body.payment_method_data, "payment_method_data").to.not
- .be.empty;
- expect(response.body.connector, "connector").to.equal(
- globalState.get("connectorId")
- );
- expect(merchant_connector_id, "connector_id").to.equal(
- response.body.merchant_connector_id
- );
- expect(response.body.customer, "customer").to.not.be.empty;
- expect(response.body.profile_id, "profile_id").to.not.be.null;
- expect(response.body.payment_method_id, "payment_method_id").to.not.be
- .null;
- if (response.body.capture_method === "automatic") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- cy.log(nextActionUrl);
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ globalState.set("paymentID", response.body.payment_id);
+ expect(response.body.payment_method_data, "payment_method_data").to
+ .not.be.empty;
+ expect(response.body.connector, "connector").to.equal(
+ globalState.get("connectorId")
+ );
+ expect(merchant_connector_id, "connector_id").to.equal(
+ response.body.merchant_connector_id
+ );
+ expect(response.body.customer, "customer").to.not.be.empty;
+ expect(response.body.profile_id, "profile_id").to.not.be.null;
+ expect(response.body.payment_method_id, "payment_method_id").to.not.be
+ .null;
+ if (response.body.capture_method === "automatic") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ cy.log(nextActionUrl);
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
+ );
}
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ cy.log(nextActionUrl);
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
+ );
}
} else {
throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
+ `Invalid capture method ${response.body.capture_method}`
);
}
- } else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- cy.log(nextActionUrl);
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
- }
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
- }
- } else {
- throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
+ } else if (response.status === 400) {
+ if (response.body.error.message === "Mandate Validation Failed") {
+ expect(response.body.error.code).to.equal("HE_03");
+ expect(response.body.error.message).to.equal(
+ "Mandate Validation Failed"
+ );
+ expect(response.body.error.reason).to.equal(
+ "request amount is greater than mandate amount"
);
}
} else {
- throw new Error(
- `Invalid capture method ${response.body.capture_method}`
- );
- }
- } else if (response.status === 400) {
- if (response.body.error.message === "Mandate Validation Failed") {
- expect(response.body.error.code).to.equal("HE_03");
- expect(response.body.error.message).to.equal(
- "Mandate Validation Failed"
- );
- expect(response.body.error.reason).to.equal(
- "request amount is greater than mandate amount"
- );
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -2540,69 +2669,73 @@ Cypress.Commands.add(
body: requestBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("paymentID", response.body.payment_id);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+
+ if (response.status === 200) {
+ globalState.set("paymentID", response.body.payment_id);
+
+ expect(
+ response.body.payment_method_id,
+ "payment_method_id"
+ ).to.include("pm_").and.to.not.be.null;
+ expect(
+ response.body.connector_transaction_id,
+ "connector_transaction_id"
+ ).to.not.be.null;
+ expect(
+ response.body.payment_method_status,
+ "payment_method_status"
+ ).to.equal("active");
- expect(response.body.payment_method_id, "payment_method_id").to.include(
- "pm_"
- ).and.to.not.be.null;
- expect(
- response.body.connector_transaction_id,
- "connector_transaction_id"
- ).to.not.be.null;
- expect(
- response.body.payment_method_status,
- "payment_method_status"
- ).to.equal("active");
-
- if (response.body.capture_method === "automatic") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- cy.log(nextActionUrl);
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
- }
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
- }
- } else {
- throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
- );
- }
- } else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- cy.log(nextActionUrl);
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
+ if (response.body.capture_method === "automatic") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ cy.log(nextActionUrl);
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
+ );
}
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ cy.log(nextActionUrl);
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
+ );
}
} else {
throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
+ `Invalid capture method ${response.body.capture_method}`
);
}
} else {
- throw new Error(
- `Invalid capture method ${response.body.capture_method}`
- );
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -2643,57 +2776,61 @@ Cypress.Commands.add(
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.headers["content-type"]).to.include("application/json");
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(response.headers["content-type"]).to.include(
+ "application/json"
+ );
- globalState.set("paymentID", response.body.payment_id);
-
- if (response.body.capture_method === "automatic") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- cy.log(nextActionUrl);
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
- }
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
- }
- } else {
- throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
- );
- }
- } else if (response.body.capture_method === "manual") {
- if (response.body.authentication_type === "three_ds") {
- expect(response.body)
- .to.have.property("next_action")
- .to.have.property("redirect_to_url");
- const nextActionUrl = response.body.next_action.redirect_to_url;
- cy.log(nextActionUrl);
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
+ globalState.set("paymentID", response.body.payment_id);
+
+ if (response.body.capture_method === "automatic") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ cy.log(nextActionUrl);
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
+ );
}
- } else if (response.body.authentication_type === "no_three_ds") {
- for (const key in resData.body) {
- expect(resData.body[key], [key]).to.equal(response.body[key]);
+ } else if (response.body.capture_method === "manual") {
+ if (response.body.authentication_type === "three_ds") {
+ expect(response.body)
+ .to.have.property("next_action")
+ .to.have.property("redirect_to_url");
+ const nextActionUrl = response.body.next_action.redirect_to_url;
+ cy.log(nextActionUrl);
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else if (response.body.authentication_type === "no_three_ds") {
+ for (const key in resData.body) {
+ expect(resData.body[key], [key]).to.equal(response.body[key]);
+ }
+ } else {
+ throw new Error(
+ `Invalid authentication type ${response.body.authentication_type}`
+ );
}
} else {
throw new Error(
- `Invalid authentication type ${response.body.authentication_type}`
+ `Invalid capture method ${response.body.capture_method}`
);
}
} else {
- throw new Error(
- `Invalid capture method ${response.body.capture_method}`
- );
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -2710,14 +2847,15 @@ Cypress.Commands.add("listMandateCallTest", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
-
- let i = 0;
- for (i in response.body) {
- if (response.body[i].mandate_id === globalState.get("mandateId")) {
- expect(response.body[i].status).to.equal("active");
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ let i = 0;
+ for (i in response.body) {
+ if (response.body[i].mandate_id === globalState.get("mandateId")) {
+ expect(response.body[i].status).to.equal("active");
+ }
}
- }
+ });
});
});
@@ -2734,12 +2872,16 @@ Cypress.Commands.add("revokeMandateCallTest", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.body.status === 200) {
- expect(response.body.status).to.equal("revoked");
- } else if (response.body.status === 400) {
- expect(response.body.reason).to.equal("Mandate has already been revoked");
- }
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.body.status === 200) {
+ expect(response.body.status).to.equal("revoked");
+ } else if (response.body.status === 400) {
+ expect(response.body.reason).to.equal(
+ "Mandate has already been revoked"
+ );
+ }
+ });
});
});
@@ -2826,39 +2968,42 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState) => {
},
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.body.customer_payment_methods[0]?.payment_token) {
- const paymentToken =
- response.body.customer_payment_methods[0].payment_token;
- const paymentMethodId =
- response.body.customer_payment_methods[0].payment_method_id;
- globalState.set("paymentToken", paymentToken); // Set paymentToken in globalState
- globalState.set("paymentMethodId", paymentMethodId); // Set paymentMethodId in globalState
- } 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)
- .to.have.property("customer_payment_methods")
- .to.be.an("array").and.empty;
- }
- expect(globalState.get("customerId"), "customer_id").to.equal(
- response.body.customer_payment_methods[0].customer_id
- );
- expect(
- response.body.customer_payment_methods[0].payment_token,
- "payment_token"
- ).to.not.be.null;
- expect(
- response.body.customer_payment_methods[0].payment_method_id,
- "payment_method_id"
- ).to.not.be.null;
- expect(
- response.body.customer_payment_methods[0].payment_method,
- "payment_method"
- ).to.not.be.null;
- expect(
- response.body.customer_payment_methods[0].payment_method_type,
- "payment_method_type"
- ).to.not.be.null;
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.body.customer_payment_methods[0]?.payment_token) {
+ const paymentToken =
+ response.body.customer_payment_methods[0].payment_token;
+ const paymentMethodId =
+ response.body.customer_payment_methods[0].payment_method_id;
+ globalState.set("paymentToken", paymentToken); // Set paymentToken in globalState
+ globalState.set("paymentMethodId", paymentMethodId); // Set paymentMethodId in globalState
+ } 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)
+ .to.have.property("customer_payment_methods")
+ .to.be.an("array").and.empty;
+ }
+ expect(globalState.get("customerId"), "customer_id").to.equal(
+ response.body.customer_payment_methods[0].customer_id
+ );
+ expect(
+ response.body.customer_payment_methods[0].payment_token,
+ "payment_token"
+ ).to.not.be.null;
+ expect(
+ response.body.customer_payment_methods[0].payment_method_id,
+ "payment_method_id"
+ ).to.not.be.null;
+ expect(
+ response.body.customer_payment_methods[0].payment_method,
+ "payment_method"
+ ).to.not.be.null;
+ expect(
+ response.body.customer_payment_methods[0].payment_method_type,
+ "payment_method_type"
+ ).to.not.be.null;
+ });
});
});
@@ -2874,24 +3019,27 @@ Cypress.Commands.add("listCustomerPMByClientSecret", (globalState) => {
},
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.body.customer_payment_methods[0]?.payment_token) {
- const paymentToken =
- response.body.customer_payment_methods[0].payment_token;
- const paymentMethodId =
- response.body.customer_payment_methods[0].payment_method_id;
- globalState.set("paymentToken", paymentToken);
- globalState.set("paymentMethodId", paymentMethodId);
- expect(
- response.body.customer_payment_methods[0].payment_method_id,
- "payment_method_id"
- ).to.not.be.null;
- } 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)
- .to.have.property("customer_payment_methods")
- .to.be.an("array").and.empty;
- }
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.body.customer_payment_methods[0]?.payment_token) {
+ const paymentToken =
+ response.body.customer_payment_methods[0].payment_token;
+ const paymentMethodId =
+ response.body.customer_payment_methods[0].payment_method_id;
+ globalState.set("paymentToken", paymentToken);
+ globalState.set("paymentMethodId", paymentMethodId);
+ expect(
+ response.body.customer_payment_methods[0].payment_method_id,
+ "payment_method_id"
+ ).to.not.be.null;
+ } 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)
+ .to.have.property("customer_payment_methods")
+ .to.be.an("array").and.empty;
+ }
+ });
});
});
@@ -2906,8 +3054,11 @@ Cypress.Commands.add("listRefundCallTest", (requestBody, globalState) => {
body: requestBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.data).to.be.an("array").and.not.empty;
+
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.data).to.be.an("array").and.not.empty;
+ });
});
});
@@ -2934,17 +3085,19 @@ Cypress.Commands.add(
body: createConfirmPayoutBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("payoutAmount", createConfirmPayoutBody.amount);
- globalState.set("payoutID", response.body.payout_id);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ if (response.status === 200) {
+ globalState.set("payoutAmount", createConfirmPayoutBody.amount);
+ globalState.set("payoutID", response.body.payout_id);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -2973,17 +3126,20 @@ Cypress.Commands.add(
body: createConfirmPayoutBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- globalState.set("payoutAmount", createConfirmPayoutBody.amount);
- globalState.set("payoutID", response.body.payout_id);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+
+ if (response.status === 200) {
+ globalState.set("payoutAmount", createConfirmPayoutBody.amount);
+ globalState.set("payoutID", response.body.payout_id);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -3006,15 +3162,18 @@ Cypress.Commands.add(
body: payoutFulfillBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+
+ if (response.status === 200) {
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -3038,15 +3197,18 @@ Cypress.Commands.add(
body: payoutConfirmBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+
+ if (response.status === 200) {
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -3064,9 +3226,11 @@ Cypress.Commands.add("retrievePayoutCallTest", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- expect(response.body.payout_id).to.equal(payout_id);
- expect(response.body.amount).to.equal(globalState.get("payoutAmount"));
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ expect(response.body.payout_id).to.equal(payout_id);
+ expect(response.body.amount).to.equal(globalState.get("payoutAmount"));
+ });
});
});
@@ -3092,22 +3256,24 @@ Cypress.Commands.add("userLogin", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- if (response.body.token_type === "totp") {
- expect(response.body, "totp_token").to.have.property("token").and.to.not
- .be.empty;
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ if (response.body.token_type === "totp") {
+ expect(response.body, "totp_token").to.have.property("token").and.to
+ .not.be.empty;
- const totpToken = response.body.token;
- if (!totpToken) {
- throw new Error("No token received from login");
+ const totpToken = response.body.token;
+ if (!totpToken) {
+ throw new Error("No token received from login");
+ }
+ globalState.set("totpToken", totpToken);
}
- globalState.set("totpToken", totpToken);
+ } else {
+ throw new Error(
+ `User login call failed to get totp token with status: "${response.status}" and message: "${response.body.error.message}"`
+ );
}
- } else {
- throw new Error(
- `User login call failed to get totp token with status: "${response.status}" and message: "${response.body.error.message}"`
- );
- }
+ });
});
});
Cypress.Commands.add("terminate2Fa", (globalState) => {
@@ -3128,22 +3294,24 @@ Cypress.Commands.add("terminate2Fa", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- if (response.body.token_type === "user_info") {
- expect(response.body, "user_info_token").to.have.property("token").and
- .to.not.be.empty;
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ if (response.body.token_type === "user_info") {
+ expect(response.body, "user_info_token").to.have.property("token").and
+ .to.not.be.empty;
- const userInfoToken = response.body.token;
- if (!userInfoToken) {
- throw new Error("No user info token received");
+ const userInfoToken = response.body.token;
+ if (!userInfoToken) {
+ throw new Error("No user info token received");
+ }
+ globalState.set("userInfoToken", userInfoToken);
}
- globalState.set("userInfoToken", userInfoToken);
+ } else {
+ throw new Error(
+ `2FA terminate call failed with status: "${response.status}" and message: "${response.body.error.message}"`
+ );
}
- } else {
- throw new Error(
- `2FA terminate call failed with status: "${response.status}" and message: "${response.body.error.message}"`
- );
- }
+ });
});
});
Cypress.Commands.add("userInfo", (globalState) => {
@@ -3167,24 +3335,26 @@ Cypress.Commands.add("userInfo", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.body, "merchant_id").to.have.property("merchant_id").and
- .to.not.be.empty;
- expect(response.body, "organization_id").to.have.property("org_id").and.to
- .not.be.empty;
- expect(response.body, "profile_id").to.have.property("profile_id").and.to
- .not.be.empty;
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(response.body, "merchant_id").to.have.property("merchant_id").and
+ .to.not.be.empty;
+ expect(response.body, "organization_id").to.have.property("org_id").and
+ .to.not.be.empty;
+ expect(response.body, "profile_id").to.have.property("profile_id").and
+ .to.not.be.empty;
- globalState.set("merchantId", response.body.merchant_id);
- globalState.set("organizationId", response.body.org_id);
- globalState.set("profileId", response.body.profile_id);
+ globalState.set("merchantId", response.body.merchant_id);
+ globalState.set("organizationId", response.body.org_id);
+ globalState.set("profileId", response.body.profile_id);
- globalState.set("userInfoToken", userInfoToken);
- } else {
- throw new Error(
- `User login call failed to fetch user info with status: "${response.status}" and message: "${response.body.error.message}"`
- );
- }
+ globalState.set("userInfoToken", userInfoToken);
+ } else {
+ throw new Error(
+ `User login call failed to fetch user info with status: "${response.status}" and message: "${response.body.error.message}"`
+ );
+ }
+ });
});
});
@@ -3203,11 +3373,13 @@ Cypress.Commands.add("ListMcaByMid", (globalState) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- globalState.set("profileId", response.body[0].profile_id);
- globalState.set("stripeMcaId", response.body[0].merchant_connector_id);
- globalState.set("adyenMcaId", response.body[1].merchant_connector_id);
- globalState.set("bluesnapMcaId", response.body[3].merchant_connector_id);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+ globalState.set("profileId", response.body[0].profile_id);
+ globalState.set("stripeMcaId", response.body[0].merchant_connector_id);
+ globalState.set("adyenMcaId", response.body[1].merchant_connector_id);
+ globalState.set("bluesnapMcaId", response.body[3].merchant_connector_id);
+ });
});
});
@@ -3235,17 +3407,20 @@ Cypress.Commands.add(
body: routingBody,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- expect(response.body).to.have.property("id");
- globalState.set("routingConfigId", response.body.id);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+
+ if (response.status === 200) {
+ expect(response.body).to.have.property("id");
+ globalState.set("routingConfigId", response.body.id);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
}
);
@@ -3264,16 +3439,19 @@ Cypress.Commands.add("activateRoutingConfig", (data, globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- expect(response.body.id).to.equal(routing_config_id);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+
+ if (response.status === 200) {
+ expect(response.body.id).to.equal(routing_config_id);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
});
@@ -3291,16 +3469,19 @@ Cypress.Commands.add("retrieveRoutingConfig", (data, globalState) => {
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- expect(response.headers["content-type"]).to.include("application/json");
- if (response.status === 200) {
- expect(response.body.id).to.equal(routing_config_id);
- for (const key in resData.body) {
- expect(resData.body[key]).to.equal(response.body[key]);
+ cy.wrap(response).then(() => {
+ expect(response.headers["content-type"]).to.include("application/json");
+
+ if (response.status === 200) {
+ expect(response.body.id).to.equal(routing_config_id);
+ for (const key in resData.body) {
+ expect(resData.body[key]).to.equal(response.body[key]);
+ }
+ } else {
+ defaultErrorHandler(response, resData);
}
- } else {
- defaultErrorHandler(response, resData);
- }
+ });
});
});
@@ -3319,15 +3500,20 @@ Cypress.Commands.add(
failOnStatusCode: false,
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.body)
- .to.have.property("message")
- .to.equal("card_declined");
- expect(response.body).to.have.property("connector").to.equal("stripe");
- expect(response.body)
- .to.have.property("step_up_possible")
- .to.equal(step_up_possible);
- }
+
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(response.body)
+ .to.have.property("message")
+ .to.equal("card_declined");
+ expect(response.body)
+ .to.have.property("connector")
+ .to.equal("stripe");
+ expect(response.body)
+ .to.have.property("step_up_possible")
+ .to.equal(step_up_possible);
+ }
+ });
});
}
);
@@ -3352,49 +3538,52 @@ Cypress.Commands.add("incrementalAuth", (globalState, data) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.body.amount_capturable, "amount_capturable").to.equal(
- resData.body.amount_capturable
- );
- expect(response.body.authorization_count, "authorization_count").to.be.a(
- "number"
- ).and.not.be.null;
- expect(
- response.body.incremental_authorization_allowed,
- "incremental_authorization_allowed"
- ).to.be.true;
- expect(
- response.body.incremental_authorizations,
- "incremental_authorizations"
- ).to.be.an("array").and.not.be.empty;
- expect(response.body.payment_id, "payment_id").to.equal(paymentId);
- expect(response.body.status, "status").to.equal(resData.body.status);
-
- for (const key in response.body.incremental_authorizations) {
- expect(response.body.incremental_authorizations[key], "amount")
- .to.have.property("amount")
- .to.be.a("number")
- .to.equal(resData.body.amount).and.not.be.null;
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(response.body.amount_capturable, "amount_capturable").to.equal(
+ resData.body.amount_capturable
+ );
expect(
- response.body.incremental_authorizations[key],
- "error_code"
- ).to.have.property("error_code").to.be.null;
+ response.body.authorization_count,
+ "authorization_count"
+ ).to.be.a("number").and.not.be.null;
expect(
- response.body.incremental_authorizations[key],
- "error_message"
- ).to.have.property("error_message").to.be.null;
+ response.body.incremental_authorization_allowed,
+ "incremental_authorization_allowed"
+ ).to.be.true;
expect(
- response.body.incremental_authorizations[key],
- "previously_authorized_amount"
- )
- .to.have.property("previously_authorized_amount")
- .to.be.a("number")
- .to.equal(response.body.amount).and.not.be.null;
- expect(response.body.incremental_authorizations[key], "status")
- .to.have.property("status")
- .to.equal("success");
+ response.body.incremental_authorizations,
+ "incremental_authorizations"
+ ).to.be.an("array").and.not.be.empty;
+ expect(response.body.payment_id, "payment_id").to.equal(paymentId);
+ expect(response.body.status, "status").to.equal(resData.body.status);
+
+ for (const key in response.body.incremental_authorizations) {
+ expect(response.body.incremental_authorizations[key], "amount")
+ .to.have.property("amount")
+ .to.be.a("number")
+ .to.equal(resData.body.amount).and.not.be.null;
+ expect(
+ response.body.incremental_authorizations[key],
+ "error_code"
+ ).to.have.property("error_code").to.be.null;
+ expect(
+ response.body.incremental_authorizations[key],
+ "error_message"
+ ).to.have.property("error_message").to.be.null;
+ expect(
+ response.body.incremental_authorizations[key],
+ "previously_authorized_amount"
+ )
+ .to.have.property("previously_authorized_amount")
+ .to.be.a("number")
+ .to.equal(response.body.amount).and.not.be.null;
+ expect(response.body.incremental_authorizations[key], "status")
+ .to.have.property("status")
+ .to.equal("success");
+ }
}
- }
+ });
});
});
@@ -3437,13 +3626,15 @@ Cypress.Commands.add("setConfigs", (globalState, key, value, requestType) => {
}).then((response) => {
logRequestId(response.headers["x-request-id"]);
- if (response.status === 200) {
- expect(response.body).to.have.property("key").to.equal(key);
- expect(response.body).to.have.property("value").to.equal(value);
- } else {
- throw new Error(
- `Failed to set configs with status ${response.status} and message ${response.body.error.message}`
- );
- }
+ cy.wrap(response).then(() => {
+ if (response.status === 200) {
+ expect(response.body).to.have.property("key").to.equal(key);
+ expect(response.body).to.have.property("value").to.equal(value);
+ } else {
+ throw new Error(
+ `Failed to set configs with status ${response.status} and message ${response.body.error.message}`
+ );
+ }
+ });
});
});
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json
index 48b7d41089..1cdee895b3 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario1-Create payment with confirm true/Payments - Create/request.json
@@ -47,7 +47,7 @@
"payment_method_type": "debit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json
index b32011d26d..47912f2025 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario10-Create a mandate and recurring payment/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json
index 18f12b7306..7dfbf639e5 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario11-Refund recurring payment/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create a payment and Confirm/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create a payment and Confirm/Payments - Confirm/request.json
index 540a2fa194..8becf0a7c1 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create a payment and Confirm/Payments - Confirm/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2-Create a payment and Confirm/Payments - Confirm/request.json
@@ -41,7 +41,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22- Update Amount/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22- Update Amount/Payments - Confirm/request.json
index 1b1757b9a4..e532d039fb 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22- Update Amount/Payments - Confirm/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario22- Update Amount/Payments - Confirm/request.json
@@ -49,7 +49,7 @@
"payment_method_type": "debit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Payments - Create/request.json
index 4f64a5d0e3..e895ace0e1 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario23-Add card flow/Payments - Create/request.json
@@ -45,7 +45,7 @@
"payment_method_type": "credit",
"payment_method_data": {
"card": {
- "card_number": "4111111111111111",
+ "card_number": "378282246310005",
"card_exp_month": "03",
"card_exp_year": "2030",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json
index 627c816fba..09ffe6396d 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario26-Create payment without customer_id and with billing address and shipping address/Payments - Create/request.json
@@ -47,7 +47,7 @@
"payment_method_type": "debit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Confirm a payment with requires_customer_action status/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Confirm a payment with requires_customer_action status/Payments - Confirm/request.json
index 1ce1d61eaa..91acf28218 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Confirm a payment with requires_customer_action status/Payments - Confirm/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario27-Confirm a payment with requires_customer_action status/Payments - Confirm/request.json
@@ -41,7 +41,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Create payment with payment method billing/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Create payment with payment method billing/Payments - Create/request.json
index 578d3c4726..77323059b8 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Create payment with payment method billing/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario28-Create payment with payment method billing/Payments - Create/request.json
@@ -39,7 +39,7 @@
"payment_method_type": "debit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Update payment with payment method billing/Payments - Update/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Update payment with payment method billing/Payments - Update/request.json
index a8fc9965c7..eafa6b9d22 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Update payment with payment method billing/Payments - Update/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario29-Update payment with payment method billing/Payments - Update/request.json
@@ -21,7 +21,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "01",
"card_exp_year": "26",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2a-Create payment with confirm false card holder name null/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2a-Create payment with confirm false card holder name null/Payments - Confirm/request.json
index 604ac54144..9e1278c7d9 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2a-Create payment with confirm false card holder name null/Payments - Confirm/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2a-Create payment with confirm false card holder name null/Payments - Confirm/request.json
@@ -41,7 +41,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": null,
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2b-Create payment with confirm false card holder name empty/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2b-Create payment with confirm false card holder name empty/Payments - Confirm/request.json
index 371ef616fe..02de494d68 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2b-Create payment with confirm false card holder name empty/Payments - Confirm/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario2b-Create payment with confirm false card holder name empty/Payments - Confirm/request.json
@@ -41,7 +41,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json
index 77f4d0dafe..a0e82b8610 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario3-Create payment without PMD/Payments - Confirm/request.json
@@ -41,7 +41,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Pass payment method billing in Confirm/Payments - Confirm/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Pass payment method billing in Confirm/Payments - Confirm/request.json
index b92a83b5ad..2ded3043c3 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Pass payment method billing in Confirm/Payments - Confirm/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario30-Pass payment method billing in Confirm/Payments - Confirm/request.json
@@ -41,7 +41,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "Joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card CVC/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card CVC/request.json
index 77b40a8ece..bfb1e3d863 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card CVC/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Card CVC/request.json
@@ -23,7 +23,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Expiry month/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Expiry month/request.json
index 2c3d0fe427..6475ad1ef1 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Expiry month/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Expiry month/request.json
@@ -23,7 +23,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "13",
"card_exp_year": "69",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Expiry year/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Expiry year/request.json
index 63eda0afbe..17a69bb2bf 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Expiry year/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Invalid Expiry year/request.json
@@ -23,7 +23,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "22",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Success/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Success/request.json
index 05bc9dbc32..baa616ddc7 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Success/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario31-Ensure API Contract for Payment Method Data/Payments - Card Payment Method Success/request.json
@@ -23,7 +23,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - cvv check fails/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - cvv check fails/request.json
index 9f5c6a8fb3..ac816e25d3 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - cvv check fails/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - cvv check fails/request.json
@@ -25,8 +25,8 @@
"payment_method_data": {
"card": {
"card_number": "4000000000000101",
- "card_exp_month": "10",
- "card_exp_year": "25",
+ "card_exp_month": "12",
+ "card_exp_year": "34",
"card_holder_name": "joseph Doe",
"card_cvc": "123"
}
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - payment check populated for successful payment without billing/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - payment check populated for successful payment without billing/request.json
index 88fccca9a0..b6f0a69ef9 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - payment check populated for successful payment without billing/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - payment check populated for successful payment without billing/request.json
@@ -24,7 +24,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - successful payment with billing/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - successful payment with billing/request.json
index 28e4576672..2ebb0ebb81 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - successful payment with billing/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario32-Check is payment checks are populated/Payments - successful payment with billing/request.json
@@ -24,7 +24,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json
index 4deef11deb..4a2876af98 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4-Create payment with Manual capture/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json
index f1ff4cb569..978ad9bd54 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario4a-Create payment with manual_multiple capture/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json
index 4deef11deb..4a2876af98 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario5-Void the payment/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json
index f58c425653..665946fccf 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9-Refund full payment/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json
index f58c425653..665946fccf 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Happy Cases/Scenario9a-Partial refund/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json
index 2225c6096e..322d38b08c 100644
--- a/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/QuickStart/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json
index 02e431466a..3017be462d 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp Year)/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "2022",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json
index 52c73bea74..851b8538df 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario1-Create payment with Invalid card details/Payments - Create(Invalid Exp month)/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "01",
"card_exp_year": "2023",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json
index d6f53f92a0..c55925d85a 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario10-Refund exceeds amount captured/Payments - Create/request.json
@@ -34,7 +34,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json
index 4deef11deb..4a2876af98 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario3-Capture greater amount/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json
index f58c425653..665946fccf 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario4-Capture the succeeded payment/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json
index f58c425653..665946fccf 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario5-Void the success_slash_failure payment/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json
index f58c425653..665946fccf 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario7-Refund exceeds amount/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json
index 3e1f1231ff..e52dcb06a5 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario8-Refund for unsuccessful payment/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json
index b32011d26d..47912f2025 100644
--- a/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Flow Testcases/Variation Cases/Scenario9-Create a recurring payment with greater mandate amount/Payments - Create/request.json
@@ -35,7 +35,7 @@
"payment_method": "card",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json
index 2617b3e44a..f3b7f262b8 100644
--- a/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json
+++ b/postman/collection-dir/stripe/PaymentMethods/PaymentMethods - Create/request.json
@@ -22,7 +22,7 @@
"payment_method_type": "credit",
"payment_method_issuer": "Visa",
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "John Doe"
diff --git a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json
index 93bda64022..44e9559483 100644
--- a/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/PaymentMethods/Payments - Create/request.json
@@ -45,7 +45,7 @@
"payment_method_type": "debit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json b/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json
index c985bf50b0..d0a12e7a4a 100644
--- a/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json
+++ b/postman/collection-dir/stripe/Payments/Payments - Create Again/request.json
@@ -36,7 +36,7 @@
"payment_method_type": "credit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json
index 2b6d4bf333..b7ecd39f2e 100644
--- a/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json
+++ b/postman/collection-dir/stripe/Payments/Payments - Create Yet Again/request.json
@@ -36,7 +36,7 @@
"payment_method_type": "credit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Payments/Payments - Create/request.json b/postman/collection-dir/stripe/Payments/Payments - Create/request.json
index 5a7457cedf..a9b867f0f6 100644
--- a/postman/collection-dir/stripe/Payments/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Payments/Payments - Create/request.json
@@ -36,7 +36,7 @@
"payment_method_type": "credit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Payments/Payments - Update/request.json b/postman/collection-dir/stripe/Payments/Payments - Update/request.json
index f3cdd29f87..5bc7fcdf2b 100644
--- a/postman/collection-dir/stripe/Payments/Payments - Update/request.json
+++ b/postman/collection-dir/stripe/Payments/Payments - Update/request.json
@@ -34,7 +34,7 @@
"return_url": "https://duck.com",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json
index 5fcc564759..a27c309c9a 100644
--- a/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json
+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create-copy/request.json
@@ -36,7 +36,7 @@
"payment_method_type": "credit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json b/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json
index 13ed1a212d..24681fb62d 100644
--- a/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/QuickStart/Payments - Create/request.json
@@ -36,7 +36,7 @@
"payment_method_type": "credit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
diff --git a/postman/collection-dir/stripe/Refunds/Payments - Create/request.json b/postman/collection-dir/stripe/Refunds/Payments - Create/request.json
index d3219a30cf..657d42351c 100644
--- a/postman/collection-dir/stripe/Refunds/Payments - Create/request.json
+++ b/postman/collection-dir/stripe/Refunds/Payments - Create/request.json
@@ -37,7 +37,7 @@
"payment_method_type": "credit",
"payment_method_data": {
"card": {
- "card_number": "4242424242424242",
+ "card_number": "378282246310005",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",