@@ -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
476476seed_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
490490get_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) ->
20282027build_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 );
20322032build_routing_context (PaymentInstitution , VS , Revision , St ) ->
20332033 Payer = get_payment_payer (St ),
20342034 case get_predefined_route (Payer ) of
0 commit comments