@@ -425,11 +425,13 @@ create_shop_(
425425) ->
426426 ShopID = hg_utils :unique_id (),
427427 ContractID = hg_utils :unique_id (),
428+ PayoutToolID = hg_utils :unique_id (),
428429
429- ShopParams = make_shop_params (Category , ContractID ),
430+ ShopParams = make_shop_params (Category , ContractID , PayoutToolID ),
430431 ShopAccountParams = # payproc_ShopAccountParams {currency = ? cur (Currency )},
431432
432433 ContractParams = make_contract_params (TemplateRef , PaymentInstRef ),
434+ PayoutToolParams = make_payout_tool_params (),
433435
434436 TurnoverLimits1 = genlib :define (TurnoverLimits0 , ordsets :new ()),
435437
@@ -438,6 +440,14 @@ create_shop_(
438440 id = ContractID ,
439441 modification = {creation , ContractParams }
440442 }},
443+ {contract_modification , # payproc_ContractModificationUnit {
444+ id = ContractID ,
445+ modification =
446+ {payout_tool_modification , # payproc_PayoutToolModificationUnit {
447+ payout_tool_id = PayoutToolID ,
448+ modification = {creation , PayoutToolParams }
449+ }}
450+ }},
441451 ? shop_modification (ShopID , {creation , ShopParams }),
442452 ? shop_modification (ShopID , {shop_account_creation , ShopAccountParams }),
443453 ? shop_modification (ShopID , {turnover_limits_modification , TurnoverLimits1 })
@@ -460,12 +470,13 @@ create_party_and_shop(PartyID, Category, Currency, TemplateRef, PaymentInstRef,
460470 _ = create_party (PartyID , Client ),
461471 create_shop (PartyID , Category , Currency , TemplateRef , PaymentInstRef , Client ).
462472
463- make_shop_params (Category , ContractID ) ->
473+ make_shop_params (Category , ContractID , PayoutToolID ) ->
464474 # payproc_ShopParams {
465475 category = Category ,
466476 location = {url , <<>>},
467477 details = # domain_ShopDetails {name = <<" Battle Ready Shop" >>},
468- contract_id = ContractID
478+ contract_id = ContractID ,
479+ payout_tool_id = PayoutToolID
469480 }.
470481
471482make_party_params () ->
@@ -548,6 +559,19 @@ make_contractor() ->
548559 russian_bank_account = BankAccount
549560 }}}.
550561
562+ - spec make_payout_tool_params () -> dmsl_payproc_thrift :'PayoutToolParams' ().
563+ make_payout_tool_params () ->
564+ # payproc_PayoutToolParams {
565+ currency = ? cur (<<" RUB" >>),
566+ tool_info =
567+ {russian_bank_account , # domain_RussianBankAccount {
568+ account = <<" 4276300010908312893" >>,
569+ bank_name = <<" SomeBank" >>,
570+ bank_post_account = <<" 123129876" >>,
571+ bank_bik = <<" 66642666" >>
572+ }}
573+ }.
574+
551575- spec make_invoice_params (party_id (), shop_id (), binary (), cash ()) -> invoice_params ().
552576make_invoice_params (PartyID , ShopID , Product , Cost ) ->
553577 make_invoice_params (PartyID , ShopID , Product , make_due_date (), Cost ).
0 commit comments