mirror of
https://github.com/valitydev/capi-v2.git
synced 2024-11-06 01:55:20 +00:00
fix GooglePay routing (#224)
This commit is contained in:
parent
fa26b11226
commit
e7a3cdc10e
@ -3683,7 +3683,7 @@ process_digital_wallet_data(Data) ->
|
||||
{{digital_wallet, DigitalWallet}, <<>>}.
|
||||
|
||||
process_tokenized_card_data(Data, Context) ->
|
||||
Call = {payment_tool_provider, 'Unwrap', [encode_wrapped_payment_tool(Data)]},
|
||||
Call = {get_token_provider_service_name(Data), 'Unwrap', [encode_wrapped_payment_tool(Data)]},
|
||||
{ok, UnwrappedPaymentTool} = service_call(Call, Context),
|
||||
process_put_card_data_result(
|
||||
put_card_data_to_cds(
|
||||
@ -3694,6 +3694,16 @@ process_tokenized_card_data(Data, Context) ->
|
||||
UnwrappedPaymentTool
|
||||
).
|
||||
|
||||
get_token_provider_service_name(Data) ->
|
||||
case Data of
|
||||
#{<<"provider">> := <<"ApplePay">>} ->
|
||||
payment_tool_provider_apple_pay;
|
||||
#{<<"provider">> := <<"GooglePay">>} ->
|
||||
payment_tool_provider_google_pay;
|
||||
#{<<"provider">> := <<"SamsungPay">>} ->
|
||||
payment_tool_provider_samsung_pay
|
||||
end.
|
||||
|
||||
process_put_card_data_result(
|
||||
{{bank_card, BankCard}, SessionID},
|
||||
#paytoolprv_UnwrappedPaymentTool{
|
||||
|
@ -984,7 +984,7 @@ create_qw_payment_resource_ok_test(Config) ->
|
||||
_.
|
||||
create_applepay_payment_resource_ok_test(Config) ->
|
||||
mock_services([
|
||||
{payment_tool_provider, fun('Unwrap', _) -> {ok, ?UNWRAPPED_PAYMENT_TOOL(?APPLE_PAY_DETAILS)} end},
|
||||
{payment_tool_provider_apple_pay, fun('Unwrap', _) -> {ok, ?UNWRAPPED_PAYMENT_TOOL(?APPLE_PAY_DETAILS)} end},
|
||||
{cds_storage, fun('PutCardData', _) -> {ok, ?PUT_CARD_DATA_RESULT} end}
|
||||
], Config),
|
||||
ClientInfo = #{<<"fingerprint">> => <<"test fingerprint">>},
|
||||
@ -1003,7 +1003,7 @@ create_applepay_payment_resource_ok_test(Config) ->
|
||||
_.
|
||||
create_googlepay_payment_resource_ok_test(Config) ->
|
||||
mock_services([
|
||||
{payment_tool_provider, fun('Unwrap', _) -> {ok, ?UNWRAPPED_PAYMENT_TOOL(?GOOGLE_PAY_DETAILS)} end},
|
||||
{payment_tool_provider_google_pay, fun('Unwrap', _) -> {ok, ?UNWRAPPED_PAYMENT_TOOL(?GOOGLE_PAY_DETAILS)} end},
|
||||
{cds_storage, fun('PutCardData', _) -> {ok, ?PUT_CARD_DATA_RESULT} end}
|
||||
], Config),
|
||||
ClientInfo = #{<<"fingerprint">> => <<"test fingerprint">>},
|
||||
|
@ -51,5 +51,9 @@ get_service_modname(customer_management) ->
|
||||
{dmsl_payment_processing_thrift, 'CustomerManagement'};
|
||||
get_service_modname(party_management) ->
|
||||
{dmsl_payment_processing_thrift, 'PartyManagement'};
|
||||
get_service_modname(payment_tool_provider) ->
|
||||
get_service_modname(payment_tool_provider_apple_pay) ->
|
||||
{dmsl_payment_tool_provider_thrift, 'PaymentToolProvider'};
|
||||
get_service_modname(payment_tool_provider_google_pay) ->
|
||||
{dmsl_payment_tool_provider_thrift, 'PaymentToolProvider'};
|
||||
get_service_modname(payment_tool_provider_samsung_pay) ->
|
||||
{dmsl_payment_tool_provider_thrift, 'PaymentToolProvider'}.
|
||||
|
@ -62,7 +62,8 @@
|
||||
merchant_stat => "http://magista:8022/stat",
|
||||
reporting => "http://reporter:8022/reports",
|
||||
geo_ip_service => "http://columbus:8022/repo",
|
||||
payment_tool_provider => "http://adapter-appepay:8022/provider/apple"
|
||||
payment_tool_provider_apple_pay => "http://adapter-appepay:8022/provider/apple",
|
||||
payment_tool_provider_google_pay => "http://adapter-goolepay:8022/provider/google"
|
||||
}}
|
||||
]},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user