mirror of
https://github.com/valitydev/capi-v2.git
synced 2024-11-06 01:55:20 +00:00
HG-497: PCIDSS cleanup (#416)
This commit is contained in:
parent
244d6b3429
commit
6085f0a2a7
@ -15,7 +15,6 @@
|
||||
capi_woody_client,
|
||||
damsel,
|
||||
bender_proto,
|
||||
binbase_proto,
|
||||
dmt_client,
|
||||
swag_server,
|
||||
jose,
|
||||
|
@ -1,9 +1,5 @@
|
||||
-module(capi_handler).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_merch_stat_thrift.hrl").
|
||||
|
||||
-behaviour(swag_server_logic_handler).
|
||||
|
||||
%% API callbacks
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_contracts).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
|
||||
-behaviour(capi_handler).
|
||||
-export([process_request/3]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_decoder_invoicing).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_merch_stat_thrift.hrl").
|
||||
|
||||
-export([decode_user_interaction_form/1]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_decoder_party).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_merch_stat_thrift.hrl").
|
||||
|
||||
-export([decode_shop_location/1]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_decoder_utils).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_merch_stat_thrift.hrl").
|
||||
|
||||
-export([decode_map/2]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_encoder).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_merch_stat_thrift.hrl").
|
||||
|
||||
-export([encode_contact_info/1]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_invoice_templates).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
|
||||
-behaviour(capi_handler).
|
||||
-export([process_request/3]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_invoices).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
|
||||
-behaviour(capi_handler).
|
||||
-export([process_request/3]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_payment_institutions).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
|
||||
-behaviour(capi_handler).
|
||||
-export([process_request/3]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_payments).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
|
||||
-behaviour(capi_handler).
|
||||
-export([process_request/3]).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_payouts).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_payout_processing_thrift.hrl").
|
||||
|
||||
-behaviour(capi_handler).
|
||||
|
@ -1,6 +1,5 @@
|
||||
-module(capi_handler_reports).
|
||||
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_reporting_thrift.hrl").
|
||||
|
||||
-behaviour(capi_handler).
|
||||
|
@ -1,7 +1,6 @@
|
||||
-module(capi_handler_utils).
|
||||
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
|
||||
|
||||
-export([general_error/2]).
|
||||
-export([logic_error/2]).
|
||||
|
@ -11,9 +11,7 @@
|
||||
-include_lib("damsel/include/dmsl_webhooker_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_merch_stat_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_reporting_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_payment_tool_provider_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_payout_processing_thrift.hrl").
|
||||
-include_lib("binbase_proto/include/binbase_binbase_thrift.hrl").
|
||||
-include_lib("capi_dummy_data.hrl").
|
||||
-include_lib("jose/include/jose_jwk.hrl").
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
-include_lib("damsel/include/dmsl_domain_config_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("binbase_proto/include/binbase_binbase_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_cds_thrift.hrl").
|
||||
-include_lib("capi_dummy_data.hrl").
|
||||
-include_lib("jose/include/jose_jwk.hrl").
|
||||
@ -149,23 +148,12 @@ get_customer_ok_test(Config) ->
|
||||
create_binding_ok_test(Config) ->
|
||||
capi_ct_helper:mock_services(
|
||||
[
|
||||
{cds_storage, fun
|
||||
('PutSession', _) -> {ok, ok};
|
||||
('PutCard', _) -> {ok, ?PUT_CARD_RESULT}
|
||||
end},
|
||||
{customer_management, fun('StartBinding', _) -> {ok, ?CUSTOMER_BINDING} end},
|
||||
{bender, fun('GenerateID', _) -> {ok, capi_ct_helper_bender:get_result(<<"bender key">>)} end},
|
||||
{binbase, fun('Lookup', _) -> {ok, ?BINBASE_LOOKUP_RESULT} end}
|
||||
{bender, fun('GenerateID', _) -> {ok, capi_ct_helper_bender:get_result(<<"bender key">>)} end}
|
||||
],
|
||||
Config
|
||||
),
|
||||
PaymentToolToken = capi_utils:map_to_base64url(#{
|
||||
<<"type" >> => <<"bank_card">>,
|
||||
<<"token" >> => ?STRING,
|
||||
<<"payment_system">> => atom_to_binary(visa, utf8),
|
||||
<<"bin" >> => <<"411111">>,
|
||||
<<"masked_pan" >> => <<"1111">>
|
||||
}),
|
||||
PaymentToolToken = ?TEST_PAYMENT_TOKEN,
|
||||
Req2 = #{
|
||||
<<"paymentResource">> => #{
|
||||
<<"paymentSession">> => ?TEST_PAYMENT_SESSION,
|
||||
|
@ -970,59 +970,6 @@
|
||||
bank_card = ?BANK_CARD
|
||||
}).
|
||||
|
||||
-define(UNWRAPPED_PAYMENT_TOOL(Details),
|
||||
?UNWRAPPED_PAYMENT_TOOL(
|
||||
Details,
|
||||
{tokenized_card, #paytoolprv_TokenizedCard{
|
||||
dpan = ?STRING,
|
||||
exp_date = #paytoolprv_ExpDate{
|
||||
month = 10,
|
||||
year = 2018
|
||||
},
|
||||
auth_data = {auth_3ds, #paytoolprv_Auth3DS{
|
||||
cryptogram = ?STRING,
|
||||
eci = ?STRING
|
||||
}}
|
||||
}}
|
||||
)
|
||||
).
|
||||
|
||||
-define(UNWRAPPED_PAYMENT_TOOL(Details, PaymentData), #paytoolprv_UnwrappedPaymentTool{
|
||||
payment_data = PaymentData,
|
||||
card_info = #paytoolprv_CardInfo{
|
||||
display_name = <<"Visa 1234">>,
|
||||
cardholder_name = ?STRING,
|
||||
last_4_digits = <<"1234">>,
|
||||
card_class = debit,
|
||||
payment_system = mastercard
|
||||
},
|
||||
details = Details
|
||||
}).
|
||||
|
||||
-define(APPLE_PAY_DETAILS, {apple, #paytoolprv_ApplePayDetails{
|
||||
transaction_id = ?STRING,
|
||||
amount = ?INTEGER,
|
||||
currency_numeric_code = 643,
|
||||
device_id = ?STRING
|
||||
}}).
|
||||
|
||||
-define(GOOGLE_PAY_DETAILS, {google, #paytoolprv_GooglePayDetails{
|
||||
message_id = ?STRING,
|
||||
message_expiration = ?TIMESTAMP
|
||||
}}).
|
||||
|
||||
-define(BINBASE_LOOKUP_RESULT, ?BINBASE_LOOKUP_RESULT(<<"MASTERCARD">>)).
|
||||
|
||||
-define(BINBASE_LOOKUP_RESULT(PaymentSystem), #'binbase_ResponseData'{
|
||||
bin_data = #'binbase_BinData' {
|
||||
payment_system = PaymentSystem,
|
||||
bank_name = ?STRING,
|
||||
iso_country_code = <<"KAZ">>,
|
||||
card_type = debit
|
||||
},
|
||||
version = ?INTEGER
|
||||
}).
|
||||
|
||||
-define(PAYOUT(Type, PayoutSummary), #'payout_processing_Payout'{
|
||||
id = ?STRING,
|
||||
party_id = ?STRING,
|
||||
@ -1061,6 +1008,16 @@
|
||||
count = ?INTEGER
|
||||
}).
|
||||
|
||||
-define(TEST_PAYMENT_TOKEN, ?TEST_PAYMENT_TOKEN(visa)).
|
||||
|
||||
-define(TEST_PAYMENT_TOKEN(PaymentSystem), capi_utils:map_to_base64url(#{
|
||||
<<"type" >> => <<"bank_card">>,
|
||||
<<"token" >> => ?STRING,
|
||||
<<"payment_system">> => atom_to_binary(PaymentSystem, utf8),
|
||||
<<"bin" >> => <<"411111">>,
|
||||
<<"masked_pan" >> => <<"1111">>
|
||||
})).
|
||||
|
||||
-define(TEST_PAYMENT_SESSION, capi_utils:map_to_base64url(#{
|
||||
<<"paymentSession">> => ?STRING,
|
||||
<<"clientInfo" >> => #{
|
||||
|
@ -5,8 +5,6 @@
|
||||
-include_lib("damsel/include/dmsl_domain_config_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_payment_processing_errors_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_payment_tool_provider_thrift.hrl").
|
||||
-include_lib("binbase_proto/include/binbase_binbase_thrift.hrl").
|
||||
-include_lib("damsel/include/dmsl_cds_thrift.hrl").
|
||||
-include_lib("capi_dummy_data.hrl").
|
||||
-include_lib("jose/include/jose_jwk.hrl").
|
||||
@ -218,26 +216,15 @@ create_payment_ok_test(Config) ->
|
||||
ExternalID = <<"merch_id">>,
|
||||
capi_ct_helper:mock_services(
|
||||
[
|
||||
{cds_storage, fun
|
||||
('PutSession', _) -> {ok, ok};
|
||||
('PutCard', _) -> {ok, ?PUT_CARD_RESULT}
|
||||
end},
|
||||
{invoicing, fun('StartPayment', [_, _, IPP]) ->
|
||||
#payproc_InvoicePaymentParams{id = ID, external_id = EID, context = ?CONTENT} = IPP,
|
||||
{ok, ?PAYPROC_PAYMENT(ID, EID)}
|
||||
end},
|
||||
{binbase, fun('Lookup', _) -> {ok, ?BINBASE_LOOKUP_RESULT} end},
|
||||
{bender, fun('GenerateID', _) -> {ok, capi_ct_helper_bender:get_result(BenderKey)} end}
|
||||
],
|
||||
Config
|
||||
),
|
||||
PaymentToolToken = capi_utils:map_to_base64url(#{
|
||||
<<"type" >> => <<"bank_card">>,
|
||||
<<"token" >> => ?STRING,
|
||||
<<"payment_system">> => atom_to_binary(visa, utf8),
|
||||
<<"bin" >> => <<"411111">>,
|
||||
<<"masked_pan" >> => <<"1111">>
|
||||
}),
|
||||
PaymentToolToken = ?TEST_PAYMENT_TOKEN,
|
||||
Req2 = #{
|
||||
<<"externalID">> => ExternalID,
|
||||
<<"flow">> => #{<<"type">> => <<"PaymentFlowInstant">>},
|
||||
@ -262,10 +249,6 @@ create_payment_ok_test(Config) ->
|
||||
create_payment_with_empty_cvv_ok_test(Config) ->
|
||||
capi_ct_helper:mock_services(
|
||||
[
|
||||
{cds_storage, fun
|
||||
('PutSession', _) -> {ok, ok};
|
||||
('PutCard', _) -> {ok, ?PUT_CARD_RESULT}
|
||||
end},
|
||||
{invoicing, fun
|
||||
('StartPayment', [_UserInfo, _InvoiceID,
|
||||
#payproc_InvoicePaymentParams{
|
||||
@ -280,8 +263,7 @@ create_payment_with_empty_cvv_ok_test(Config) ->
|
||||
}
|
||||
]) -> {ok, ?PAYPROC_PAYMENT}
|
||||
end},
|
||||
{bender, fun('GenerateID', _) -> {ok, capi_ct_helper_bender:get_result(<<"bender_key">>)} end},
|
||||
{binbase, fun('Lookup', _) -> {ok, ?BINBASE_LOOKUP_RESULT} end}
|
||||
{bender, fun('GenerateID', _) -> {ok, capi_ct_helper_bender:get_result(<<"bender_key">>)} end}
|
||||
],
|
||||
Config
|
||||
),
|
||||
@ -347,21 +329,6 @@ create_payment_qiwi_access_token_ok_test(Config) ->
|
||||
_.
|
||||
create_payment_with_googlepay_plain_ok_test(Config) ->
|
||||
capi_ct_helper:mock_services([
|
||||
{payment_tool_provider_google_pay,
|
||||
fun('Unwrap', _) ->
|
||||
{ok, ?UNWRAPPED_PAYMENT_TOOL(
|
||||
?GOOGLE_PAY_DETAILS,
|
||||
{card, #paytoolprv_Card{
|
||||
pan = <<"1234567890123456">>,
|
||||
exp_date = #paytoolprv_ExpDate{month = 10, year = 2018}
|
||||
}}
|
||||
)}
|
||||
end
|
||||
},
|
||||
{cds_storage, fun
|
||||
('PutSession', _) -> {ok, ok};
|
||||
('PutCard', _) -> {ok, ?PUT_CARD_RESULT}
|
||||
end},
|
||||
{invoicing, fun
|
||||
('StartPayment', [_UserInfo, _InvoiceID,
|
||||
#payproc_InvoicePaymentParams{
|
||||
@ -380,18 +347,9 @@ create_payment_with_googlepay_plain_ok_test(Config) ->
|
||||
}
|
||||
]) -> {ok, ?PAYPROC_PAYMENT}
|
||||
end},
|
||||
{binbase,
|
||||
fun('Lookup', _) -> {ok, ?BINBASE_LOOKUP_RESULT} end
|
||||
},
|
||||
{bender, fun('GenerateID', _) -> {ok, capi_ct_helper_bender:get_result(<<"bender_key">>)} end}
|
||||
], Config),
|
||||
PaymentToolToken = capi_utils:map_to_base64url(#{
|
||||
<<"type" >> => <<"bank_card">>,
|
||||
<<"token" >> => ?STRING,
|
||||
<<"payment_system">> => atom_to_binary(mastercard, utf8),
|
||||
<<"bin" >> => <<"411111">>,
|
||||
<<"masked_pan" >> => <<"1111">>
|
||||
}),
|
||||
PaymentToolToken = ?TEST_PAYMENT_TOKEN(mastercard),
|
||||
Req2 = #{
|
||||
<<"flow">> => #{<<"type">> => <<"PaymentFlowInstant">>},
|
||||
<<"payer">> => #{
|
||||
@ -461,23 +419,12 @@ capture_partial_payment_ok_test(Config) ->
|
||||
create_first_recurrent_payment_ok_test(Config) ->
|
||||
capi_ct_helper:mock_services(
|
||||
[
|
||||
{cds_storage, fun
|
||||
('PutSession', _) -> {ok, ok};
|
||||
('PutCard', _) -> {ok, ?PUT_CARD_RESULT}
|
||||
end},
|
||||
{invoicing, fun('StartPayment', _) -> {ok, ?PAYPROC_PAYMENT} end},
|
||||
{binbase, fun('Lookup', _) -> {ok, ?BINBASE_LOOKUP_RESULT} end},
|
||||
{bender, fun('GenerateID', _) -> {ok, capi_ct_helper_bender:get_result(<<"bender_key">>)} end}
|
||||
],
|
||||
Config
|
||||
),
|
||||
PaymentToolToken = capi_utils:map_to_base64url(#{
|
||||
<<"type" >> => <<"bank_card">>,
|
||||
<<"token" >> => ?STRING,
|
||||
<<"payment_system">> => atom_to_binary(visa, utf8),
|
||||
<<"bin" >> => <<"411111">>,
|
||||
<<"masked_pan" >> => <<"1111">>
|
||||
}),
|
||||
PaymentToolToken = ?TEST_PAYMENT_TOKEN,
|
||||
Req2 = #{
|
||||
<<"flow">> => #{<<"type">> => <<"PaymentFlowInstant">>},
|
||||
<<"makeRecurrent">> => true,
|
||||
@ -497,10 +444,6 @@ create_first_recurrent_payment_ok_test(Config) ->
|
||||
create_second_recurrent_payment_ok_test(Config) ->
|
||||
capi_ct_helper:mock_services(
|
||||
[
|
||||
{cds_storage, fun
|
||||
('PutSession', _) -> {ok, ok};
|
||||
('PutCard', _) -> {ok, ?PUT_CARD_RESULT}
|
||||
end},
|
||||
{invoicing, fun('StartPayment', _) -> {ok, ?PAYPROC_PAYMENT} end},
|
||||
{bender, fun('GenerateID', _) -> {ok, capi_ct_helper_bender:get_result(<<"bender_key">>)} end}
|
||||
],
|
||||
|
@ -79,8 +79,6 @@ get_service_modname(invoicing) ->
|
||||
{dmsl_payment_processing_thrift, 'Invoicing'};
|
||||
get_service_modname(invoice_templating) ->
|
||||
{dmsl_payment_processing_thrift, 'InvoiceTemplating'};
|
||||
get_service_modname(cds_storage) ->
|
||||
{dmsl_cds_thrift, 'Storage'};
|
||||
get_service_modname(merchant_stat) ->
|
||||
{dmsl_merch_stat_thrift, 'MerchantStatistics'};
|
||||
get_service_modname(reporting) ->
|
||||
@ -97,14 +95,6 @@ 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_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'};
|
||||
get_service_modname(binbase) ->
|
||||
{binbase_binbase_thrift, 'Binbase'};
|
||||
get_service_modname(bender) ->
|
||||
{bender_thrift, 'Bender'}.
|
||||
|
||||
|
@ -75,13 +75,9 @@
|
||||
invoicing => "http://hellgate:8022/v1/processing/invoicing",
|
||||
invoice_templating => "http://hellgate:8022/v1/processing/invoice_templating",
|
||||
webhook_manager => "http://hooker:8022/hook",
|
||||
cds_storage => "http://cds:8022/v1/storage",
|
||||
merchant_stat => "http://magista:8022/stat",
|
||||
reporting => "http://reporter:8022/reports",
|
||||
geo_ip_service => "http://columbus:8022/repo",
|
||||
payment_tool_provider_apple_pay => "http://adapter-appepay:8022/provider/apple",
|
||||
payment_tool_provider_google_pay => "http://adapter-goolepay:8022/provider/google",
|
||||
binbase => "http://binbase:8022/v1/binbase",
|
||||
bender => "http://bender:8022/v1/bender"
|
||||
}},
|
||||
{service_deadlines, #{
|
||||
|
@ -55,11 +55,6 @@
|
||||
{branch, "release/erlang/master"}
|
||||
}
|
||||
},
|
||||
{binbase_proto,
|
||||
{git, "git@github.com:rbkmoney/binbase-proto.git",
|
||||
{branch, "master"}
|
||||
}
|
||||
},
|
||||
{bender_proto,
|
||||
{git, "git@github.com:rbkmoney/bender-proto.git",
|
||||
{branch, "master"}
|
||||
|
@ -5,10 +5,6 @@
|
||||
{git,"git@github.com:rbkmoney/bender-proto.git",
|
||||
{ref,"d765b9dfeb89d6eefccb947356dab85fbff592a9"}},
|
||||
0},
|
||||
{<<"binbase_proto">>,
|
||||
{git,"git@github.com:rbkmoney/binbase-proto.git",
|
||||
{ref,"13bcd24e994ccfd1f25af1cda081399b9b58a014"}},
|
||||
0},
|
||||
{<<"cache">>,{pkg,<<"cache">>,<<"2.2.0">>},1},
|
||||
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.5.1">>},1},
|
||||
{<<"cg_mon">>,
|
||||
|
Loading…
Reference in New Issue
Block a user