Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/erlang-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
thrift-version: ${{ steps.thrift-version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- run: grep -v '^#' .env >> $GITHUB_ENV
- id: otp-version
run: echo "::set-output name=version::$OTP_VERSION"
Expand All @@ -30,7 +30,7 @@ jobs:
run:
name: Run checks
needs: setup
uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1.0.17
uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1.0.18
with:
otp-version: ${{ needs.setup.outputs.otp-version }}
rebar-version: ${{ needs.setup.outputs.rebar-version }}
Expand Down
8 changes: 0 additions & 8 deletions apps/hellgate/src/hg_invoice_payment_chargeback.erl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ do_accept(State, PaymentState, AcceptParams = ?accept_params(Levy, Body)) ->

-spec do_reopen(state(), payment_state(), reopen_params()) -> {ok, result()} | no_return().
do_reopen(State, PaymentState, ReopenParams = ?reopen_params(Levy, Body)) ->
_ = validate_chargeback_is_rejected(State),
_ = validate_not_arbitration(State),
_ = validate_currency(Body, hg_invoice_payment:get_payment(PaymentState)),
_ = validate_currency(Levy, hg_invoice_payment:get_payment(PaymentState)),
Expand Down Expand Up @@ -597,13 +596,6 @@ validate_not_arbitration(#domain_InvoicePaymentChargeback{stage = ?chargeback_st
validate_not_arbitration(#domain_InvoicePaymentChargeback{}) ->
ok.

validate_chargeback_is_rejected(#chargeback_st{chargeback = Chargeback}) ->
validate_chargeback_is_rejected(Chargeback);
validate_chargeback_is_rejected(#domain_InvoicePaymentChargeback{status = ?chargeback_status_rejected()}) ->
ok;
validate_chargeback_is_rejected(#domain_InvoicePaymentChargeback{status = Status}) ->
throw(#payproc_InvoicePaymentChargebackInvalidStatus{status = Status}).

validate_chargeback_is_pending(#chargeback_st{chargeback = Chargeback}) ->
validate_chargeback_is_pending(Chargeback);
validate_chargeback_is_pending(#domain_InvoicePaymentChargeback{status = ?chargeback_status_pending()}) ->
Expand Down
26 changes: 0 additions & 26 deletions apps/hellgate/test/hg_invoice_tests_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
-export([accept_payment_chargeback_twice/1]).
-export([accept_payment_chargeback_new_body/1]).
-export([accept_payment_chargeback_new_levy/1]).
-export([reopen_accepted_payment_chargeback_fails/1]).
-export([reopen_payment_chargeback_inconsistent/1]).
-export([reopen_payment_chargeback_exceeded/1]).
-export([reopen_payment_chargeback_cancel/1]).
Expand Down Expand Up @@ -389,7 +388,6 @@ groups() ->
accept_payment_chargeback_twice,
accept_payment_chargeback_new_body,
accept_payment_chargeback_new_levy,
reopen_accepted_payment_chargeback_fails,
reopen_payment_chargeback_inconsistent,
reopen_payment_chargeback_exceeded,
reopen_payment_chargeback_cancel,
Expand Down Expand Up @@ -4064,30 +4062,6 @@ accept_payment_chargeback_new_levy(C) ->
?assertEqual(Paid - Cost - NewLevyAmount, maps:get(min_available_amount, Settlement1)),
?assertEqual(Paid - Cost - NewLevyAmount, maps:get(max_available_amount, Settlement1)).

-spec reopen_accepted_payment_chargeback_fails(config()) -> _ | no_return().
reopen_accepted_payment_chargeback_fails(C) ->
Client = cfg(client, C),
Cost = 42000,
LevyAmount = 5000,
Levy = ?cash(LevyAmount, <<"RUB">>),
CBParams = make_chargeback_params(Levy),
{IID, PID, _SID, CB} = start_chargeback(C, Cost, CBParams, make_payment_params(?pmt_sys(<<"visa-ref">>))),
CBID = CB#domain_InvoicePaymentChargeback.id,
[
?payment_ev(PID, ?chargeback_ev(CBID, ?chargeback_created(CB))),
?payment_ev(PID, ?chargeback_ev(CBID, ?chargeback_cash_flow_changed(_)))
] = next_changes(IID, 2, Client),
AcceptParams = make_chargeback_accept_params(),
ok = hg_client_invoicing:accept_chargeback(IID, PID, CBID, AcceptParams, Client),
[
?payment_ev(PID, ?chargeback_ev(CBID, ?chargeback_target_status_changed(?chargeback_status_accepted()))),
?payment_ev(PID, ?chargeback_ev(CBID, ?chargeback_status_changed(?chargeback_status_accepted()))),
?payment_ev(PID, ?payment_status_changed(?charged_back()))
] = next_changes(IID, 3, Client),
ReopenParams = make_chargeback_reopen_params(Levy),
Error = hg_client_invoicing:reopen_chargeback(IID, PID, CBID, ReopenParams, Client),
?assertMatch(?invalid_chargeback_status(_), Error).

-spec reopen_payment_chargeback_inconsistent(config()) -> _ | no_return().
reopen_payment_chargeback_inconsistent(C) ->
Client = cfg(client, C),
Expand Down
4 changes: 1 addition & 3 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@
% for introspection on production
{recon, "2.5.2"},
{logger_logstash_formatter,
{git, "https://github.com/valitydev/logger_logstash_formatter.git", {ref, "08a66a6"}}},
{iosetopts, {git, "https://github.com/valitydev/iosetopts.git", {ref, "edb445c"}}}
{git, "https://github.com/valitydev/logger_logstash_formatter.git", {ref, "08a66a6"}}}
]},
{relx, [
{release, {hellgate, "0.1"}, [
iosetopts,
{recon, load},
{runtime_tools, load},
{tools, load},
Expand Down
Loading