Skip to content

Commit eff2783

Browse files
committed
Fixes
1 parent eac7a90 commit eff2783

3 files changed

Lines changed: 9 additions & 17 deletions

File tree

apps/hellgate/src/hg_invoice_payment.erl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,23 +1958,19 @@ run_routing_decision_pipeline(Ctx0, VS, St) ->
19581958
%% NOTE Since this is routing step then current attempt is not yet
19591959
%% accounted for in `St`.
19601960
NewIter = get_iter(St) + 1,
1961-
{TokenFilterFn, ChooseRouteFn} = cascade_pipeline_fns(St),
19621961
hg_routing_ctx:pipeline(
19631962
Ctx0,
19641963
[
19651964
fun(Ctx) -> filter_attempted_routes(Ctx, St) end,
1966-
TokenFilterFn,
1965+
fun(Ctx) -> filter_routes_by_recurrent_tokens(Ctx, St) end,
19671966
fun(Ctx) -> filter_routes_with_limit_hold(Ctx, VS, NewIter, St) end,
19681967
fun(Ctx) -> filter_routes_by_limit_overflow(Ctx, VS, NewIter, St) end,
19691968
fun(Ctx) -> hg_routing:filter_by_blacklist(Ctx, build_blacklist_context(St)) end,
19701969
fun hg_routing:filter_by_critical_provider_status/1,
1971-
ChooseRouteFn
1970+
fun hg_routing:choose_route_with_ctx/1
19721971
]
19731972
).
19741973

1975-
cascade_pipeline_fns(St) ->
1976-
{fun(Ctx) -> filter_routes_by_recurrent_tokens(Ctx, St) end, fun hg_routing:choose_route_with_ctx/1}.
1977-
19781974
produce_routing_events(#{error := Error} = Ctx, Revision, St) when Error =/= undefined ->
19791975
%% TODO Pass failure subcode from error. Say, if last candidates were
19801976
%% rejected because of provider gone critical, then use subcode to highlight

apps/hellgate/test/hg_direct_recurrent_tests_SUITE.erl

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,12 @@ init_per_testcase(Name, C) ->
190190
].
191191

192192
-spec end_per_testcase(test_case_name(), config()) -> ok.
193-
end_per_testcase(cascade_recurrent_payment_success_test, _C) ->
194-
restore_domain_after_cascade(),
195-
ok;
196-
end_per_testcase(new_client_old_card_cascade_test, _C) ->
197-
restore_domain_after_cascade(),
198-
ok;
199-
end_per_testcase(cascade_exhaustion_test, _C) ->
200-
restore_domain_after_cascade(),
201-
ok;
202-
end_per_testcase(cascade_routing_filter_test, _C) ->
193+
end_per_testcase(Name, _C) when
194+
Name =:= cascade_recurrent_payment_success_test;
195+
Name =:= new_client_old_card_cascade_test;
196+
Name =:= cascade_exhaustion_test;
197+
Name =:= cascade_routing_filter_test
198+
->
203199
restore_domain_after_cascade(),
204200
ok;
205201
end_per_testcase(_Name, _C) ->

apps/hellgate/test/hg_dummy_provider.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ get_payment_tool_scenario(
613613
mobile_commerce;
614614
get_payment_tool_scenario({'bank_card', #domain_BankCard{token = Token} = BCard}) ->
615615
%% Strip unique test suffix (e.g. <<"no_preauth/42">> -> <<"no_preauth">>)
616-
[Base, _Suffix] = binary:split(Token, <<"/">>),
616+
[Base | _Suffix] = binary:split(Token, <<"/">>),
617617
get_payment_tool_scenario({'bank_card', BCard#domain_BankCard{token = Base}}).
618618

619619
-type tokenized_bank_card_payment_system() ::

0 commit comments

Comments
 (0)