Conversation
WWWcool
left a comment
There was a problem hiding this comment.
Не понял в какой момент происходит добавление реккурентного токена к карте/кастумеру - это по идее на получение от провайдера должно работать, но кода нет. Тестов мало, нужен тесты на каскад и подтверждением работы
| adjustments = [] :: [hg_invoice_payment:adjustment()], | ||
| recurrent_token :: undefined | dmsl_domain_thrift:'Token'(), | ||
| cascade_recurrent_tokens :: | ||
| undefined | #{dmsl_customer_thrift:'ProviderTerminalKey'() => dmsl_domain_thrift:'Token'()}, |
There was a problem hiding this comment.
| undefined | #{dmsl_customer_thrift:'ProviderTerminalKey'() => dmsl_domain_thrift:'Token'()}, | |
| undefined | hg_customer_client:cascade_tokens(), |
| init_per_testcase(Name, C) -> | ||
| init_per_testcase(default, Name, C). | ||
|
|
||
| init_per_testcase(default, Name, C) -> |
| CustomerID = <<"test-customer-42">>, | ||
| RecurrentParent = ?recurrent_parent(Invoice1ID, Payment1ID), | ||
| BaseParams = make_recurrent_payment_params(true, RecurrentParent, ?pmt_sys(<<"visa-ref">>)), | ||
| Payment2Params = BaseParams#payproc_InvoicePaymentParams{customer_id = CustomerID}, |
There was a problem hiding this comment.
а если не передать парент реккурент - сохранится?
| %% Second recurrent payment: hellgate queries cubasty, gets token for ?prv(1)/?trm(1) | ||
| Invoice2ID = start_invoice(<<"rubberduck">>, make_due_date(10), 42000, C), | ||
| RecurrentParent = ?recurrent_parent(Invoice1ID, Payment1ID), | ||
| Payment2Params = make_recurrent_payment_params(true, RecurrentParent, ?pmt_sys(<<"visa-ref">>)), |
There was a problem hiding this comment.
при этом здесь у тебя нет указания кастумера - что то я теряюсь в том что происходит, пойду дальше код платежа смотреть)
| {genlib, {git, "https://github.com/valitydev/genlib.git", {tag, "v1.1.0"}}}, | ||
| {woody, {git, "https://github.com/valitydev/woody_erlang.git", {tag, "v1.1.1"}}}, | ||
| {damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.27"}}}, | ||
| {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "BG-834/customer_payment"}}}, |
| end, | ||
| Events = [?payment_started(Payment2)], | ||
| {collapse_changes(Events, undefined, #{}), {Events, hg_machine_action:instant()}}. | ||
| InitSt = #st{activity = {payment, new}, cascade_recurrent_tokens = CascadeTokens}, |
There was a problem hiding this comment.
то есть в событиях это не летит и нельзя будет понять откуда ноги растут - логов у клиента тоже нет
|
|
||
| filter_routes_by_recurrent_tokens(Ctx, #st{cascade_recurrent_tokens = undefined}) -> | ||
| Ctx; | ||
| filter_routes_by_recurrent_tokens(Ctx, #st{cascade_recurrent_tokens = Tokens}) when map_size(Tokens) =:= 0 -> |
There was a problem hiding this comment.
ты же там сверху на ините проверяешь что их больше 0, тут может быть такой клаус?
| -spec process_routing(action(), st()) -> machine_result(). | ||
| process_routing(Action, St) -> | ||
| {PaymentInstitution, VS, Revision} = route_args(St), | ||
| Ctx0 = hg_routing_ctx:with_guard(build_routing_context(PaymentInstitution, VS, Revision, St)), |
There was a problem hiding this comment.
вот тут он у тебя выберет 1 роут из родительского реккурента и никакого каскада не будет
No description provided.