From e83c19a69d511957730502c5cea28ba5bc8f71e1 Mon Sep 17 00:00:00 2001 From: Aleksey Kashapov Date: Thu, 16 May 2024 12:57:47 +0300 Subject: [PATCH] =?UTF-8?q?Revert=20"Revert=20"TD-831:=20Allow=20adjustmen?= =?UTF-8?q?t=20change=20of=20amount=20in=20Payment=20in=20failed=20state?= =?UTF-8?q?=20=E2=80=A6"=20(#127)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1442bbcc3d1dceeb135a81dd98d410908ad0450c. --- apps/hellgate/src/hg_invoice_payment.erl | 2 +- apps/hellgate/test/hg_invoice_tests_SUITE.erl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/hellgate/src/hg_invoice_payment.erl b/apps/hellgate/src/hg_invoice_payment.erl index c7fdc691..dafbc176 100644 --- a/apps/hellgate/src/hg_invoice_payment.erl +++ b/apps/hellgate/src/hg_invoice_payment.erl @@ -1463,7 +1463,7 @@ create_adjustment(Timestamp, Params, St, Opts) -> create_cash_flow_adjustment(Timestamp, Params, DomainRevision, St, Opts) -> Payment = get_payment(St), Route = get_route(St), - _ = assert_payment_status([captured, refunded, charged_back], Payment), + _ = assert_payment_status([captured, refunded, charged_back, failed], Payment), NewRevision = maybe_get_domain_revision(DomainRevision), PartyRevision = get_opts_party_revision(Opts), OldCashFlow = get_final_cashflow(St), diff --git a/apps/hellgate/test/hg_invoice_tests_SUITE.erl b/apps/hellgate/test/hg_invoice_tests_SUITE.erl index 362175a8..cd380cf0 100644 --- a/apps/hellgate/test/hg_invoice_tests_SUITE.erl +++ b/apps/hellgate/test/hg_invoice_tests_SUITE.erl @@ -2384,7 +2384,8 @@ invalid_payment_adjustment(C) -> _UserInteraction = await_payment_process_interaction(InvoiceID, PaymentID, Client), PaymentID = await_payment_process_timeout(InvoiceID, PaymentID, Client), %% no way to create adjustment for a failed payment - ?invalid_payment_status(?failed(_)) = + %% Correction. It was changed to failed payment not being in the way of adjustment + ?adjustment(_AdjustmentID, ?adjustment_pending()) = hg_client_invoicing:create_payment_adjustment(InvoiceID, PaymentID, make_adjustment_params(), Client). -spec payment_adjustment_success(config()) -> test_return().