Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
refactor(cypress-v2): change `Authorization` and `payment_methods_enabled` for v2 cypress tests (#7805)
Arindam Sahoo8a737d578123
diff --git a/cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js b/cypress-tests-v2/cypress/e2e/configs/Payment/Commons.jsindex 228dfd2cfd..a645ec5c55 100644--- a/cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js+++ b/cypress-tests-v2/cypress/e2e/configs/Payment/Commons.js@@ -54,10 +54,10 @@ const multiUseMandateData = {export const payment_methods_enabled = [{- payment_method: "bank_debit",- payment_method_types: [+ payment_method_type: "bank_debit",+ payment_method_subtypes: [{- payment_method_type: "ach",+ payment_method_subtype: "ach",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -68,7 +68,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "bacs",+ payment_method_subtype: "bacs",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -79,7 +79,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "becs",+ payment_method_subtype: "becs",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -90,7 +90,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "sepa",+ payment_method_subtype: "sepa",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -103,10 +103,10 @@ export const payment_methods_enabled = [],},{- payment_method: "bank_redirect",- payment_method_types: [+ payment_method_type: "bank_redirect",+ payment_method_subtypes: [{- payment_method_type: "blik",+ payment_method_subtype: "blik",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -117,7 +117,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "eps",+ payment_method_subtype: "eps",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -128,7 +128,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "ideal",+ payment_method_subtype: "ideal",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -139,7 +139,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "giropay",+ payment_method_subtype: "giropay",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -150,7 +150,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "local_bank_redirect",+ payment_method_subtype: "local_bank_redirect",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -161,7 +161,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "przelewy24",+ payment_method_subtype: "przelewy24",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -172,7 +172,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "sofort",+ payment_method_subtype: "sofort",payment_experience: null,card_networks: null,accepted_currencies: null,@@ -185,10 +185,10 @@ export const payment_methods_enabled = [],},{- payment_method: "bank_transfer",- payment_method_types: [+ payment_method_type: "bank_transfer",+ payment_method_subtypes: [{- payment_method_type: "ach",+ payment_method_subtype: "ach",payment_experience: "redirect_to_url",card_networks: null,accepted_currencies: null,@@ -199,7 +199,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "bacs",+ payment_method_subtype: "bacs",payment_experience: "redirect_to_url",card_networks: null,accepted_currencies: null,@@ -210,14 +210,14 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "pix",+ payment_method_subtype: "pix",minimum_amount: -1,maximum_amount: 68607706,recurring_enabled: false,installment_payment_enabled: true,},{- payment_method_type: "sepa",+ payment_method_subtype: "sepa",payment_experience: "redirect_to_url",card_networks: null,accepted_currencies: null,@@ -230,10 +230,10 @@ export const payment_methods_enabled = [],},{- payment_method: "card",- payment_method_types: [+ payment_method_type: "card",+ payment_method_subtypes: [{- payment_method_type: "credit",+ payment_method_subtype: "credit",card_networks: ["AmericanExpress","Discover",@@ -251,7 +251,7 @@ export const payment_methods_enabled = [installment_payment_enabled: true,},{- payment_method_type: "debit",+ payment_method_subtype: "debit",card_networks: ["AmericanExpress","Discover",@@ -271,10 +271,10 @@ export const payment_methods_enabled = [],},{- payment_method: "card_redirect",- payment_method_types: [+ payment_method_type: "card_redirect",+ payment_method_subtypes: [{- payment_method_type: "card_redirect",+ payment_method_subtype: "card_redirect",payment_experience: "redirect_to_url",card_networks: null,accepted_currencies: null,@@ -287,10 +287,10 @@ export const payment_methods_enabled = [],},{- payment_method: "real_time_payment",- payment_method_types: [+ payment_method_type: "real_time_payment",+ payment_method_subtypes: [{- payment_method_type: "duit_now",+ payment_method_subtype: "duit_now",minimum_amount: 1,maximum_amount: 68607706,recurring_enabled: true,@@ -298,7 +298,7 @@ export const payment_methods_enabled = [payment_experience: "redirect_to_url",},{- payment_method_type: "fps",+ payment_method_subtype: "fps",minimum_amount: 1,maximum_amount: 68607706,recurring_enabled: true,@@ -306,7 +306,7 @@ export const payment_methods_enabled = [payment_experience: "redirect_to_url",},{- payment_method_type: "prompt_pay",+ payment_method_subtype: "prompt_pay",minimum_amount: 1,maximum_amount: 68607706,recurring_enabled: true,@@ -314,7 +314,7 @@ export const payment_methods_enabled = [payment_experience: "redirect_to_url",},{- payment_method_type: "viet_qr",+ payment_method_subtype: "viet_qr",minimum_amount: 1,maximum_amount: 68607706,recurring_enabled: true,@@ -324,10 +324,10 @@ export const payment_methods_enabled = [],},{- payment_method: "upi",- payment_method_types: [+ payment_method_type: "upi",+ payment_method_subtypes: [{- payment_method_type: "upi_collect",+ payment_method_subtype: "upi_collect",minimum_amount: 1,maximum_amount: 68607706,recurring_enabled: true,@@ -335,7 +335,7 @@ export const payment_methods_enabled = [payment_experience: "redirect_to_url",},{- payment_method_type: "upi_intent",+ payment_method_subtype: "upi_intent",minimum_amount: 1,maximum_amount: 68607706,recurring_enabled: true,diff --git a/cypress-tests-v2/cypress/support/commands.js b/cypress-tests-v2/cypress/support/commands.jsindex 33f8907ce3..54e52495d6 100644--- a/cypress-tests-v2/cypress/support/commands.js+++ b/cypress-tests-v2/cypress/support/commands.js@@ -55,7 +55,7 @@ Cypress.Commands.add(url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,},body: organizationCreateBody,failOnStatusCode: false,@@ -91,7 +91,7 @@ Cypress.Commands.add("organizationRetrieveCall", (globalState) => {url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,},failOnStatusCode: false,}).then((response) => {@@ -135,7 +135,7 @@ Cypress.Commands.add(url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,},body: organizationUpdateBody,failOnStatusCode: false,@@ -185,7 +185,7 @@ Cypress.Commands.add(url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,"X-Organization-Id": organization_id,},body: merchantAccountCreateBody,@@ -230,7 +230,7 @@ Cypress.Commands.add("merchantAccountRetrieveCall", (globalState) => {url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,},failOnStatusCode: false,}).then((response) => {@@ -274,7 +274,7 @@ Cypress.Commands.add(url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,},body: merchantAccountUpdateBody,failOnStatusCode: false,@@ -310,7 +310,7 @@ Cypress.Commands.add("businessProfileCreateCall",(businessProfileCreateBody, globalState) => {// Define the necessary variables and constants- const api_key = globalState.get("apiKey");+ const api_key = globalState.get("adminApiKey");const base_url = globalState.get("baseUrl");const merchant_id = globalState.get("merchantId");const url = `${base_url}/v2/profiles`;@@ -324,7 +324,8 @@ Cypress.Commands.add(url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,+ "x-merchant-id": merchant_id,...customHeaders,},body: businessProfileCreateBody,@@ -353,7 +354,7 @@ Cypress.Commands.add();Cypress.Commands.add("businessProfileRetrieveCall", (globalState) => {// Define the necessary variables and constants- const api_key = globalState.get("apiKey");+ const api_key = globalState.get("adminApiKey");const base_url = globalState.get("baseUrl");const merchant_id = globalState.get("merchantId");const profile_id = globalState.get("profileId");@@ -368,7 +369,7 @@ Cypress.Commands.add("businessProfileRetrieveCall", (globalState) => {url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,...customHeaders,},failOnStatusCode: false,@@ -395,7 +396,7 @@ Cypress.Commands.add("businessProfileUpdateCall",(businessProfileUpdateBody, globalState) => {// Define the necessary variables and constants- const api_key = globalState.get("apiKey");+ const api_key = globalState.get("adminApiKey");const base_url = globalState.get("baseUrl");const merchant_id = globalState.get("merchantId");const profile_id = globalState.get("profileId");@@ -410,7 +411,7 @@ Cypress.Commands.add(url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,...customHeaders,},body: businessProfileUpdateBody,@@ -460,6 +461,7 @@ Cypress.Commands.add(const customHeaders = {"x-merchant-id": merchant_id,+ "x-profile-id": profile_id,};// Update request body@@ -501,7 +503,7 @@ Cypress.Commands.add(url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,...customHeaders,},body: mcaCreateBody,@@ -536,10 +538,12 @@ Cypress.Commands.add("mcaRetrieveCall", (globalState) => {const connector_name = globalState.get("connectorId");const merchant_connector_id = globalState.get("merchantConnectorId");const merchant_id = globalState.get("merchantId");+ const profile_id = globalState.get("profileId");const url = `${base_url}/v2/connector-accounts/${merchant_connector_id}`;const customHeaders = {"x-merchant-id": merchant_id,+ "x-profile-id": profile_id,};cy.request({@@ -547,7 +551,7 @@ Cypress.Commands.add("mcaRetrieveCall", (globalState) => {url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,...customHeaders,},failOnStatusCode: false,@@ -607,7 +611,7 @@ Cypress.Commands.add(url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,...customHeaders,},body: mcaUpdateBody,@@ -667,7 +671,7 @@ Cypress.Commands.add("apiKeyCreateCall", (apiKeyCreateBody, globalState) => {url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,...customHeaders,},body: apiKeyCreateBody,@@ -714,7 +718,7 @@ Cypress.Commands.add("apiKeyRetrieveCall", (globalState) => {url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,...customHeaders,},failOnStatusCode: false,@@ -764,7 +768,7 @@ Cypress.Commands.add("apiKeyUpdateCall", (apiKeyUpdateBody, globalState) => {url: url,headers: {"Content-Type": "application/json",- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,...customHeaders,},body: apiKeyUpdateBody,@@ -1172,7 +1176,7 @@ Cypress.Commands.add("merchantAccountsListCall", (globalState) => {method: "GET",url: url,headers: {- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,"Content-Type": "application/json",},failOnStatusCode: false,@@ -1214,7 +1218,7 @@ Cypress.Commands.add("businessProfilesListCall", (globalState) => {method: "GET",url: url,headers: {- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,"Content-Type": "application/json",...customHeaders,},@@ -1250,13 +1254,14 @@ Cypress.Commands.add("mcaListCall", (globalState, service_type) => {const customHeaders = {"x-merchant-id": merchant_id,+ "x-profile-id": profile_id,};cy.request({method: "GET",url: url,headers: {- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,"Content-Type": "application/json",...customHeaders,},@@ -1318,7 +1323,7 @@ Cypress.Commands.add("apiKeysListCall", (globalState) => {method: "GET",url: url,headers: {- "api-key": api_key,+ "Authorization": `admin-api-key=${api_key}`,"Content-Type": "application/json",...customHeaders,},