Skip to content

Commit eb14da1

Browse files
committed
Review fixes
1 parent eff2783 commit eb14da1

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

apps/hellgate/src/hg_invoice_payment.erl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ init_(PaymentID, Params, #{timestamp := CreatedAt} = Opts) ->
436436
Revision,
437437
genlib:define(MakeRecurrent, false)
438438
),
439-
InheritedCustomerID = maybe_inherit_customer_id(CustomerID, VS0),
439+
InheritedCustomerID = inherit_or_validate_customer_id(CustomerID, VS0),
440440
Payment2 = Payment1#domain_InvoicePayment{
441441
payer_session_info = PayerSessionInfo,
442442
context = Context,
@@ -476,15 +476,15 @@ seed_bank_card_from_parent(PartyConfigRef, BCT, #{parent_payment := ParentPaymen
476476
seed_bank_card_from_parent(_PartyConfigRef, _BCT, _VS) ->
477477
[].
478478

479-
maybe_inherit_customer_id(undefined, #{parent_payment := ParentPayment}) ->
479+
inherit_or_validate_customer_id(undefined, #{parent_payment := ParentPayment}) ->
480480
(get_payment(ParentPayment))#domain_InvoicePayment.customer_id;
481-
maybe_inherit_customer_id(CustomerID, #{parent_payment := ParentPayment}) ->
481+
inherit_or_validate_customer_id(CustomerID, #{parent_payment := ParentPayment}) ->
482482
case (get_payment(ParentPayment))#domain_InvoicePayment.customer_id of
483483
CustomerID -> CustomerID;
484484
undefined -> CustomerID;
485485
_Other -> throw(#payproc_InvalidRecurrentParentPayment{details = <<"Customer ID mismatch with parent">>})
486486
end;
487-
maybe_inherit_customer_id(CustomerID, _VS) ->
487+
inherit_or_validate_customer_id(CustomerID, _VS) ->
488488
CustomerID.
489489

490490
get_merchant_payments_terms(Opts, Revision, _Timestamp, VS) ->
@@ -1962,7 +1962,6 @@ run_routing_decision_pipeline(Ctx0, VS, St) ->
19621962
Ctx0,
19631963
[
19641964
fun(Ctx) -> filter_attempted_routes(Ctx, St) end,
1965-
fun(Ctx) -> filter_routes_by_recurrent_tokens(Ctx, St) end,
19661965
fun(Ctx) -> filter_routes_with_limit_hold(Ctx, VS, NewIter, St) end,
19671966
fun(Ctx) -> filter_routes_by_limit_overflow(Ctx, VS, NewIter, St) end,
19681967
fun(Ctx) -> hg_routing:filter_by_blacklist(Ctx, build_blacklist_context(St)) end,
@@ -2028,7 +2027,8 @@ route_args(St) ->
20282027
build_routing_context(PaymentInstitution, VS, Revision, #st{cascade_recurrent_tokens = CascadeTokens} = St) when
20292028
CascadeTokens =/= undefined
20302029
->
2031-
gather_routes(PaymentInstitution, VS, Revision, St);
2030+
Ctx = gather_routes(PaymentInstitution, VS, Revision, St),
2031+
filter_routes_by_recurrent_tokens(Ctx, St);
20322032
build_routing_context(PaymentInstitution, VS, Revision, St) ->
20332033
Payer = get_payment_payer(St),
20342034
case get_predefined_route(Payer) of

rebar.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{gproc, "0.9.0"},
3232
{genlib, {git, "https://github.com/valitydev/genlib.git", {tag, "v1.1.0"}}},
3333
{woody, {git, "https://github.com/valitydev/woody_erlang.git", {tag, "v1.1.1"}}},
34-
{damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "BG-834/customer_payment"}}},
34+
{damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "customer_external_id"}}},
3535
{payproc_errors, {git, "https://github.com/valitydev/payproc-errors-erlang.git", {branch, "master"}}},
3636
{mg_proto, {git, "https://github.com/valitydev/machinegun-proto.git", {branch, "master"}}},
3737
{dmt_client, {git, "https://github.com/valitydev/dmt-client.git", {tag, "v2.0.3"}}},

rebar.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2},
2828
{<<"damsel">>,
2929
{git,"https://github.com/valitydev/damsel.git",
30-
{ref,"e69d6da26261d6f030ac4c3f0ab0f89e2bd6df02"}},
30+
{ref,"71a5310f298edd73a9e3d5c76aedd2f7b9fa4d64"}},
3131
0},
3232
{<<"dmt_client">>,
3333
{git,"https://github.com/valitydev/dmt-client.git",

0 commit comments

Comments
 (0)