Skip to content

Conversation

@aenglisc
Copy link
Contributor

@aenglisc aenglisc commented Nov 30, 2020

It might be reasonable to add a separate activity for handling clocks but that will require quite a lot of changes in the logic.

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},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хм, а отрицательный min_available_amount какой смысл несёт?

Copy link
Contributor

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)],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что будет после этой строчки если мы упадем, сделаем ретрай. И вызовем второй раз hold, Clock вернется другой? Это будет один и тот же hold или разные?

Copy link
Contributor

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}
Copy link
Contributor

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 а для остальных игнорируется?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, кажется вполне можно обойтись и без этого

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants