TD-943: Fixes maxAmountCondition default value (#51)

This commit is contained in:
Aleksey Kashapov 2024-07-24 10:27:16 +03:00 committed by GitHub
parent ea4e74b3c4
commit 4063187fdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View File

@ -20,7 +20,7 @@ encode_amount_randomization_params(Opts) when is_map(Opts) ->
precision = maps:get(<<"precision">>, Opts, 2),
direction = binary_to_existing_atom(maps:get(<<"direction">>, Opts, <<"both">>)),
min_amount_condition = maps:get(<<"minAmountCondition">>, Opts, undefined),
max_amount_condition = maps:get(<<"maxAmountCondition">>, Opts, 2),
max_amount_condition = maps:get(<<"maxAmountCondition">>, Opts, undefined),
amount_multiplicity_condition = maps:get(<<"amountMultiplicityCondition">>, Opts, undefined)
}}}
];

View File

@ -324,11 +324,23 @@ create_invoice_rand_amount_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, Response} = capi_client_invoices:create_invoice(?config(context, Config), ?INVOICE_PARAMS#{
<<"randomizeAmount">> => #{
<<"deviation">> => ?SMALLER_INTEGER
}
}).
}),
?assertMatch(
#{
<<"invoice">> := #{
<<"amount">> := RandomizedAmount,
<<"amountRandomized">> := #{
<<"original">> := ?INTEGER,
<<"randomized">> := RandomizedAmount
}
}
},
Response
).
-spec create_invoice_autorization_error_test(config()) -> _.
create_invoice_autorization_error_test(Config) ->