CAPI-313: Fix paymentSession swagger crash (#282)

This commit is contained in:
Alexey 2018-10-18 15:53:52 +03:00 committed by GitHub
parent 922691ad3c
commit 1f6d7d3ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 8 deletions

View File

@ -2500,20 +2500,20 @@ decode_stat_payer({payment_resource, PaymentResource}) ->
phone_number = PhoneNumber,
email = Email
} = PaymentResource,
#{
genlib_map:compact(#{
<<"payerType" >> => <<"PaymentResourcePayer">>,
<<"paymentToolToken" >> => decode_stat_payment_tool_token(PaymentTool),
<<"paymentSession" >> => PaymentSession,
<<"paymentToolDetails">> => decode_stat_payment_tool_details(PaymentTool),
<<"clientInfo" >> => #{
<<"clientInfo" >> => genlib_map:compact(#{
<<"ip" >> => IP,
<<"fingerprint">> => Fingerprint
},
}),
<<"contactInfo" >> => genlib_map:compact(#{
<<"phoneNumber">> => PhoneNumber,
<<"email" >> => Email
})
}.
}).
decode_stat_payment_tool_token(PaymentTool) ->
decode_payment_tool_token(merchstat_to_domain(PaymentTool)).

View File

@ -485,7 +485,8 @@
-define(STAT_RESPONSE_PAYMENTS, ?STAT_RESPONSE({payments,
[
?STAT_PAYMENT(?STAT_PAYER({bank_card, ?STAT_BANK_CARD}), ?STAT_PAYMENT_STATUS_CAPTURED),
?STAT_PAYMENT(?STAT_PAYER({bank_card, ?STAT_BANK_CARD_WITH_TP}), ?STAT_PAYMENT_STATUS_PENDING)
?STAT_PAYMENT(?STAT_PAYER({bank_card, ?STAT_BANK_CARD_WITH_TP}), ?STAT_PAYMENT_STATUS_PENDING),
?STAT_PAYMENT(?STAT_PAYER({bank_card, ?STAT_BANK_CARD}, undefined), ?STAT_PAYMENT_STATUS_CAPTURED)
]
})).
@ -531,13 +532,15 @@
context = ?CONTENT
}).
-define (STAT_PAYER(PaymentTool), {payment_resource, #merchstat_PaymentResourcePayer{
-define (STAT_PAYER(PaymentTool), ?STAT_PAYER(PaymentTool, ?STRING)).
-define (STAT_PAYER(PaymentTool, SessionId), {payment_resource, #merchstat_PaymentResourcePayer{
payment_tool = PaymentTool,
ip_address = ?STRING,
fingerprint = ?STRING,
phone_number = ?STRING,
email = <<"test@test.ru">>,
session_id = ?STRING
session_id = SessionId
}}).
-define(STAT_PAYMENT_STATUS_PENDING, {pending, #merchstat_InvoicePaymentPending{}}).

@ -1 +1 @@
Subproject commit d2f447829ba806cc4f6fbb07e35733a8de90a3bb
Subproject commit b57ef8a8851a9336b86259caa779dab6454f5d1c