Skip to content
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

Асинхронный рефанд не работает #603

Open
aurokk opened this issue Sep 17, 2021 · 0 comments
Open

Асинхронный рефанд не работает #603

aurokk opened this issue Sep 17, 2021 · 0 comments

Comments

@aurokk
Copy link

aurokk commented Sep 17, 2021

Привет!

Если я всё правильно понял, то hg себя ведёт некорректно, если рефанд асинхронный, возникают ошибки в хелгейте и машингане и платёж подвисает в состоянии запущен возврат.

Условно, если в адаптере вернуть что-то такое

String paymentId = createPaymentId(context);
String tag = "REFUND." + paymentId;
int timeoutSeconds = 300;
Intent intent = createIntentWithSuspendIntent(tag, timeoutSeconds);
return createPaymentProxyResult(intent);

И затем обработать колбек, то в логах будет:

[server] response sent with code 500
http://hellgate:8022/v1/stateproc/invoice
[server] handling system internal error: error:function_clause
in hg_invoice_payment:get_activity_session({refund_accounter,<<"100">>},{st,{refund_accounter,<<"100">>},{domain_InvoicePayment,<<"1">>,<<"2021-09-"...>>,{captured,...},undefined,...},high,{domain_PaymentRoute,{domain_ProviderRef,...},{...}},...}) at line 3389
	in hg_invoice_payment:process_callback/3 at line 1835
	in scoper:scope/3 at line 41
	in hg_invoice:process_payment_call/4 at line 818
	in hg_invoice:process_call/2 at line 572
	in hg_machine:do_dispatch_call/3 at line 314
	in scoper:scope/3 at line 41
	in hg_woody_wrapper:handle_function/4 at line 45

Ну и от MG:

message | machine failed {woody_error,{external,result_unexpected,<<"error:function_clause in hg_invoice_payment:get_activity_session({refund_accounter,<<\"100\">>},{s"...>>}}
-- | --
  | mg_pulse_event_id | mg_core_machine_lifecycle_failed

При этом, если адаптер отвечает синхронно, допустим такой код в обработчике, то всё работает как ожидается, платёж переходит в состояние возвращён.

return createPaymentProxyResult(
    createFinishIntentSuccess(),
    PaymentState.REFUNDED.getBytes(),
    context.getPaymentInfo().getRefund().getTrx());

image:
  repository: docker.io/rbkmoney/hellgate
  tag: efe0b67a7a048bfa17cac871ff2e7b797ea13796
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

No branches or pull requests

1 participant