-
Notifications
You must be signed in to change notification settings - Fork 7
HG-544: shumaich payments #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: HG-544/ft/shumaich
Are you sure you want to change the base?
Conversation
…o HG-544/ft/shumaich_payments
…o HG-544/ft/shumaich_payments
…o HG-544/ft/shumaich_payments
| PaymentID = process_payment(InvoiceID, PaymentParams, Client), | ||
| ?assertMatch(#{min_available_amount := 0, max_available_amount := 40110}, hg_ct_helper:get_balance(SettlementID)), | ||
| ?assertMatch( | ||
| #{min_available_amount := -1890, max_available_amount := 42000}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
хм, а отрицательный min_available_amount какой смысл несёт?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мерчант может задолжать размер комиссии? Не знаю, @PospolitaNV сказал, что шумаич по другому считает балансы, и это, вроде как, правильный результат.
| Timestamp | ||
| ), | ||
| Events = [?cash_flow_changed(FinalCashflow)], | ||
| Events = [?cash_flow_changed(FinalCashflow), ?payment_clock_update(Clock)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что будет после этой строчки если мы упадем, сделаем ретрай. И вызовем второй раз hold, Clock вернется другой? Это будет один и тот же hold или разные?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кажется, что эта ситуация не будет отличаться от текущей. Clock - время последней известной операции для сущности, идемпотентность оно не обеспечивает.
| {payment, cash_flow_building} -> | ||
| St#st{ | ||
| clock = Clock, | ||
| activity = {payment, processing_session} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем выносить определение activity на этот этап? Почему clock обновляется только для cash_flow_build и processing_capture а для остальных игнорируется?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, кажется вполне можно обойтись и без этого
…ft/shumaich_payments
…ft/shumaich_payments
…ft/shumaich_payments
…ft/shumaich_payments
…ft/shumaich_payments
…ft/shumaich_payments
…ft/shumaich_payments
…ft/shumaich_payments
…ft/shumaich_payments
…ft/shumaich_payments
It might be reasonable to add a separate activity for handling clocks but that will require quite a lot of changes in the logic.