INT-1136: add identity number for digital wallet (#85)

* INT-1136: add identity number for digital wallet

* fixed

---------

Co-authored-by: Артем <WWW_cool@inbox.ru>
This commit is contained in:
Fedor Shimich 2024-06-18 18:22:46 +03:00 committed by GitHub
parent c1add97212
commit a701267af5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 23 additions and 13 deletions

View File

@ -189,7 +189,8 @@ marshal(digital_wallet, Wallet = #{id := ID, payment_service := PaymentService})
id = marshal(string, ID),
token = maybe_marshal(string, maps:get(token, Wallet, undefined)),
payment_service = marshal(payment_service, PaymentService),
account_name = maybe_marshal(string, maps:get(account_name, Wallet, undefined))
account_name = maybe_marshal(string, maps:get(account_name, Wallet, undefined)),
account_identity_number = maybe_marshal(string, maps:get(account_identity_number, Wallet, undefined))
};
marshal(generic_resource, Generic = #{provider := PaymentService}) ->
#'fistful_base_ResourceGenericData'{
@ -477,13 +478,15 @@ unmarshal(digital_wallet, #'fistful_base_DigitalWallet'{
id = ID,
payment_service = PaymentService,
token = Token,
account_name = AccountName
account_name = AccountName,
account_identity_number = AccountIdentityNumber
}) ->
genlib_map:compact(#{
id => unmarshal(string, ID),
payment_service => unmarshal(payment_service, PaymentService),
token => maybe_unmarshal(string, Token),
account_name => maybe_unmarshal(string, AccountName)
account_name => maybe_unmarshal(string, AccountName),
account_identity_number => maybe_unmarshal(string, AccountIdentityNumber)
});
unmarshal(generic_resource, #'fistful_base_ResourceGenericData'{provider = PaymentService, data = Data}) ->
genlib_map:compact(#{

View File

@ -215,7 +215,8 @@ digital_wallet_resource_test() ->
id => <<"a30e277c07400c9940628828949efd48">>,
token => <<"a30e277c07400c9940628828949efd48">>,
payment_service => #{id => <<"webmoney">>},
account_name => <<"accountName">>
account_name => <<"accountName">>,
account_identity_number => <<"accountIdentityNumber">>
}
}},
?assertEqual(Resource, unmarshal(resource, marshal(resource, Resource))).

View File

@ -124,7 +124,8 @@ create_digital_wallet_destination_ok(C) ->
id = <<"f195298af836f41d072cb390ee62bee8">>,
token = <<"a30e277c07400c9940628828949efd48">>,
payment_service = #'fistful_base_PaymentServiceRef'{id = <<"webmoney">>},
account_name = <<"account_name_create_digital_wallet_destination_ok">>
account_name = <<"account_name_create_digital_wallet_destination_ok">>,
account_identity_number = <<"account_identity_number_create_digital_wallet_destination_ok">>
}
}},
create_destination_ok(Resource, C).

View File

@ -239,7 +239,8 @@ marshal(
id = DigitalWalletID,
token = Token,
payment_service = marshal(payment_service, PaymentService),
account_name = maps:get(account_name, Wallet, undefined)
account_name = maps:get(account_name, Wallet, undefined),
account_identity_number = maps:get(account_identity_number, Wallet, undefined)
}};
marshal(resource, Resource = {generic, _}) ->
ff_dmsl_codec:marshal(payment_tool, Resource);

View File

@ -1221,7 +1221,8 @@ construct_payment_tool(
id = ID,
payment_service = ff_dmsl_codec:marshal(payment_service, PaymentService),
token = Token,
account_name = maps:get(account_name, Wallet, undefined)
account_name = maps:get(account_name, Wallet, undefined),
account_identity_number = maps:get(account_identity_number, Wallet, undefined)
}}.
%% Quote helpers

View File

@ -536,7 +536,7 @@ construct_inaccessibilty({suspension, _}) ->
construct_party_params(#{email := Email}) ->
#payproc_PartyParams{
contact_info = #domain_PartyContactInfo{
email = Email
registration_email = Email
}
}.

View File

@ -62,7 +62,8 @@
id := binary(),
payment_service := payment_service(),
token => binary(),
account_name => binary()
account_name => binary(),
account_identity_number => binary()
}.
-type resource_generic_params() :: #{
@ -135,7 +136,8 @@
id := binary(),
payment_service := payment_service(),
token => binary(),
account_name => binary()
account_name => binary(),
account_identity_number => binary()
}.
-type generic_resource() :: #{
@ -356,7 +358,8 @@ create_digital_wallet(#{
id => ID,
payment_service => PaymentService,
token => Token,
account_name => maps:get(account_name, Wallet, undefined)
account_name => maps:get(account_name, Wallet, undefined),
account_identity_number => maps:get(account_identity_number, Wallet, undefined)
})
}}}.

View File

@ -25,7 +25,7 @@
{<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2},
{<<"damsel">>,
{git,"https://github.com/valitydev/damsel.git",
{ref,"5da32a1e31265300b160734d2d181fabf1759980"}},
{ref,"3a25a01f89423e1fc7dbabc8a3f777647b659f45"}},
0},
{<<"dmt_client">>,
{git,"https://github.com/valitydev/dmt_client.git",
@ -41,7 +41,7 @@
0},
{<<"fistful_proto">>,
{git,"https://github.com/valitydev/fistful-proto.git",
{ref,"3aa8dfd15e9d1336d5d89246bc2fca9443dcebb9"}},
{ref,"1c2861893e55d7323e25cd3c5b6d90b2cb5abb9a"}},
0},
{<<"genlib">>,
{git,"https://github.com/valitydev/genlib.git",