mirror of
https://github.com/valitydev/capi-v2.git
synced 2024-11-06 01:55:20 +00:00
MSPF-562: update damsel, add BankCard category, condition (#480)
This commit is contained in:
parent
b802023836
commit
8b29d2cfe1
@ -319,9 +319,8 @@ decode_refund_status({Status, StatusInfo}, Context) ->
|
||||
|
||||
-spec decode_chargeback(capi_handler_encoder:encode_data(), processing_context()) ->
|
||||
capi_handler_decoder_utils:decode_data().
|
||||
decode_chargeback(#payproc_InvoicePaymentChargeback{chargeback = Chargeback}, Context) ->
|
||||
decode_chargeback(Chargeback, Context);
|
||||
decode_chargeback(#domain_InvoicePaymentChargeback{} = Chargeback, _Context) ->
|
||||
|
||||
decode_chargeback(Chargeback, _Context) ->
|
||||
#domain_Cash{amount = Body, currency = Currency} = Chargeback#domain_InvoicePaymentChargeback.body,
|
||||
#domain_Cash{amount = Levy, currency = Currency} = Chargeback#domain_InvoicePaymentChargeback.levy,
|
||||
capi_handler_utils:merge_and_compact(
|
||||
|
@ -356,9 +356,12 @@ process_request('GetRefundByID', Req, Context) ->
|
||||
end;
|
||||
|
||||
process_request('GetChargebacks', Req, Context) ->
|
||||
DecodeChargebackFun = fun(C) ->
|
||||
capi_handler_decoder_invoicing:decode_chargeback(C#payproc_InvoicePaymentChargeback.chargeback, Context)
|
||||
end,
|
||||
case capi_handler_utils:get_payment_by_id(maps:get(invoiceID, Req), maps:get(paymentID, Req), Context) of
|
||||
{ok, #payproc_InvoicePayment{chargebacks = Chargebacks}} ->
|
||||
{ok, {200, #{}, [capi_handler_decoder_invoicing:decode_chargeback(C, Context) || C <- Chargebacks]}};
|
||||
{ok, {200, #{}, [DecodeChargebackFun(C) || C <- Chargebacks]}};
|
||||
{exception, Exception} ->
|
||||
case Exception of
|
||||
#payproc_InvalidUser{} ->
|
||||
|
@ -713,7 +713,9 @@ get_refund_by_external_id(Config) ->
|
||||
-spec get_chargeback_by_id(config()) ->
|
||||
_.
|
||||
get_chargeback_by_id(Config) ->
|
||||
capi_ct_helper:mock_services([{invoicing, fun('GetPaymentChargeback', _) -> {ok, ?CHARGEBACK} end}], Config),
|
||||
capi_ct_helper:mock_services([{invoicing, fun('GetPaymentChargeback', _) ->
|
||||
{ok, ?CHARGEBACK}
|
||||
end}], Config),
|
||||
{ok, _} = capi_client_payments:get_chargeback_by_id(?config(context, Config), ?STRING, ?STRING, ?STRING).
|
||||
|
||||
-spec get_chargebacks(config()) ->
|
||||
|
@ -269,9 +269,7 @@
|
||||
external_id = EID
|
||||
}).
|
||||
|
||||
|
||||
-define(CHARGEBACK, ?CHARGEBACK(?STRING)).
|
||||
|
||||
-define(CHARGEBACK(ID), #domain_InvoicePaymentChargeback{
|
||||
id = ID,
|
||||
status = {pending, #domain_InvoicePaymentChargebackPending{}},
|
||||
|
@ -23,7 +23,7 @@
|
||||
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.8.0">>},1},
|
||||
{<<"damsel">>,
|
||||
{git,"git@github.com:rbkmoney/damsel.git",
|
||||
{ref,"bb9560362cfcce69ae91ae56fa6f0453b3530047"}},
|
||||
{ref,"a6c9401d85b856df783ed715f70304e7e104f052"}},
|
||||
0},
|
||||
{<<"dmt_client">>,
|
||||
{git,"git@github.com:rbkmoney/dmt_client.git",
|
||||
|
Loading…
Reference in New Issue
Block a user