Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/erlang-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ jobs:
thrift-version: ${{ needs.setup.outputs.thrift-version }}
run-ct-with-compose: true
use-coveralls: true
cache-version: v7
cache-version: v9
upload-coverage: false
82 changes: 0 additions & 82 deletions apps/hellgate/include/customer_events.hrl

This file was deleted.

12 changes: 0 additions & 12 deletions apps/hellgate/include/domain.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,6 @@
{payment_resource, #domain_PaymentResourcePayer{}}
).

-define(customer_payer(CustomerID, CustomerBindingID, RecurrentPaytoolID, PaymentTool, ContactInfo),
{customer, #domain_CustomerPayer{
customer_id = CustomerID,
customer_binding_id = CustomerBindingID,
rec_payment_tool_id = RecurrentPaytoolID,
payment_tool = PaymentTool,
contact_info = ContactInfo
}}
).

-define(customer_payer(), {customer, #domain_CustomerPayer{}}).

-define(recurrent_payer(PaymentTool, Parent, ContactInfo),
{recurrent, #domain_RecurrentPayer{
payment_tool = PaymentTool,
Expand Down
2 changes: 1 addition & 1 deletion apps/hellgate/include/hg_invoice_payment.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
refunds = #{} :: #{hg_invoice_payment:refund_id() => hg_invoice_payment:refund_state()},
chargebacks = #{} :: #{hg_invoice_payment_chargeback:id() => hg_invoice_payment_chargeback:state()},
adjustments = [] :: [hg_invoice_payment:adjustment()],
recurrent_token :: undefined | hg_recurrent_paytool:token(),
recurrent_token :: undefined | dmsl_domain_thrift:'Token'(),
opts :: undefined | hg_invoice_payment:opts(),
repair_scenario :: undefined | hg_invoice_repair:scenario(),
capture_data :: undefined | hg_invoice_payment:capture_data(),
Expand Down
127 changes: 0 additions & 127 deletions apps/hellgate/include/recurrent_payment_tools.hrl

This file was deleted.

7 changes: 1 addition & 6 deletions apps/hellgate/src/hellgate.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ stop() ->
init([]) ->
MachineHandlers = [
hg_invoice,
hg_invoice_template,
hg_customer,
hg_recurrent_paytool
hg_invoice_template
],
PartyClient = party_client:create_client(),
DefaultTimeout = genlib_app:env(hellgate, default_woody_handling_timeout, ?DEFAULT_HANDLING_TIMEOUT),
Expand Down Expand Up @@ -76,9 +74,6 @@ get_api_child_spec(MachineHandlers, Opts) ->
[
construct_service_handler(invoicing, hg_invoice_handler, Opts),
construct_service_handler(invoice_templating, hg_invoice_template, Opts),
construct_service_handler(customer_management, hg_customer, Opts),
construct_service_handler(recurrent_paytool, hg_recurrent_paytool, Opts),
construct_service_handler(recurrent_paytool_eventsink, hg_recurrent_paytool, Opts),
construct_service_handler(proxy_host_provider, hg_proxy_host_provider, Opts)
],
additional_routes => [PrometeusRoute | HealthRoutes],
Expand Down
22 changes: 13 additions & 9 deletions apps/hellgate/src/hg_accounting.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-export([create_account/1]).
-export([create_account/2]).
-export([collect_account_map/1]).
-export([collect_merchant_account_map/3]).
-export([collect_merchant_account_map/4]).
-export([collect_provider_account_map/4]).
-export([collect_system_account_map/4]).
-export([collect_external_account_map/4]).
Expand All @@ -27,6 +27,7 @@
-include_lib("damsel/include/dmsl_accounter_thrift.hrl").

-type amount() :: dmsl_domain_thrift:'Amount'().
-type currency() :: dmsl_domain_thrift:'CurrencyRef'().
-type currency_code() :: dmsl_domain_thrift:'CurrencySymbolicCode'().
-type account_id() :: dmsl_accounter_thrift:'AccountID'().
-type plan_id() :: dmsl_accounter_thrift:'PlanID'().
Expand All @@ -37,8 +38,8 @@
-type thrift_account() :: dmsl_accounter_thrift:'Account'().

-type payment() :: dmsl_domain_thrift:'InvoicePayment'().
-type party() :: dmsl_domain_thrift:'Party'().
-type shop() :: dmsl_domain_thrift:'Shop'().
-type party() :: dmsl_domain_thrift:'PartyConfig'().
-type shop() :: dmsl_domain_thrift:'ShopConfig'().
-type route() :: hg_route:payment_route().
-type payment_institution() :: dmsl_domain_thrift:'PaymentInstitution'().
-type provider() :: dmsl_domain_thrift:'Provider'().
Expand Down Expand Up @@ -99,7 +100,7 @@ create_account(CurrencyCode, Description) ->

-spec collect_account_map(collect_account_context()) -> map().
collect_account_map(#{
payment := Payment,
payment := #domain_InvoicePayment{cost = #domain_Cash{currency = Currency}} = Payment,
party := Party,
shop := Shop,
route := Route,
Expand All @@ -108,17 +109,20 @@ collect_account_map(#{
varset := VS,
revision := Revision
}) ->
Map0 = collect_merchant_account_map(Party, Shop, #{}),
Map0 = collect_merchant_account_map(Currency, Party, Shop, #{}),
Map1 = collect_provider_account_map(Payment, Provider, Route, Map0),
Map2 = collect_system_account_map(Payment, PaymentInstitution, Revision, Map1),
collect_external_account_map(Payment, VS, Revision, Map2).

-spec collect_merchant_account_map(party(), shop(), map()) -> map().
collect_merchant_account_map(#domain_Party{id = PartyID}, #domain_Shop{id = ShopID, account = MerchantAccount}, Acc) ->
-spec collect_merchant_account_map(currency(), party(), shop(), map()) -> map().
collect_merchant_account_map(
Currency, #domain_PartyConfig{id = PartyID}, #domain_ShopConfig{id = ShopID, currency_configs = Configs}, Acc
) ->
#{Currency := Config} = Configs,
Acc#{
merchant => {PartyID, ShopID},
{merchant, settlement} => MerchantAccount#domain_ShopAccount.settlement,
{merchant, guarantee} => MerchantAccount#domain_ShopAccount.guarantee
{merchant, settlement} => Config#domain_ShopCurrencyConfig.settlement,
{merchant, guarantee} => Config#domain_ShopCurrencyConfig.guarantee
}.

-spec collect_provider_account_map(payment(), provider(), route(), map()) -> map().
Expand Down
Loading
Loading