-
Notifications
You must be signed in to change notification settings - Fork 7
HG-299: Introduce interaction with cash register service #160
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: epic/sync_cashreg
Are you sure you want to change the base?
Conversation
|
Чтобы компиляция прошла нужно использовать эту версию damsel |
| {mg_proto_state_processing_thrift, 'EventSink'}; | ||
| get_service(cashreg) -> | ||
| {cashreg_proto_processing_thrift, 'CashRegister'}; | ||
| get_service(cashreg_provider) -> |
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.
А eventsink как же?
| Changes = [ | ||
| ?cashreg_receipt_session_finished(?cashreg_receipt_session_failed({ | ||
| receipt_registration_failed, #cashreg_main_ReceiptRegistrationFailed{ | ||
| reason = #cashreg_main_ExternalFailure{code = <<"0">>} |
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.
TODO бы оставить на этот хардкод.
| ?invoice_payment_flow_instant() -> | ||
| ?captured(); | ||
| Status = get_receipt_status(St), | ||
| process_receipt_registration(Status, St); |
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.
Непонятно, почему только в этом клозе.
| end; | ||
| merge_change(?receipt_ev(ID, Event, EventID), St) -> | ||
| St1 = St#st{activity = {receipt, ID}}, | ||
| Receipt = make_receipt_state(Event, EventID), |
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.
Я бы предложил по образу остальных мест сделать, типа merge_receipt_event/2, и трекать корректно activity.
| St1 = set_session(Target, Session, St), | ||
| % FIXME leaky transactions | ||
| St2 = set_trx(get_session_trx(Session), St1), | ||
| St2 = set_trx(get_session_trx(Session), St1#st{activity = payment}), |
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.
...И по идее вот здесь не придётся мудрить.
| [?receipt_ev(ReceiptID, ?receipt_registered(), EventID)]; | ||
| construct_payment_change(EventID, ReceiptID, ?cashreg_receipt_failed( | ||
| {receipt_registration_failed, #cashreg_main_ReceiptRegistrationFailed{ | ||
| reason = #cashreg_main_ExternalFailure{code = Code, description = Description} |
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.
По идее нужна обёртка.
| options = CashRegOptions | ||
| } | ||
| }) -> | ||
| Revision = hg_domain:head(), |
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.
Опасно. Можно сверху передать?
No description provided.