2019-02-21 14:34:37 +00:00
|
|
|
-define(STRING, <<"TEST">>).
|
|
|
|
-define(RUB, <<"RUB">>).
|
|
|
|
-define(USD, <<"USD">>).
|
|
|
|
-define(BANKID_RU, <<"PUTIN">>).
|
|
|
|
-define(BANKID_US, <<"TRAMP">>).
|
|
|
|
-define(WALLET_TOOL, <<"TOOL">>).
|
|
|
|
-define(JSON, <<"{}">>).
|
|
|
|
-define(INTEGER, 10000).
|
|
|
|
-define(INTEGER_BINARY, <<"10000">>).
|
|
|
|
-define(TIMESTAMP, <<"2016-03-22T06:12:27Z">>).
|
|
|
|
-define(MD5, <<"033BD94B1168D7E4F0D644C3C95E35BF">>).
|
|
|
|
-define(SHA256, <<"94EE059335E587E501CC4BF90613E0814F00A7B08BC7C648FD865A2AF6A22CC2">>).
|
2020-02-14 15:54:55 +00:00
|
|
|
-define(DEFAULT_CONTEXT(PartyID), #{
|
|
|
|
<<"com.rbkmoney.wapi">> => {obj, #{
|
|
|
|
{str, <<"owner">>} => {str, PartyID},
|
|
|
|
{str, <<"name">>} => {str, ?STRING},
|
|
|
|
{str, <<"metadata">>} => {obj, #{{str, <<"somedata">>} => {str, ?STRING}}}
|
|
|
|
}}
|
|
|
|
}).
|
2020-09-03 15:30:09 +00:00
|
|
|
-define(BOOLEAN, true).
|
2019-02-21 14:34:37 +00:00
|
|
|
|
2020-09-15 08:04:05 +00:00
|
|
|
-define(DEFAULT_CONTEXT_NO_NAME(PartyID), #{
|
|
|
|
<<"com.rbkmoney.wapi">> => {obj, #{
|
|
|
|
{str, <<"owner">>} => {str, PartyID},
|
|
|
|
{str, <<"metadata">>} => {obj, #{{str, <<"somedata">>} => {str, ?STRING}}}
|
|
|
|
}}
|
|
|
|
}).
|
|
|
|
|
2020-06-02 13:18:39 +00:00
|
|
|
-define(DEFAULT_METADATA(), #{<<"somedata">> => {str, ?STRING}}).
|
|
|
|
|
2019-02-21 14:34:37 +00:00
|
|
|
-define(CASH, #'Cash'{
|
|
|
|
amount = ?INTEGER,
|
|
|
|
currency = #'CurrencyRef'{
|
|
|
|
symbolic_code = ?RUB
|
|
|
|
}
|
|
|
|
}).
|
|
|
|
|
2020-08-24 16:11:26 +00:00
|
|
|
-define(GET_INTERNAL_ID_RESULT, {
|
|
|
|
'bender_GetInternalIDResult',
|
|
|
|
?STRING,
|
|
|
|
{obj, #{{str, <<"context_data">>} => {str, ?STRING}}},
|
|
|
|
undefined
|
|
|
|
}).
|
|
|
|
|
2020-09-03 16:13:58 +00:00
|
|
|
-define(GENERATE_ID_RESULT, {
|
|
|
|
'bender_GenerationResult',
|
|
|
|
?STRING,
|
|
|
|
undefined,
|
|
|
|
undefined
|
|
|
|
}).
|
|
|
|
|
2020-09-02 19:24:58 +00:00
|
|
|
-define(WITHDRAWAL_STATUS, {pending, #wthd_status_Pending{}}).
|
|
|
|
|
|
|
|
-define(WITHDRAWAL(PartyID), #wthd_WithdrawalState{
|
|
|
|
id = ?STRING,
|
|
|
|
wallet_id = ?STRING,
|
|
|
|
destination_id = ?STRING,
|
|
|
|
body = ?CASH,
|
|
|
|
external_id = ?STRING,
|
|
|
|
status = ?WITHDRAWAL_STATUS,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
effective_final_cash_flow = #cashflow_FinalCashFlow{postings = []},
|
|
|
|
sessions = [],
|
|
|
|
adjustments = [],
|
|
|
|
metadata = ?DEFAULT_METADATA(),
|
|
|
|
context = ?DEFAULT_CONTEXT(PartyID)
|
|
|
|
}).
|
|
|
|
|
2020-09-16 07:55:20 +00:00
|
|
|
-define(WITHDRAWAL_QUOTE, #wthd_Quote{
|
|
|
|
cash_from = ?CASH,
|
|
|
|
cash_to = ?CASH,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
expires_on = ?TIMESTAMP,
|
|
|
|
operation_timestamp = ?TIMESTAMP,
|
|
|
|
domain_revision = 123,
|
|
|
|
party_revision = 123,
|
|
|
|
route = #wthd_Route{
|
|
|
|
provider_id = 123,
|
|
|
|
terminal_id = 123
|
|
|
|
},
|
|
|
|
quote_data = {str, ?STRING}
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(WITHDRAWAL_EVENT(Change), #wthd_Event{
|
|
|
|
change = Change,
|
|
|
|
occured_at = ?TIMESTAMP,
|
|
|
|
event_id = ?INTEGER
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(WITHDRAWAL_STATUS_CHANGE, {status_changed, #wthd_StatusChange{status = {pending, #wthd_status_Pending{}}}}).
|
|
|
|
|
2019-02-21 14:34:37 +00:00
|
|
|
-define(BLOCKING, unblocked).
|
|
|
|
|
|
|
|
-define(ACCOUNT, #account_Account{
|
|
|
|
id = ?STRING,
|
|
|
|
identity = ?STRING,
|
|
|
|
currency = #'CurrencyRef'{
|
|
|
|
symbolic_code = ?RUB
|
|
|
|
},
|
|
|
|
accounter_account_id = ?INTEGER
|
|
|
|
}).
|
|
|
|
|
2020-08-24 16:11:26 +00:00
|
|
|
-define(ACCOUNT_BALANCE, #account_AccountBalance{
|
|
|
|
id = ?STRING,
|
|
|
|
currency = #'CurrencyRef'{
|
|
|
|
symbolic_code = ?RUB
|
|
|
|
},
|
|
|
|
expected_min = ?INTEGER,
|
|
|
|
current = ?INTEGER,
|
|
|
|
expected_max = ?INTEGER
|
|
|
|
}).
|
|
|
|
|
2020-10-06 08:43:28 +00:00
|
|
|
-define(BANK_CARD, #'BankCard'{
|
|
|
|
bin_data_id = {i, ?INTEGER},
|
2020-03-03 11:49:33 +00:00
|
|
|
token = ?STRING,
|
|
|
|
bin = <<"424242">>,
|
|
|
|
masked_pan = <<"4242">>,
|
|
|
|
bank_name = ?STRING,
|
|
|
|
payment_system = visa,
|
|
|
|
issuer_country = rus,
|
|
|
|
card_type = debit
|
2020-10-06 08:43:28 +00:00
|
|
|
}).
|
|
|
|
|
|
|
|
-define(RESOURCE, {bank_card, ?BANK_CARD}).
|
2020-03-03 11:49:33 +00:00
|
|
|
|
|
|
|
-define(DESTINATION_STATUS, {authorized, #dst_Authorized{}}).
|
|
|
|
|
2020-06-02 13:18:39 +00:00
|
|
|
-define(DESTINATION(PartyID), #dst_DestinationState{
|
2020-03-03 11:49:33 +00:00
|
|
|
id = ?STRING,
|
|
|
|
name = ?STRING,
|
|
|
|
status = ?DESTINATION_STATUS,
|
|
|
|
account = ?ACCOUNT,
|
|
|
|
resource = ?RESOURCE,
|
|
|
|
external_id = ?STRING,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
context = ?DEFAULT_CONTEXT(PartyID)
|
|
|
|
}).
|
|
|
|
|
2020-06-02 13:18:39 +00:00
|
|
|
-define(WALLET(PartyID), #wlt_WalletState{
|
2020-02-14 15:54:55 +00:00
|
|
|
id = ?STRING,
|
|
|
|
name = ?STRING,
|
|
|
|
blocking = ?BLOCKING,
|
|
|
|
account = ?ACCOUNT,
|
|
|
|
external_id = ?STRING,
|
|
|
|
created_at = ?TIMESTAMP,
|
2020-06-02 13:18:39 +00:00
|
|
|
metadata = ?DEFAULT_METADATA(),
|
2020-02-14 15:54:55 +00:00
|
|
|
context = ?DEFAULT_CONTEXT(PartyID)
|
|
|
|
}).
|
|
|
|
|
2020-09-15 08:04:05 +00:00
|
|
|
-define(IDENTITY(PartyID),
|
|
|
|
?IDENTITY(PartyID, ?DEFAULT_CONTEXT(PartyID))
|
|
|
|
).
|
|
|
|
|
|
|
|
-define(IDENTITY(PartyID, Context), #idnt_IdentityState{
|
2020-06-02 13:18:39 +00:00
|
|
|
id = ?STRING,
|
2020-09-15 08:04:05 +00:00
|
|
|
name = ?STRING,
|
2020-06-02 13:18:39 +00:00
|
|
|
party_id = ?STRING,
|
|
|
|
provider_id = ?STRING,
|
2020-09-24 13:03:29 +00:00
|
|
|
contract_id = ?STRING,
|
2020-06-02 13:18:39 +00:00
|
|
|
class_id = ?STRING,
|
|
|
|
metadata = ?DEFAULT_METADATA(),
|
2020-09-15 08:04:05 +00:00
|
|
|
context = Context
|
2020-02-14 15:54:55 +00:00
|
|
|
}).
|
|
|
|
|
2020-06-02 13:18:39 +00:00
|
|
|
-define(IDENTITY_CHALLENGE(Status), #idnt_ChallengeState{
|
2020-02-14 15:54:55 +00:00
|
|
|
cls = ?STRING,
|
|
|
|
proofs = [
|
|
|
|
#idnt_ChallengeProof{
|
|
|
|
type = rus_domestic_passport,
|
|
|
|
token = ?STRING
|
|
|
|
}
|
|
|
|
],
|
|
|
|
id = ?STRING,
|
|
|
|
status = Status
|
2019-02-21 14:34:37 +00:00
|
|
|
}).
|
|
|
|
|
2020-02-14 15:54:55 +00:00
|
|
|
-define(IDENTITY_CHALLENGE_STATUS_COMPLETED, {completed, #idnt_ChallengeCompleted{
|
|
|
|
resolution = approved,
|
|
|
|
valid_until = ?TIMESTAMP
|
|
|
|
}}).
|
|
|
|
|
2020-06-02 13:18:39 +00:00
|
|
|
-define(IDENTITY_CHALLENGE_EVENT(Change), #idnt_Event{
|
2020-02-14 15:54:55 +00:00
|
|
|
change = Change,
|
|
|
|
occured_at = ?TIMESTAMP,
|
|
|
|
sequence = ?INTEGER
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(CHALLENGE_STATUS_CHANGE, {identity_challenge, #idnt_ChallengeChange{
|
|
|
|
id = ?STRING,
|
|
|
|
payload = {status_changed, ?IDENTITY_CHALLENGE_STATUS_COMPLETED}
|
|
|
|
}}).
|
|
|
|
|
2020-08-21 15:00:06 +00:00
|
|
|
-define(STAT_INVALID_EXCEPTION(Errors), #fistfulstat_InvalidRequest{errors = Errors}).
|
|
|
|
-define(STAT_BADTOKEN_EXCEPTION, #fistfulstat_BadToken{reason = ?STRING}).
|
|
|
|
|
|
|
|
-define(STAT_RESPONCE(Data), #fistfulstat_StatResponse{data = Data}).
|
|
|
|
|
|
|
|
-define(STAT_WALLETS, {wallets, [#fistfulstat_StatWallet{
|
|
|
|
id = ?STRING,
|
|
|
|
identity_id = ?STRING,
|
|
|
|
name = ?STRING,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
currency_symbolic_code = ?RUB
|
|
|
|
}]}).
|
|
|
|
|
|
|
|
-define(STAT_WITHDRAWALS, {withdrawals, [#fistfulstat_StatWithdrawal{
|
|
|
|
id = ?STRING,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
identity_id = ?STRING,
|
|
|
|
source_id = ?STRING,
|
|
|
|
destination_id = ?STRING,
|
|
|
|
external_id = ?STRING,
|
|
|
|
amount = ?INTEGER,
|
|
|
|
fee = ?INTEGER,
|
|
|
|
currency_symbolic_code = ?RUB,
|
|
|
|
status = {pending, #fistfulstat_WithdrawalPending{}}
|
|
|
|
}]}).
|
|
|
|
|
|
|
|
-define(STAT_DEPOSITS, {deposits, [#fistfulstat_StatDeposit{
|
|
|
|
id = ?STRING,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
identity_id = ?STRING,
|
|
|
|
source_id = ?STRING,
|
|
|
|
destination_id = ?STRING,
|
|
|
|
amount = ?INTEGER,
|
|
|
|
fee = ?INTEGER,
|
|
|
|
currency_symbolic_code = ?RUB,
|
|
|
|
status = {pending, #fistfulstat_DepositPending{}}
|
|
|
|
}]}).
|
|
|
|
|
2020-09-03 15:30:09 +00:00
|
|
|
-define(STAT_DESTINATIONS, {destinations, [#fistfulstat_StatDestination{
|
|
|
|
id = ?STRING,
|
|
|
|
name = ?STRING,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
is_blocked = ?BOOLEAN,
|
|
|
|
identity = ?STRING,
|
|
|
|
currency_symbolic_code = ?RUB,
|
|
|
|
resource = ?RESOURCE,
|
|
|
|
external_id = ?STRING,
|
|
|
|
status = {unauthorized, #fistfulstat_Unauthorized{}}
|
|
|
|
}]}).
|
|
|
|
|
|
|
|
-define(STAT_IDENTITIES, {identities, [#fistfulstat_StatIdentity{
|
|
|
|
id = ?STRING,
|
|
|
|
name = ?STRING,
|
|
|
|
created_at = ?TIMESTAMP,
|
2020-09-11 12:49:21 +00:00
|
|
|
provider = ?STRING,
|
2020-09-03 15:30:09 +00:00
|
|
|
identity_class = ?STRING,
|
|
|
|
identity_level = ?STRING,
|
|
|
|
effective_challenge = ?STRING,
|
|
|
|
is_blocked = ?BOOLEAN,
|
|
|
|
external_id = ?STRING
|
|
|
|
}]}).
|
|
|
|
|
2020-02-14 15:54:55 +00:00
|
|
|
-define(IDENT_DOC, {russian_domestic_passport, #'identdocstore_RussianDomesticPassport'{
|
|
|
|
issuer = ?STRING,
|
|
|
|
issuer_code = ?STRING,
|
|
|
|
issued_at = ?TIMESTAMP,
|
|
|
|
birth_date = ?TIMESTAMP,
|
|
|
|
birth_place = ?STRING,
|
|
|
|
series = ?STRING,
|
|
|
|
number = ?STRING,
|
|
|
|
first_name = ?STRING,
|
|
|
|
family_name = ?STRING,
|
|
|
|
patronymic = ?STRING
|
|
|
|
}}).
|
|
|
|
|
2019-02-21 14:34:37 +00:00
|
|
|
-define(REPORT_ID, ?INTEGER).
|
|
|
|
|
|
|
|
-define(REPORT_EXT(Status, FilesList), #ff_reports_Report{
|
|
|
|
report_id = ?INTEGER,
|
|
|
|
time_range = #ff_reports_ReportTimeRange{
|
|
|
|
from_time = ?TIMESTAMP,
|
|
|
|
to_time = ?TIMESTAMP
|
|
|
|
},
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
report_type = <<"withdrawalRegistry">>,
|
|
|
|
status = Status,
|
|
|
|
file_data_ids = FilesList
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(REPORT_WITH_STATUS(Status), ?REPORT_EXT(Status, [?STRING, ?STRING,?STRING])).
|
|
|
|
|
|
|
|
-define(REPORT, ?REPORT_WITH_STATUS(created)).
|
|
|
|
|
2019-08-12 10:58:18 +00:00
|
|
|
-define(WITHDRAWAL_EVENT_FILTER,
|
|
|
|
#webhooker_EventFilter{
|
|
|
|
types = ordsets:from_list([
|
|
|
|
{withdrawal, {started, #webhooker_WithdrawalStarted{}}},
|
|
|
|
{withdrawal, {succeeded, #webhooker_WithdrawalSucceeded{}}},
|
|
|
|
{withdrawal, {failed, #webhooker_WithdrawalFailed{}}}
|
|
|
|
])
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(DESTINATION_EVENT_FILTER, #webhooker_EventFilter{
|
|
|
|
types = ordsets:from_list([
|
|
|
|
{destination, {created, #webhooker_DestinationCreated{}}},
|
|
|
|
{destination, {unauthorized, #webhooker_DestinationUnauthorized{}}},
|
|
|
|
{destination, {authorized, #webhooker_DestinationAuthorized{}}}
|
|
|
|
])
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(WEBHOOK(EventFilter), #webhooker_Webhook{
|
|
|
|
id = ?INTEGER,
|
|
|
|
identity_id = ?STRING,
|
|
|
|
wallet_id = ?STRING,
|
|
|
|
event_filter = EventFilter,
|
|
|
|
url = ?STRING,
|
|
|
|
pub_key = ?STRING,
|
|
|
|
enabled = false
|
|
|
|
}).
|
|
|
|
|
2020-09-03 16:13:58 +00:00
|
|
|
-define(W2W_TRANSFER(PartyID), #w2w_transfer_W2WTransferState{
|
|
|
|
id = ?STRING,
|
|
|
|
wallet_from_id = ?STRING,
|
|
|
|
wallet_to_id = ?STRING,
|
|
|
|
body = ?CASH,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
domain_revision = ?INTEGER,
|
|
|
|
party_revision = ?INTEGER,
|
|
|
|
status = {pending, #w2w_status_Pending{}},
|
|
|
|
external_id = ?STRING,
|
|
|
|
metadata = ?DEFAULT_METADATA(),
|
|
|
|
context = ?DEFAULT_CONTEXT(PartyID),
|
|
|
|
effective_final_cash_flow = #cashflow_FinalCashFlow{
|
|
|
|
postings = []
|
|
|
|
},
|
|
|
|
adjustments = []
|
|
|
|
}).
|
|
|
|
|
2019-02-21 14:34:37 +00:00
|
|
|
-define(SNAPSHOT, #'Snapshot'{
|
|
|
|
version = ?INTEGER,
|
|
|
|
domain = #{
|
|
|
|
{category, #domain_CategoryRef{id = ?INTEGER}} =>
|
|
|
|
{category, #domain_CategoryObject{
|
|
|
|
ref = #domain_CategoryRef{id = ?INTEGER},
|
|
|
|
data = #domain_Category{
|
|
|
|
name = ?STRING,
|
|
|
|
description = ?STRING
|
|
|
|
}
|
|
|
|
}},
|
|
|
|
{business_schedule, #domain_BusinessScheduleRef{id = ?INTEGER}} =>
|
|
|
|
{business_schedule, #domain_BusinessScheduleObject{
|
|
|
|
ref = #domain_BusinessScheduleRef{id = ?INTEGER},
|
|
|
|
data = #domain_BusinessSchedule{
|
|
|
|
name = ?STRING,
|
|
|
|
description = ?STRING,
|
|
|
|
schedule = #'Schedule'{
|
|
|
|
year = {every, #'ScheduleEvery'{}},
|
|
|
|
month = {every, #'ScheduleEvery'{}},
|
|
|
|
day_of_month = {every, #'ScheduleEvery'{}},
|
|
|
|
day_of_week = {every, #'ScheduleEvery'{}},
|
|
|
|
hour = {every, #'ScheduleEvery'{}},
|
|
|
|
minute = {every, #'ScheduleEvery'{}},
|
|
|
|
second = {every, #'ScheduleEvery'{}}
|
|
|
|
},
|
|
|
|
delay = #'TimeSpan'{},
|
|
|
|
policy = #domain_PayoutCompilationPolicy{
|
|
|
|
assets_freeze_for = #'TimeSpan'{}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}},
|
|
|
|
{globals, #domain_GlobalsRef{}} =>
|
|
|
|
{globals, #domain_GlobalsObject{
|
|
|
|
ref = #domain_GlobalsRef{},
|
|
|
|
data = #domain_Globals{
|
|
|
|
external_account_set = {value, #domain_ExternalAccountSetRef{id = ?INTEGER}},
|
|
|
|
payment_institutions = [#domain_PaymentInstitutionRef{id = ?INTEGER}]
|
|
|
|
}
|
|
|
|
}},
|
|
|
|
{payment_institution, #domain_PaymentInstitutionRef{id = ?INTEGER}} =>
|
|
|
|
{payment_institution, #domain_PaymentInstitutionObject{
|
|
|
|
ref = #domain_PaymentInstitutionRef{id = ?INTEGER},
|
|
|
|
data = #domain_PaymentInstitution{
|
|
|
|
name = ?STRING,
|
|
|
|
description = ?STRING,
|
|
|
|
system_account_set = {value, #domain_SystemAccountSetRef{id = ?INTEGER}},
|
|
|
|
default_contract_template = {value, #domain_ContractTemplateRef{id = ?INTEGER}},
|
|
|
|
providers = {value, []},
|
|
|
|
inspector = {value, #domain_InspectorRef{id = ?INTEGER}},
|
|
|
|
realm = test,
|
|
|
|
residences = [rus]
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(TERM_SET, #domain_TermSet{
|
|
|
|
payouts = ?PAYOUTS_SERVICE_TERMS,
|
|
|
|
payments = ?PAYMENTS_SERVICE_TERMS
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(PAYOUTS_SERVICE_TERMS, #domain_PayoutsServiceTerms{}).
|
|
|
|
|
|
|
|
-define(PAYMENTS_SERVICE_TERMS, #domain_PaymentsServiceTerms{
|
|
|
|
payment_methods = {value,
|
2020-08-04 19:53:18 +00:00
|
|
|
ordsets:from_list([
|
2019-02-21 14:34:37 +00:00
|
|
|
#domain_PaymentMethodRef{
|
2020-08-04 19:53:18 +00:00
|
|
|
id = {bank_card_deprecated, mastercard}
|
2019-02-21 14:34:37 +00:00
|
|
|
},
|
|
|
|
#domain_PaymentMethodRef{
|
2020-08-04 19:53:18 +00:00
|
|
|
id = {bank_card_deprecated, visa}
|
2019-02-21 14:34:37 +00:00
|
|
|
},
|
|
|
|
#domain_PaymentMethodRef{
|
2020-08-04 19:53:18 +00:00
|
|
|
id = {tokenized_bank_card_deprecated, #domain_TokenizedBankCard{
|
2019-02-21 14:34:37 +00:00
|
|
|
payment_system = mastercard,
|
|
|
|
token_provider = applepay
|
|
|
|
}}
|
|
|
|
},
|
|
|
|
#domain_PaymentMethodRef{
|
2020-08-04 19:53:18 +00:00
|
|
|
id = {tokenized_bank_card_deprecated, #domain_TokenizedBankCard{
|
2019-02-21 14:34:37 +00:00
|
|
|
payment_system = visa,
|
|
|
|
token_provider = applepay
|
|
|
|
}}
|
|
|
|
}
|
2020-08-04 19:53:18 +00:00
|
|
|
])
|
2019-02-21 14:34:37 +00:00
|
|
|
}
|
|
|
|
}).
|
2020-10-06 08:43:28 +00:00
|
|
|
|
|
|
|
-define(RESOURCE_BANK_CARD, {bank_card, #'ResourceBankCard'{
|
|
|
|
bank_card = ?BANK_CARD
|
|
|
|
}}).
|
|
|
|
|
|
|
|
-define(RAW_RESOURCE, {resource, #'p2p_transfer_RawResource'{
|
|
|
|
contact_info = #'ContactInfo'{},
|
|
|
|
resource = ?RESOURCE_BANK_CARD
|
|
|
|
}}).
|
|
|
|
|
2020-10-06 12:24:28 +00:00
|
|
|
-define(P2P_TEMPLATE(PartyID), #p2p_template_P2PTemplateState{
|
|
|
|
id = ?STRING,
|
|
|
|
identity_id = ?STRING,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
domain_revision = 1,
|
|
|
|
party_revision = 1,
|
|
|
|
template_details = #p2p_template_P2PTemplateDetails{
|
|
|
|
body = #p2p_template_P2PTemplateBody{
|
|
|
|
value = #p2p_template_Cash{
|
|
|
|
amount = ?INTEGER,
|
|
|
|
currency = #'CurrencyRef'{
|
|
|
|
symbolic_code = ?RUB
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
metadata = #p2p_template_P2PTemplateMetadata{
|
|
|
|
value = ?DEFAULT_METADATA()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
blocking = ?BLOCKING,
|
|
|
|
external_id = ?STRING,
|
|
|
|
context = ?DEFAULT_CONTEXT(PartyID)
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(P2P_TEMPLATE_QUOTE, #p2p_transfer_Quote{
|
|
|
|
body = ?CASH,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
expires_on = ?TIMESTAMP,
|
|
|
|
domain_revision = 123,
|
|
|
|
party_revision = 123,
|
|
|
|
identity_id = ?STRING,
|
|
|
|
sender = ?RESOURCE_BANK_CARD,
|
|
|
|
receiver = ?RESOURCE_BANK_CARD,
|
|
|
|
%fees = #'Fees'{fees = #{operation_amount => ?CASH}}
|
|
|
|
fees = #'Fees'{fees = #{surplus => ?CASH}}
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(P2P_TEMPLATE_TRANSFER(PartyID), #p2p_transfer_P2PTransferState{
|
|
|
|
id = ?STRING,
|
|
|
|
owner = ?STRING,
|
|
|
|
sender = ?RAW_RESOURCE,
|
|
|
|
receiver = ?RAW_RESOURCE,
|
|
|
|
body = ?CASH,
|
|
|
|
status = {pending, #p2p_status_Pending{}},
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
domain_revision = ?INTEGER,
|
|
|
|
party_revision = ?INTEGER,
|
|
|
|
operation_timestamp = ?TIMESTAMP,
|
|
|
|
external_id = ?STRING,
|
|
|
|
metadata = ?DEFAULT_METADATA(),
|
|
|
|
context = ?DEFAULT_CONTEXT(PartyID),
|
|
|
|
effective_final_cash_flow = #cashflow_FinalCashFlow{
|
|
|
|
postings = []
|
|
|
|
},
|
|
|
|
sessions = [],
|
|
|
|
adjustments = []
|
|
|
|
}).
|
|
|
|
|
2020-10-06 08:43:28 +00:00
|
|
|
-define(P2P_TRANSFER(PartyID), #p2p_transfer_P2PTransferState{
|
|
|
|
id = ?STRING,
|
|
|
|
owner = ?STRING,
|
|
|
|
sender = ?RAW_RESOURCE,
|
|
|
|
receiver = ?RAW_RESOURCE,
|
|
|
|
body = ?CASH,
|
|
|
|
status = {pending, #p2p_status_Pending{}},
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
domain_revision = ?INTEGER,
|
|
|
|
party_revision = ?INTEGER,
|
|
|
|
operation_timestamp = ?TIMESTAMP,
|
|
|
|
external_id = ?STRING,
|
|
|
|
metadata = ?DEFAULT_METADATA(),
|
|
|
|
context = ?DEFAULT_CONTEXT(PartyID),
|
|
|
|
effective_final_cash_flow = #cashflow_FinalCashFlow{
|
|
|
|
postings = []
|
|
|
|
},
|
|
|
|
sessions = [],
|
|
|
|
adjustments = []
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(FEES, #'Fees'{fees = #{operation_amount => ?CASH}}).
|
|
|
|
|
|
|
|
-define(P2P_TRANSFER_QUOTE(IdentityID), #p2p_transfer_Quote{
|
|
|
|
body = ?CASH,
|
|
|
|
created_at = ?TIMESTAMP,
|
|
|
|
expires_on = ?TIMESTAMP,
|
|
|
|
domain_revision = ?INTEGER,
|
|
|
|
party_revision = ?INTEGER,
|
|
|
|
identity_id = IdentityID,
|
|
|
|
sender = ?RESOURCE_BANK_CARD,
|
|
|
|
receiver = ?RESOURCE_BANK_CARD,
|
|
|
|
fees = ?FEES
|
|
|
|
}).
|