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
test(cypress): add refund manual update connector_refund_id coverage for stripe (#13916)
HS-QUALIBOT5de557072504
diff --git a/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js b/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.jsindex 5818a4f32e..ef1bfab7f8 100644--- a/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js+++ b/cypress-tests/cypress/e2e/configs/Payment/BankOfAmerica.js@@ -298,15 +298,6 @@ export const connectorDetails = {},},},- ManualRefundUpdate: {- Request: {- status: "failed",- },- Response: {- status: 200,- body: {},- },- },SyncRefund: {Response: {status: 200,diff --git a/cypress-tests/cypress/e2e/configs/Payment/Commons.js b/cypress-tests/cypress/e2e/configs/Payment/Commons.jsindex f149b3d47c..79545253ee 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Commons.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Commons.js@@ -2623,7 +2623,7 @@ export const connectorDetails = {}),ManualRefundUpdate: getCustomExchange({Request: {- status: "failed",+ status: "succeeded",},Response: {status: 200,@@ -2632,7 +2632,7 @@ export const connectorDetails = {}),ManualRefundUpdateErrorCode: getCustomExchange({Request: {- status: "failed",+ status: "succeeded",error_code: {set: "TEST_ERROR_CODE",},@@ -2647,13 +2647,7 @@ export const connectorDetails = {}),ManualRefundUpdatePartialRefund: getCustomExchange({Request: {- status: "failed",- error_code: {- set: "PARTIAL_REFUND_FAILED",- },- error_message: {- set: "Partial refund failed via manual update",- },+ status: "succeeded",},Response: {status: 200,@@ -2662,7 +2656,7 @@ export const connectorDetails = {}),ManualRefundUpdateIdempotency: getCustomExchange({Request: {- status: "failed",+ status: "succeeded",error_code: {set: "IDEMPOTENCY_TEST",},@@ -2689,11 +2683,30 @@ export const connectorDetails = {body: {},},}),- SyncRefundManualUpdateFailed: getCustomExchange({+ ManualRefundUpdateConnectorRefundId: getCustomExchange({+ Request: {+ connector_refund_id: "updated_refund_id",+ },+ Response: {+ status: 200,+ body: {},+ },+ }),+ ManualRefundUpdateConnectorRefundIdWithStatus: getCustomExchange({+ Request: {+ connector_refund_id: "combined_refund_id",+ status: "succeeded",+ },+ Response: {+ status: 200,+ body: {},+ },+ }),+ SyncRefundManualUpdateSucceeded: getCustomExchange({Response: {status: 200,body: {- status: "failed",+ status: "succeeded",},},}),@@ -2701,7 +2714,7 @@ export const connectorDetails = {Response: {status: 200,body: {- status: "failed",+ status: "succeeded",error_code: "TEST_ERROR_CODE",error_message: "Test error message for manual update",},@@ -2711,9 +2724,7 @@ export const connectorDetails = {Response: {status: 200,body: {- status: "failed",- error_code: "PARTIAL_REFUND_FAILED",- error_message: "Partial refund failed via manual update",+ status: "succeeded",},},}),@@ -2721,7 +2732,7 @@ export const connectorDetails = {Response: {status: 200,body: {- status: "failed",+ status: "succeeded",error_code: "IDEMPOTENCY_TEST",error_message: "First manual update for idempotency test",},@@ -2731,7 +2742,26 @@ export const connectorDetails = {Response: {status: 200,body: {- status: "failed",+ status: "succeeded",+ error_code: null,+ error_message: null,+ },+ },+ }),+ SyncRefundManualUpdateConnectorRefundId: getCustomExchange({+ Response: {+ status: 200,+ body: {+ connector_refund_id: "updated_refund_id",+ },+ },+ }),+ SyncRefundManualUpdateConnectorRefundIdWithStatus: getCustomExchange({+ Response: {+ status: 200,+ body: {+ connector_refund_id: "combined_refund_id",+ status: "succeeded",},},}),diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.jsindex 2dd70e5d03..711a46a70e 100644--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js@@ -780,7 +780,7 @@ export const CONNECTOR_LISTS = {CARD_TESTING_GUARD: ["bankofamerica"],CLEAR_PAN_RETRY: ["bankofamerica"],L2L3DATA: ["checkout", "nuvei", "stripe", "worldpayvantiv"],- REFUND_MANUAL_UPDATE: ["bankofamerica", "cybersource"],+ REFUND_MANUAL_UPDATE: ["stripe"],REFUND_TYPE: ["stripe", "adyen", "checkout"],MANUAL_PAYMENT_UPDATE: ["stripe"],CRYPTO_PAYMENT: ["bitpay", "coingate", "cryptopay"],diff --git a/cypress-tests/cypress/e2e/spec/Payment/09-RefundPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/09-RefundPayment.cy.jsindex 8323dc09d6..4c0912f13c 100644--- a/cypress-tests/cypress/e2e/spec/Payment/09-RefundPayment.cy.js+++ b/cypress-tests/cypress/e2e/spec/Payment/09-RefundPayment.cy.js@@ -1,6 +1,7 @@import * as fixtures from "../../../fixtures/imports";import State from "../../../utils/State";import getConnectorDetails, * as utils from "../../configs/Payment/Utils";+import { isMockServer } from "../../../support/mitmProxy";let globalState;@@ -1959,3 +1960,734 @@ describe("Card - Refund flow - 3DS", () => {});});});++describe("Card - Refund Manual Update - No 3DS", () => {+ before(function () {+ let skip = false;++ cy.task("getGlobalState")+ .then((state) => {+ globalState = new State(state);+ const connector = globalState.get("connectorId");++ if (+ utils.shouldIncludeConnector(+ connector,+ utils.CONNECTOR_LISTS.INCLUDE.REFUND_MANUAL_UPDATE+ )+ ) {+ skip = true;+ }+ })+ .then(() => {+ if (skip) {+ this.skip();+ }+ });+ });++ beforeEach(function () {+ if (isMockServer()) {+ this.skip();+ }+ });++ afterEach("flush global state", () => {+ cy.task("setGlobalState", globalState.data);+ });++ context("Manual Update - Status Change (succeeded -> succeeded)", () => {+ it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update Status -> Retrieve Refund to Verify", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntent"];+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Payment Methods Call", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Payment Methods Call");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm Payment Intent", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Confirm Payment Intent");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["No3DSAutoCapture"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Create Refund", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Create Refund");+ return;+ }+ const refundData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["Refund"];+ cy.refundCallTest(fixtures.refundBody, refundData, globalState);+ if (!utils.should_continue_further(refundData)) {+ shouldContinue = false;+ }+ });++ cy.step("Manual Update Refund Status to Succeeded", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Manual Update Refund Status to Succeeded"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdate"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Refund to Verify Status Update", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Retrieve Refund to Verify Status Update"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["SyncRefundManualUpdateSucceeded"];+ cy.syncRefundCallTest(data, globalState);+ });+ });+ });++ context("Manual Update - Set Error Code and Error Message", () => {+ it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update Error Code/Message -> Retrieve Refund to Verify", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntent"];+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Payment Methods Call", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Payment Methods Call");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm Payment Intent", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Confirm Payment Intent");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["No3DSAutoCapture"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Create Refund", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Create Refund");+ return;+ }+ const refundData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["Refund"];+ cy.refundCallTest(fixtures.refundBody, refundData, globalState);+ if (!utils.should_continue_further(refundData)) {+ shouldContinue = false;+ }+ });++ cy.step("Manual Update Error Code and Error Message", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Manual Update Error Code and Error Message"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdateErrorCode"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Refund to Verify Error Code and Message", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Retrieve Refund to Verify Error Code and Message"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["SyncRefundManualUpdateErrorCode"];+ cy.syncRefundCallTest(data, globalState);+ });+ });+ });++ context("Manual Update - Partial Refund Status Update", () => {+ it("Create Payment Intent -> Confirm Payment -> Create Partial Refund -> Manual Update Status -> Retrieve Refund to Verify", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntent"];+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Payment Methods Call", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Payment Methods Call");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm Payment Intent", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Confirm Payment Intent");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["No3DSAutoCapture"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Create Partial Refund", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Create Partial Refund");+ return;+ }+ const partialRefundData = getConnectorDetails(+ globalState.get("connectorId")+ )["card_pm"]["PartialRefund"];+ cy.refundCallTest(fixtures.refundBody, partialRefundData, globalState);+ if (!utils.should_continue_further(partialRefundData)) {+ shouldContinue = false;+ }+ });++ cy.step("Manual Update Partial Refund Status to Succeeded", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Manual Update Partial Refund Status to Succeeded"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdatePartialRefund"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Partial Refund to Verify Status Update", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Retrieve Partial Refund to Verify Status Update"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["SyncRefundManualUpdatePartialRefund"];+ cy.syncRefundCallTest(data, globalState);+ });+ });+ });++ context("Manual Update - Idempotency Test (Multiple Updates)", () => {+ it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update 1 -> Manual Update 2 (Same Data) -> Retrieve to Verify Idempotency", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntent"];+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Payment Methods Call", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Payment Methods Call");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm Payment Intent", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Confirm Payment Intent");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["No3DSAutoCapture"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Create Refund", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Create Refund");+ return;+ }+ const refundData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["Refund"];+ cy.refundCallTest(fixtures.refundBody, refundData, globalState);+ if (!utils.should_continue_further(refundData)) {+ shouldContinue = false;+ }+ });++ cy.step("Manual Update 1 - Set Error Code and Message", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Manual Update 1 - Set Error Code and Message"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdateIdempotency"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Manual Update 2 - Same Data (Idempotency Check)", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Manual Update 2 - Same Data (Idempotency Check)"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdateIdempotency"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Refund to Verify Idempotency", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Retrieve Refund to Verify Idempotency"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["SyncRefundManualUpdateIdempotency"];+ cy.syncRefundCallTest(data, globalState);+ });+ });+ });++ context("Manual Update - Unset Error Code and Error Message", () => {+ it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update with Error -> Unset Error Fields -> Retrieve to Verify", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntent"];+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Payment Methods Call", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Payment Methods Call");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm Payment Intent", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Confirm Payment Intent");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["No3DSAutoCapture"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Create Refund", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Create Refund");+ return;+ }+ const refundData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["Refund"];+ cy.refundCallTest(fixtures.refundBody, refundData, globalState);+ if (!utils.should_continue_further(refundData)) {+ shouldContinue = false;+ }+ });++ cy.step("Manual Update with Error Code and Message", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Manual Update with Error Code and Message"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdateErrorCode"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Unset Error Code and Error Message", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Unset Error Code and Error Message"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdateUnset"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Refund to Verify Unset Fields", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Retrieve Refund to Verify Unset Fields"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["SyncRefundManualUpdateUnset"];+ cy.syncRefundCallTest(data, globalState);+ });+ });+ });++ context("Manual Update - Connector Refund ID", () => {+ it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update Connector Refund ID -> Retrieve Refund to Verify", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntent"];+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Payment Methods Call", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Payment Methods Call");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm Payment Intent", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Confirm Payment Intent");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["No3DSAutoCapture"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Create Refund", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Create Refund");+ return;+ }+ const refundData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["Refund"];+ cy.refundCallTest(fixtures.refundBody, refundData, globalState);+ if (!utils.should_continue_further(refundData)) {+ shouldContinue = false;+ }+ });++ cy.step("Manual Update Connector Refund ID", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Manual Update Connector Refund ID"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdateConnectorRefundId"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Retrieve Refund to Verify Connector Refund ID", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Retrieve Refund to Verify Connector Refund ID"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["SyncRefundManualUpdateConnectorRefundId"];+ cy.syncRefundCallTest(data, globalState);+ });+ });+ });++ context("Manual Update - Connector Refund ID with Status", () => {+ it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update Connector Refund ID and Status -> Retrieve Refund to Verify", () => {+ let shouldContinue = true;++ cy.step("Create Payment Intent", () => {+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["PaymentIntent"];+ cy.createPaymentIntentTest(+ fixtures.createPaymentBody,+ data,+ "no_three_ds",+ "automatic",+ globalState+ );+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step("Payment Methods Call", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Payment Methods Call");+ return;+ }+ cy.paymentMethodsCallTest(globalState);+ });++ cy.step("Confirm Payment Intent", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Confirm Payment Intent");+ return;+ }+ const confirmData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["No3DSAutoCapture"];+ cy.confirmCallTest(+ fixtures.confirmBody,+ confirmData,+ true,+ globalState+ );+ if (!utils.should_continue_further(confirmData)) {+ shouldContinue = false;+ }+ });++ cy.step("Create Refund", () => {+ if (!shouldContinue) {+ cy.task("cli_log", "Skipping step: Create Refund");+ return;+ }+ const refundData = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["Refund"];+ cy.refundCallTest(fixtures.refundBody, refundData, globalState);+ if (!utils.should_continue_further(refundData)) {+ shouldContinue = false;+ }+ });++ cy.step("Manual Update Connector Refund ID and Status", () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Manual Update Connector Refund ID and Status"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["ManualRefundUpdateConnectorRefundIdWithStatus"];+ cy.manualRefundStatusUpdateTest(globalState, data);+ if (!utils.should_continue_further(data)) {+ shouldContinue = false;+ }+ });++ cy.step(+ "Retrieve Refund to Verify Connector Refund ID and Status",+ () => {+ if (!shouldContinue) {+ cy.task(+ "cli_log",+ "Skipping step: Retrieve Refund to Verify Connector Refund ID and Status"+ );+ return;+ }+ const data = getConnectorDetails(globalState.get("connectorId"))[+ "card_pm"+ ]["SyncRefundManualUpdateConnectorRefundIdWithStatus"];+ cy.syncRefundCallTest(data, globalState);+ }+ );+ });+ });+});diff --git a/cypress-tests/cypress/e2e/spec/Payment/47-RefundManualUpdate.cy.js b/cypress-tests/cypress/e2e/spec/Payment/47-RefundManualUpdate.cy.jsdeleted file mode 100644index ff0f49862d..0000000000--- a/cypress-tests/cypress/e2e/spec/Payment/47-RefundManualUpdate.cy.js+++ /dev/null@@ -1,542 +0,0 @@-import * as fixtures from "../../../fixtures/imports";-import State from "../../../utils/State";-import getConnectorDetails, * as utils from "../../configs/Payment/Utils";--let globalState;--describe("Refund Manual Update Tests", () => {- before(function () {- let skip = false;-- cy.task("getGlobalState")- .then((state) => {- globalState = new State(state);- const connector = globalState.get("connectorId");-- if (- utils.shouldIncludeConnector(- connector,- utils.CONNECTOR_LISTS.INCLUDE.REFUND_MANUAL_UPDATE- )- ) {- skip = true;- }- })- .then(() => {- if (skip) {- this.skip();- }- });- });-- afterEach("flush global state", () => {- cy.task("setGlobalState", globalState.data);- });-- context("Manual Update - Status Change (pending -> failed)", () => {- it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update Status -> Retrieve Refund to Verify", () => {- let shouldContinue = true;-- cy.step("Create Payment Intent", () => {- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["PaymentIntent"];- cy.createPaymentIntentTest(- fixtures.createPaymentBody,- data,- "no_three_ds",- "automatic",- globalState- );- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Payment Methods Call", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Payment Methods Call");- return;- }- cy.paymentMethodsCallTest(globalState);- });-- cy.step("Confirm Payment Intent", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Confirm Payment Intent");- return;- }- const confirmData = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["No3DSAutoCapture"];- cy.confirmCallTest(- fixtures.confirmBody,- confirmData,- true,- globalState- );- if (!utils.should_continue_further(confirmData)) {- shouldContinue = false;- }- });-- cy.step("Create Refund", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Create Refund");- return;- }- const refundData = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["Refund"];- cy.refundCallTest(fixtures.refundBody, refundData, globalState);- if (!utils.should_continue_further(refundData)) {- shouldContinue = false;- }- });-- cy.step("Manual Update Refund Status to Failed", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Manual Update Refund Status to Failed"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["ManualRefundUpdate"];- cy.manualRefundStatusUpdateTest(globalState, data);- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Retrieve Refund to Verify Status Update", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Retrieve Refund to Verify Status Update"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["SyncRefundManualUpdateFailed"];- cy.syncRefundCallTest(data, globalState);- });- });- });-- context(- "Manual Update - Error Code and Error Message with SetOrUnset",- () => {- it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update Error Code/Message -> Retrieve Refund to Verify", () => {- let shouldContinue = true;-- cy.step("Create Payment Intent", () => {- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["PaymentIntent"];- cy.createPaymentIntentTest(- fixtures.createPaymentBody,- data,- "no_three_ds",- "automatic",- globalState- );- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Payment Methods Call", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Payment Methods Call");- return;- }- cy.paymentMethodsCallTest(globalState);- });-- cy.step("Confirm Payment Intent", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Confirm Payment Intent");- return;- }- const confirmData = getConnectorDetails(- globalState.get("connectorId")- )["card_pm"]["No3DSAutoCapture"];- cy.confirmCallTest(- fixtures.confirmBody,- confirmData,- true,- globalState- );- if (!utils.should_continue_further(confirmData)) {- shouldContinue = false;- }- });-- cy.step("Create Refund", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Create Refund");- return;- }- const refundData = getConnectorDetails(- globalState.get("connectorId")- )["card_pm"]["Refund"];- cy.refundCallTest(fixtures.refundBody, refundData, globalState);- if (!utils.should_continue_further(refundData)) {- shouldContinue = false;- }- });-- cy.step("Manual Update Error Code and Error Message", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Manual Update Error Code and Error Message"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["ManualRefundUpdateErrorCode"];- cy.manualRefundStatusUpdateTest(globalState, data);- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Retrieve Refund to Verify Error Code and Message", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Retrieve Refund to Verify Error Code and Message"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["SyncRefundManualUpdateErrorCode"];- cy.syncRefundCallTest(data, globalState);- });- });- }- );-- context("Manual Update - Partial Refund Status Update", () => {- it("Create Payment Intent -> Confirm Payment -> Create Partial Refund -> Manual Update Status -> Retrieve Refund to Verify", () => {- let shouldContinue = true;-- cy.step("Create Payment Intent", () => {- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["PaymentIntent"];- cy.createPaymentIntentTest(- fixtures.createPaymentBody,- data,- "no_three_ds",- "automatic",- globalState- );- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Payment Methods Call", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Payment Methods Call");- return;- }- cy.paymentMethodsCallTest(globalState);- });-- cy.step("Confirm Payment Intent", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Confirm Payment Intent");- return;- }- const confirmData = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["No3DSAutoCapture"];- cy.confirmCallTest(- fixtures.confirmBody,- confirmData,- true,- globalState- );- if (!utils.should_continue_further(confirmData)) {- shouldContinue = false;- }- });-- cy.step("Create Partial Refund", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Create Partial Refund");- return;- }- const partialRefundData = getConnectorDetails(- globalState.get("connectorId")- )["card_pm"]["PartialRefund"];- cy.refundCallTest(fixtures.refundBody, partialRefundData, globalState);- if (!utils.should_continue_further(partialRefundData)) {- shouldContinue = false;- }- });-- cy.step("Manual Update Partial Refund Status to Failed", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Manual Update Partial Refund Status to Failed"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["ManualRefundUpdatePartialRefund"];- cy.manualRefundStatusUpdateTest(globalState, data);- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Retrieve Partial Refund to Verify Status Update", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Retrieve Partial Refund to Verify Status Update"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["SyncRefundManualUpdatePartialRefund"];- cy.syncRefundCallTest(data, globalState);- });- });- });-- context("Manual Update - Idempotency Test (Multiple Updates)", () => {- it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update 1 -> Manual Update 2 (Same Data) -> Retrieve to Verify Idempotency", () => {- let shouldContinue = true;-- cy.step("Create Payment Intent", () => {- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["PaymentIntent"];- cy.createPaymentIntentTest(- fixtures.createPaymentBody,- data,- "no_three_ds",- "automatic",- globalState- );- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Payment Methods Call", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Payment Methods Call");- return;- }- cy.paymentMethodsCallTest(globalState);- });-- cy.step("Confirm Payment Intent", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Confirm Payment Intent");- return;- }- const confirmData = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["No3DSAutoCapture"];- cy.confirmCallTest(- fixtures.confirmBody,- confirmData,- true,- globalState- );- if (!utils.should_continue_further(confirmData)) {- shouldContinue = false;- }- });-- cy.step("Create Refund", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Create Refund");- return;- }- const refundData = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["Refund"];- cy.refundCallTest(fixtures.refundBody, refundData, globalState);- if (!utils.should_continue_further(refundData)) {- shouldContinue = false;- }- });-- cy.step("Manual Update 1 - Set Error Code and Message", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Manual Update 1 - Set Error Code and Message"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["ManualRefundUpdateIdempotency"];- cy.manualRefundStatusUpdateTest(globalState, data);- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Manual Update 2 - Same Data (Idempotency Check)", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Manual Update 2 - Same Data (Idempotency Check)"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["ManualRefundUpdateIdempotency"];- cy.manualRefundStatusUpdateTest(globalState, data);- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Retrieve Refund to Verify Idempotency", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Retrieve Refund to Verify Idempotency"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["SyncRefundManualUpdateIdempotency"];- cy.syncRefundCallTest(data, globalState);- });- });- });-- context("Manual Update - Unset Error Fields", () => {- it("Create Payment Intent -> Confirm Payment -> Create Refund -> Manual Update with Error -> Unset Error Fields -> Retrieve to Verify", () => {- let shouldContinue = true;-- cy.step("Create Payment Intent", () => {- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["PaymentIntent"];- cy.createPaymentIntentTest(- fixtures.createPaymentBody,- data,- "no_three_ds",- "automatic",- globalState- );- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Payment Methods Call", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Payment Methods Call");- return;- }- cy.paymentMethodsCallTest(globalState);- });-- cy.step("Confirm Payment Intent", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Confirm Payment Intent");- return;- }- const confirmData = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["No3DSAutoCapture"];- cy.confirmCallTest(- fixtures.confirmBody,- confirmData,- true,- globalState- );- if (!utils.should_continue_further(confirmData)) {- shouldContinue = false;- }- });-- cy.step("Create Refund", () => {- if (!shouldContinue) {- cy.task("cli_log", "Skipping step: Create Refund");- return;- }- const refundData = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["Refund"];- cy.refundCallTest(fixtures.refundBody, refundData, globalState);- if (!utils.should_continue_further(refundData)) {- shouldContinue = false;- }- });-- cy.step("Manual Update with Error Code and Message", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Manual Update with Error Code and Message"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["ManualRefundUpdateErrorCode"];- cy.manualRefundStatusUpdateTest(globalState, data);- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Unset Error Code and Error Message", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Unset Error Code and Error Message"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["ManualRefundUpdateUnset"];- cy.manualRefundStatusUpdateTest(globalState, data);- if (!utils.should_continue_further(data)) {- shouldContinue = false;- }- });-- cy.step("Retrieve Refund to Verify Unset Fields", () => {- if (!shouldContinue) {- cy.task(- "cli_log",- "Skipping step: Retrieve Refund to Verify Unset Fields"- );- return;- }- const data = getConnectorDetails(globalState.get("connectorId"))[- "card_pm"- ]["SyncRefundManualUpdateUnset"];- cy.syncRefundCallTest(data, globalState);- });- });- });-});diff --git a/cypress-tests/cypress/utils/specSelection/config.js b/cypress-tests/cypress/utils/specSelection/config.jsindex 85fbfceaea..af94b215cb 100644--- a/cypress-tests/cypress/utils/specSelection/config.js+++ b/cypress-tests/cypress/utils/specSelection/config.js@@ -145,7 +145,6 @@ const PAYMENT_SPEC_METHODS = Object.freeze({"46-StepUpRetries.cy.js": ["card"],"47-ManualPaymentUpdate.cy.js": ["card"],"47-PollConfig.cy.js": ["card"],- "47-RefundManualUpdate.cy.js": ["card"],"47-StepUpAuth.cy.js": ["card"],"47-WalletMandates.cy.js": ["wallet"],"48-CardTestingGuard.cy.js": ["card"],