Conversation
|
|
||
| build_route_map(Route, #{service_ids := ServiceIDs, service_map := ServiceMap, routes := RouteMap}) -> | ||
| #domain_ProviderRef{id = ProviderID} = hg_route:provider_ref(Route), | ||
| PaymentRoute = hg_route:to_payment_route(Route), |
There was a problem hiding this comment.
Это не уникальный ключ. Ничего не мешает нам иметь несколько кандидатов одного и того же терминала.
There was a problem hiding this comment.
поменял подход - теперь тут сначала получаю уникальные ид для похода в ФД, потом иду, потом результаты запихиваю в оригинальный список роутов без мутации самого списка
| -spec from_payment_route(payment_route()) -> t(). | ||
| from_payment_route(Route) -> | ||
| ?route(ProviderRef, TerminalRef) = Route, | ||
| new(hg_domain:head(), ProviderRef, TerminalRef, 0, 1000, undefined). |
There was a problem hiding this comment.
Воу воу. С чего мы вдруг берем hg_domain:head/0? Под рукой есть Revision платежа, не стоит сюда внедрять заведомо неверные данные (этого роута может даже уже не существовать в head).
| maybe_log_misconfigurations(_Error) -> | ||
| ok. |
There was a problem hiding this comment.
Таким образом он уже не maybe.
| value = Token | ||
| }, | ||
| DeadLine = woody_deadline:from_timeout(genlib_app:env(hellgate, inspect_timeout, infinity)), | ||
| {ok, Check} = issue_call( |
There was a problem hiding this comment.
Я бы InvalidRequest ловил и игнорил тоже.
There was a problem hiding this comment.
там же issue_call ловит все {exception, Error} ->
| log_route_choice_meta(#{choice_meta := undefined}, _Revision) -> | ||
| ok; |
There was a problem hiding this comment.
Я так понял мы исключаем отсутствие этой меты?
There was a problem hiding this comment.
кажется что да, выглядело будто это артефакт переходного периода
| [] -> | ||
| ok = log_rejected_route_groups(FilterResult, VS), | ||
| handle_filtered_routes_exhaustion(FilterResult, Revision, St, Action); | ||
| FilteredRoutes -> |
There was a problem hiding this comment.
Тут пропускается log_rejected_route_groups/2. Раньше мы в любом случае получали это в логи.
| -spec get_route_payment_terms(hg_route:payment_route(), varset(), revision()) -> payment_terms() | undefined. | ||
| get_route_payment_terms(?route(ProviderRef, TerminalRef), VS, Revision) -> | ||
| PreparedVS = hg_varset:prepare_varset(VS), | ||
| {Client, Context} = get_party_client(), | ||
| {ok, TermsSet} = party_client_thrift:compute_provider_terminal_terms( | ||
| ProviderRef, | ||
| TerminalRef, | ||
| Revision, | ||
| PreparedVS, | ||
| Client, | ||
| Context | ||
| ), | ||
| TermsSet#domain_ProvisionTermSet.payments. | ||
|
|
||
| -spec get_route_provision_terms(hg_route:payment_route(), varset(), revision()) -> provision_terms() | undefined. | ||
| get_route_provision_terms(?route(ProviderRef, TerminalRef), VS, Revision) -> | ||
| PreparedVS = hg_varset:prepare_varset(VS), | ||
| {Client, Context} = get_party_client(), | ||
| {ok, TermsSet} = party_client_thrift:compute_provider_terminal_terms( | ||
| ProviderRef, | ||
| TerminalRef, | ||
| Revision, | ||
| PreparedVS, | ||
| Client, | ||
| Context | ||
| ), | ||
| TermsSet. |
There was a problem hiding this comment.
DRY. get_route_payment_terms может просто ходить в get_route_provision_terms
| ?payment_ev(PaymentID, ?shop_limit_initiated()), | ||
| ?payment_ev(PaymentID, ?shop_limit_applied()), | ||
| ?payment_ev(PaymentID, ?risk_score_changed(_RiskScore)), | ||
| ?payment_ev(PaymentID, ?route_changed(_Route)), |
There was a problem hiding this comment.
Как так получилось? Куда он делся?
There was a problem hiding this comment.
роутинг начал по другому работать - там теперь если у тебя после получения роутов пустой список то нет события с роутами, сразу идет фейл платежа
No description provided.