Fix - withdrawal methods set (#47)

This commit is contained in:
Артем 2022-10-13 11:34:03 +04:00 committed by GitHub
parent 361122ff97
commit 985b51f5f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

View File

@ -96,6 +96,13 @@
}}
).
-define(PAYMENT_METHOD_BANK_CARD_WITH_EMPTY_CVV(ID),
{bank_card, #'domain_BankCardPaymentMethod'{
payment_system = #domain_PaymentSystemRef{id = ID},
is_cvv_empty = true
}}
).
-define(PAYMENT_METHOD_DIGITAL_WALLET(ID),
{digital_wallet, #domain_PaymentServiceRef{id = ID}}
).

View File

@ -930,12 +930,16 @@ domain_config(Options) ->
ct_domain:category(?cat(1), <<"Generic Store">>, live),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_BANK_CARD(<<"VISA">>))),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_BANK_CARD(<<"MASTERCARD">>))),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_BANK_CARD_WITH_EMPTY_CVV(<<"MASTERCARD">>))),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_BANK_CARD(<<"NSPK MIR">>))),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_GENERIC(<<"IND">>))),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_DIGITAL_WALLET(<<"webmoney">>))),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_CRYPTO_CURRENCY(<<"Litecoin">>))),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_CRYPTO_CURRENCY(<<"bitcoin_cash">>))),
ct_domain:payment_method(?pmt(?PAYMENT_METHOD_CRYPTO_CURRENCY(<<"ripple">>))),
ct_domain:payment_system(?pmtsys(<<"MASTERCARD">>), <<"MASTERCARD">>),
ct_domain:payment_system(?pmtsys(<<"VISA">>), <<"VISA">>),
ct_domain:payment_system(?pmtsys(<<"NSPK MIR">>), <<"NSPK MIR">>),
@ -1009,7 +1013,10 @@ default_termset(Options) ->
methods =
{value,
?ordset([
?pmt(?PAYMENT_METHOD_BANK_CARD(<<"MASTERCARD">>)),
?pmt(?PAYMENT_METHOD_BANK_CARD_WITH_EMPTY_CVV(<<"MASTERCARD">>)),
?pmt(?PAYMENT_METHOD_BANK_CARD(<<"VISA">>)),
?pmt(?PAYMENT_METHOD_BANK_CARD(<<"NSPK MIR">>)),
?pmt(?PAYMENT_METHOD_GENERIC(<<"IND">>)),
?pmt(?PAYMENT_METHOD_DIGITAL_WALLET(<<"webmoney">>)),
?pmt(?PAYMENT_METHOD_CRYPTO_CURRENCY(<<"Litecoin">>)),

View File

@ -64,7 +64,7 @@ handle_function_('GetWithdrawalMethods', {ID}, _Opts) ->
end,
DmslMethods
),
{ok, Methods};
{ok, ordsets:from_list(Methods)};
{error, notfound} ->
woody_error:raise(business, #fistful_IdentityNotFound{})
end;

View File

@ -110,6 +110,8 @@ get_withdrawal_methods_ok(_C) ->
Metadata = ff_entity_context_codec:marshal(#{<<"metadata">> => #{<<"some key">> => <<"some data">>}}),
#identity_IdentityState{id = ID} = create_identity(EID, Name, PID, ProvID, Ctx, Metadata),
{ok, [
{bank_card, _},
{bank_card, _},
{bank_card, _},
{crypto_currency, _},
{crypto_currency, _},