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
10 changes: 9 additions & 1 deletion apps/capi/src/capi_handler_decoder_invoicing.erl
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ decode_invoice(Invoice) ->
<<"bankAccount">> => decode_invoice_bank_account(Details#domain_InvoiceDetails.bank_account),
<<"invoiceTemplateID">> => Invoice#domain_Invoice.template_id,
<<"allocation">> => capi_allocation:decode(Invoice#domain_Invoice.allocation),
<<"amountRandomized">> => capi_mutation:decode_invoice_amount_mutation(Invoice#domain_Invoice.mutations)
<<"amountRandomized">> => capi_mutation:decode_invoice_amount_mutation(Invoice#domain_Invoice.mutations),
<<"clientInfo">> => decode_invoice_client_info(Invoice#domain_Invoice.client_info)
},
decode_invoice_status(Invoice#domain_Invoice.status)
).
Expand Down Expand Up @@ -547,6 +548,13 @@ decode_invoice_line_tax_mode(#{<<"TaxMode">> := {str, TM}}) ->
decode_invoice_line_tax_mode(_) ->
undefined.

decode_invoice_client_info(#domain_InvoiceClientInfo{trust_level = well_known}) ->
#{<<"trustLevel">> => <<"wellKnown">>};
decode_invoice_client_info(#domain_InvoiceClientInfo{trust_level = unknown}) ->
#{<<"trustLevel">> => <<"unknown">>};
decode_invoice_client_info(_) ->
undefined.

-spec decode_payment_methods(undefined | list()) -> list(decode_data()).
decode_payment_methods(undefined) ->
[];
Expand Down
3 changes: 2 additions & 1 deletion apps/capi/test/capi_base_api_token_tests_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ create_invoice_ok_test(Config) ->
Config
),
_ = capi_ct_helper_bouncer:mock_assert_shop_op_ctx(<<"CreateInvoice">>, ?STRING, ?STRING, Config),
{ok, _} = capi_client_invoices:create_invoice(?config(context, Config), ?INVOICE_PARAMS).
{ok, #{<<"invoice">> := Invoice}} = capi_client_invoices:create_invoice(?config(context, Config), ?INVOICE_PARAMS),
?assertMatch(#{<<"clientInfo">> := #{<<"trustLevel">> := <<"wellKnown">>}}, Invoice).

-spec create_invoice_rand_amount_ok_test(config()) -> _.
create_invoice_rand_amount_ok_test(Config) ->
Expand Down
6 changes: 4 additions & 2 deletions apps/capi/test/capi_dummy_data.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
shop_ref = #domain_ShopConfigRef{id = ?STRING},
party_ref = #domain_PartyConfigRef{id = OwnerID},
template_id = ?STRING,
external_id = EID
external_id = EID,
client_info = #domain_InvoiceClientInfo{trust_level = well_known}
}).

-define(SWAG_INVOICE_CART, [
Expand Down Expand Up @@ -1421,7 +1422,8 @@
<<"accountType">> => <<"InvoiceRussianBankAccount">>,
<<"account">> => <<"12345678901234567890">>,
<<"bankBik">> => <<"123456789">>
}
},
<<"clientInfo">> => #{<<"trustLevel">> => <<"wellKnown">>}
}).

-define(PAYMENT_PARAMS(EID, Token), #{
Expand Down
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
{deps, [
{prometheus, "4.11.0"},
{prometheus_cowboy, "0.1.9"},
{cowboy, "2.9.0"},
{cowboy, "2.12.0"},
%% NOTE
%% Pinning to version "1.11.2" from hex here causes constant upgrading and recompilation of the entire project
{jose, {git, "https://github.com/potatosalad/erlang-jose.git", {tag, "1.11.2"}}},
{genlib, {git, "https://github.com/valitydev/genlib.git", {tag, "v1.1.0"}}},
{cowboy_draining_server, {git, "https://github.com/valitydev/cowboy_draining_server.git", {branch, "master"}}},
{woody, {git, "https://github.com/valitydev/woody_erlang.git", {tag, "v1.1.0"}}},
{woody_user_identity, {git, "https://github.com/valitydev/woody_erlang_user_identity.git", {tag, "v1.1.0"}}},
{damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.32"}}},
{damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.33"}}},
{bender_proto, {git, "https://github.com/valitydev/bender-proto.git", {branch, "master"}}},
{bender_client, {git, "https://github.com/valitydev/bender-client-erlang.git", {tag, "v1.1.0"}}},
{dmt_client, {git, "https://github.com/valitydev/dmt_client.git", {tag, "v2.0.3"}}},
Expand Down
14 changes: 7 additions & 7 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{ref,"5a87a37694e42b6592d3b4164ae54e0e87e24e18"}},
1},
{<<"chatterbox">>,{pkg,<<"ts_chatterbox">>,<<"0.15.1">>},2},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.9.0">>},0},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.12.0">>},0},
{<<"cowboy_access_log">>,
{git,"https://github.com/valitydev/cowboy_access_log.git",
{ref,"04da359e022cf05c5c93812504d5791d6bc97453"}},
Expand All @@ -37,11 +37,11 @@
{git,"https://github.com/valitydev/cowboy_draining_server.git",
{ref,"186cf4d0722d4ad79afe73d371df6b1371e51905"}},
0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},1},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.13.0">>},1},
{<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2},
{<<"damsel">>,
{git,"https://github.com/valitydev/damsel.git",
{ref,"31495ce9d95c5d1b627b349c01d9937a5ef0231c"}},
{ref,"e7a302a684deba1bb18a00d1056879329219d280"}},
0},
{<<"dmt_client">>,
{git,"https://github.com/valitydev/dmt_client.git",
Expand Down Expand Up @@ -163,8 +163,8 @@
{<<"cache">>, <<"B23A5FE7095445A88412A6E614C933377E0137B44FFED77C9B3FEF1A731A20B2">>},
{<<"certifi">>, <<"DBAB8E5E155A0763EEA978C913CA280A6B544BFA115633FA20249C3D396D9493">>},
{<<"chatterbox">>, <<"5CAC4D15DD7AD61FC3C4415CE4826FC563D4643DEE897A558EC4EA0B1C835C9C">>},
{<<"cowboy">>, <<"865DD8B6607E14CF03282E10E934023A1BD8BE6F6BACF921A7E2A96D800CD452">>},
{<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>},
{<<"cowboy">>, <<"F276D521A1FF88B2B9B4C54D0E753DA6C66DD7BE6C9FCA3D9418B561828A3731">>},
{<<"cowlib">>, <<"DB8F7505D8332D98EF50A3EF34B34C1AFDDEC7506E4EE4DD4A3A266285D282CA">>},
{<<"ctx">>, <<"8FF88B70E6400C4DF90142E7F130625B82086077A45364A78D208ED3ED53C7FE">>},
{<<"email_validator">>, <<"7E09A862E9AA99AE2CA6FD2A718D2B94360E32940A1339B53DFEE6B774BCDB03">>},
{<<"gproc">>, <<"853CCB7805E9ADA25D227A157BA966F7B34508F386A3E7E21992B1B484230699">>},
Expand Down Expand Up @@ -193,8 +193,8 @@
{<<"cache">>, <<"44516CE6FA03594D3A2AF025DD3A87BFE711000EB730219E1DDEFC816E0AA2F4">>},
{<<"certifi">>, <<"524C97B4991B3849DD5C17A631223896272C6B0AF446778BA4675A1DFF53BB7E">>},
{<<"chatterbox">>, <<"4F75B91451338BC0DA5F52F3480FA6EF6E3A2AEECFC33686D6B3D0A0948F31AA">>},
{<<"cowboy">>, <<"2C729F934B4E1AA149AFF882F57C6372C15399A20D54F65C8D67BEF583021BDE">>},
{<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>},
{<<"cowboy">>, <<"8A7ABE6D183372CEB21CAA2709BEC928AB2B72E18A3911AA1771639BEF82651E">>},
{<<"cowlib">>, <<"E1E1284DC3FC030A64B1AD0D8382AE7E99DA46C3246B815318A4B848873800A4">>},
{<<"ctx">>, <<"A14ED2D1B67723DBEBBE423B28D7615EB0BDCBA6FF28F2D1F1B0A7E1D4AA5FC2">>},
{<<"email_validator">>, <<"2B1E6DF7BB14155C8D7D131F1C95CF4676200BC056EEBA82123396833FF94DA2">>},
{<<"gproc">>, <<"587E8AF698CCD3504CF4BA8D90F893EDE2B0F58CABB8A916E2BF9321DE3CF10B">>},
Expand Down
Loading