mirror of
https://github.com/valitydev/capi-v2.git
synced 2024-11-06 01:55:20 +00:00
TD-943: Fixes maxAmountCondition
default value (#51)
This commit is contained in:
parent
ea4e74b3c4
commit
4063187fdd
@ -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)
|
||||
}}}
|
||||
];
|
||||
|
@ -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) ->
|
||||
|
Loading…
Reference in New Issue
Block a user