CAPI-364: update transaction info (#362)

* update damsel

* update handler

* update test

* update swag

* update swag
This commit is contained in:
Roman Pushkov 2019-07-08 16:52:56 +03:00 committed by GitHub
parent 352eb27f8e
commit b6399e3b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 20 deletions

View File

@ -204,7 +204,7 @@ decode_stat_payment(Stat, Context) ->
<<"payer" >> => decode_stat_payer(Stat#merchstat_StatPayment.payer),
<<"geoLocationInfo">> => decode_geo_location_info(Stat#merchstat_StatPayment.location_info),
<<"metadata" >> => capi_handler_decoder_utils:decode_context(Stat#merchstat_StatPayment.context),
<<"transactionInfo">> => decode_stat_tx_info(Stat#merchstat_StatPayment.transaction_info),
<<"transactionInfo">> => decode_stat_tx_info(Stat#merchstat_StatPayment.additional_transaction_info),
<<"makeRecurrent" >> => capi_handler_decoder_invoicing:decode_make_recurrent(
Stat#merchstat_StatPayment.make_recurrent
),
@ -213,18 +213,12 @@ decode_stat_payment(Stat, Context) ->
decode_stat_tx_info(undefined) ->
undefined;
decode_stat_tx_info(#domain_TransactionInfo{additional_info = undefined}) ->
undefined;
decode_stat_tx_info(TransactionInfo = #domain_TransactionInfo{additional_info = AdditionalInfo}) ->
ID = TransactionInfo#domain_TransactionInfo.id,
Timestamp = TransactionInfo#domain_TransactionInfo.timestamp,
RRN = AdditionalInfo#domain_AdditionalTransactionInfo.rrn,
AAC = AdditionalInfo#domain_AdditionalTransactionInfo.approval_code,
decode_stat_tx_info(TransactionInfo) ->
RRN = TransactionInfo#domain_AdditionalTransactionInfo.rrn,
AAC = TransactionInfo#domain_AdditionalTransactionInfo.approval_code,
ParsedTransactionInfo = #{
<<"id" >> => ID,
<<"timestamp" >> => Timestamp,
<<"rrn" >> => RRN,
<<"approval_code">> => AAC
<<"rrn" >> => RRN,
<<"approvalCode">> => AAC
},
genlib_map:compact(ParsedTransactionInfo).

View File

@ -1055,6 +1055,7 @@ search_payments_ok_test(Config) ->
% {first6, <<"424242">>},
% {last4, <<"2222">>},
% {rrn, <<"090909090909">>},
% {approval_code, <<"808080">>},
{bankCardTokenProvider, <<"applepay">>},
{bankCardPaymentSystem, <<"visa">>},
{paymentAmount, 10000},

View File

@ -631,14 +631,12 @@
payer = Payer,
context = ?CONTENT,
domain_revision = ?INTEGER,
transaction_info = ?TX_INFO
additional_transaction_info = ?TX_INFO
}).
-define(TX_INFO, #domain_TransactionInfo{
id = <<"111">>,
timestamp = <<"111111111111">>,
extra = #{<<>> => <<>>},
additional_info = #domain_AdditionalTransactionInfo{rrn = <<"090909090909">>}
-define(TX_INFO, #domain_AdditionalTransactionInfo{
rrn = <<"090909090909">>,
approval_code = <<"808080">>
}).
-define (STAT_PAYER(PaymentTool), ?STAT_PAYER(PaymentTool, ?STRING)).

View File

@ -27,7 +27,7 @@
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.6.0">>},1},
{<<"dmsl">>,
{git,"git@github.com:rbkmoney/damsel.git",
{ref,"b45975832a5c5911c58ad8f206bf9ba465eadfa3"}},
{ref,"96edc3d1ccd73b35b757821758b63d4a36df0ad1"}},
0},
{<<"dmt_client">>,
{git,"git@github.com:rbkmoney/dmt_client.git",

@ -1 +1 @@
Subproject commit a4053ab8e7907d7461946f1721e0539901de5dbd
Subproject commit b8cd1e75a908e5fdf9f70e74815ce718800c2a74