2016-04-19 15:59:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* Определения предметной области.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
include "base.thrift"
|
2017-08-03 10:48:31 +00:00
|
|
|
|
include "msgpack.thrift"
|
2017-10-23 12:00:48 +00:00
|
|
|
|
include "json.thrift"
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
namespace java com.rbkmoney.damsel.domain
|
|
|
|
|
namespace erlang domain
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
typedef i64 DataRevision
|
|
|
|
|
typedef i32 ObjectID
|
|
|
|
|
typedef json.Value Metadata
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
|
|
|
|
/* Common */
|
|
|
|
|
|
2016-10-07 10:40:54 +00:00
|
|
|
|
/** Контактная информация. **/
|
|
|
|
|
struct ContactInfo {
|
|
|
|
|
1: optional string phone_number
|
|
|
|
|
2: optional string email
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
union OperationFailure {
|
|
|
|
|
1: OperationTimeout operation_timeout
|
2018-02-15 12:55:50 +00:00
|
|
|
|
2: Failure failure
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct OperationTimeout {}
|
|
|
|
|
|
2018-02-15 12:55:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* "Динамическое" представление ошибки,
|
|
|
|
|
* должно использоваться только для передачи,
|
|
|
|
|
* для интерпретации нужно использовать конвертацию в типизированный вид.
|
|
|
|
|
*
|
|
|
|
|
* Если при попытке интерпретировать код через типизированный вид происходит ошибка (нет такого типа),
|
|
|
|
|
* то это означает, что ошибка неизвестна, и такую ситуацию нужно уметь обрабатывать
|
|
|
|
|
* (например просто отдать неизветсную ошибку наверх).
|
|
|
|
|
*
|
|
|
|
|
* Старые ошибки совместимы с новыми и будут читаться.
|
|
|
|
|
* Структура осталась та же, только поле description переименовалось в reason,
|
|
|
|
|
* и добавилось поле sub.
|
|
|
|
|
* В результате для старых ошибок description будет в reason, а в code будет код ошибки
|
|
|
|
|
* (который будет интропретирован как неизвестная ошибка).
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
struct Failure {
|
|
|
|
|
1: required FailureCode code;
|
|
|
|
|
|
|
|
|
|
2: optional FailureReason reason;
|
|
|
|
|
3: optional SubFailure sub;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typedef string FailureCode;
|
|
|
|
|
typedef string FailureReason; // причина возникшей ошибки и пояснение откуда она взялась
|
|
|
|
|
|
|
|
|
|
// возможность делать коды ошибок иерархическими
|
|
|
|
|
struct SubFailure {
|
|
|
|
|
1: required FailureCode code;
|
|
|
|
|
2: optional SubFailure sub;
|
2016-12-13 17:23:13 +00:00
|
|
|
|
}
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
/** Сумма в минимальных денежных единицах. */
|
|
|
|
|
typedef i64 Amount
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/** Номер счёта. */
|
|
|
|
|
typedef i64 AccountID
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/** Денежные средства, состоящие из суммы и валюты. */
|
|
|
|
|
struct Cash {
|
2016-05-18 16:27:06 +00:00
|
|
|
|
1: required Amount amount
|
2016-12-13 17:23:13 +00:00
|
|
|
|
2: required CurrencyRef currency
|
2016-06-02 11:38:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Contractor transactions */
|
|
|
|
|
|
|
|
|
|
struct TransactionInfo {
|
|
|
|
|
1: required string id
|
|
|
|
|
2: optional base.Timestamp timestamp
|
2017-01-20 09:16:31 +00:00
|
|
|
|
3: required base.StringMap extra
|
2019-04-16 14:55:27 +00:00
|
|
|
|
4: optional AdditionalTransactionInfo additional_info
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct AdditionalTransactionInfo {
|
|
|
|
|
1: optional string rrn // Retrieval Reference Number
|
|
|
|
|
2: optional string approval_code // Authorization Approval Code
|
|
|
|
|
3: optional string acs_url // Issuer Access Control Server (ACS)
|
|
|
|
|
4: optional string pareq // Payer Authentication Request (PAReq)
|
|
|
|
|
5: optional string md // Merchant Data
|
|
|
|
|
6: optional string term_url // Upon success term_url callback is called with following form encoded params
|
|
|
|
|
7: optional string pares // Payer Authentication Response (PARes)
|
|
|
|
|
8: optional string eci // Electronic Commerce Indicator
|
|
|
|
|
9: optional string cavv // Cardholder Authentication Verification Value
|
|
|
|
|
10: optional string xid // 3D Secure transaction identifier
|
|
|
|
|
11: optional string cavv_algorithm // Indicates algorithm used to generate CAVV
|
2019-04-19 10:08:52 +00:00
|
|
|
|
12: optional ThreeDsVerification three_ds_verification
|
2019-04-16 14:55:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Issuer Authentication Results Values
|
|
|
|
|
**/
|
2019-04-19 10:08:52 +00:00
|
|
|
|
enum ThreeDsVerification {
|
2019-04-16 14:55:27 +00:00
|
|
|
|
authentication_successful // Y
|
|
|
|
|
attempts_processing_performed // A
|
|
|
|
|
authentication_failed // N
|
|
|
|
|
authentication_could_not_be_performed // U
|
2016-05-18 16:27:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
/* Invoices */
|
|
|
|
|
|
|
|
|
|
typedef base.ID InvoiceID
|
|
|
|
|
typedef base.ID InvoicePaymentID
|
2017-09-12 09:36:42 +00:00
|
|
|
|
typedef base.ID InvoicePaymentRefundID
|
2017-06-15 16:24:35 +00:00
|
|
|
|
typedef base.ID InvoicePaymentAdjustmentID
|
2016-10-10 13:14:58 +00:00
|
|
|
|
typedef base.Content InvoiceContext
|
|
|
|
|
typedef base.Content InvoicePaymentContext
|
2017-05-23 14:14:41 +00:00
|
|
|
|
typedef string PaymentSessionID
|
2016-07-28 12:01:03 +00:00
|
|
|
|
typedef string Fingerprint
|
|
|
|
|
typedef string IPAddress
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
struct Invoice {
|
2016-12-13 17:23:13 +00:00
|
|
|
|
1 : required InvoiceID id
|
|
|
|
|
2 : required PartyID owner_id
|
2018-01-19 13:44:26 +00:00
|
|
|
|
13: optional PartyRevision party_revision
|
2016-12-13 17:23:13 +00:00
|
|
|
|
3 : required ShopID shop_id
|
|
|
|
|
4 : required base.Timestamp created_at
|
|
|
|
|
6 : required InvoiceStatus status
|
2016-12-21 12:53:12 +00:00
|
|
|
|
7 : required InvoiceDetails details
|
2016-12-13 17:23:13 +00:00
|
|
|
|
8 : required base.Timestamp due
|
|
|
|
|
10: required Cash cost
|
|
|
|
|
11: optional InvoiceContext context
|
2017-07-26 10:32:38 +00:00
|
|
|
|
12: optional InvoiceTemplateID template_id
|
2019-04-02 15:38:22 +00:00
|
|
|
|
14: optional string external_id
|
2016-12-13 17:23:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-21 12:53:12 +00:00
|
|
|
|
struct InvoiceDetails {
|
2016-12-13 17:23:13 +00:00
|
|
|
|
1: required string product
|
|
|
|
|
2: optional string description
|
2017-08-03 10:48:31 +00:00
|
|
|
|
3: optional InvoiceCart cart
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoiceCart {
|
|
|
|
|
1: required list<InvoiceLine> lines
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoiceLine {
|
|
|
|
|
1: required string product
|
|
|
|
|
2: required i32 quantity
|
|
|
|
|
3: required Cash price
|
|
|
|
|
/* Taxes and other stuff goes here */
|
|
|
|
|
4: required map<string, msgpack.Value> metadata
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
struct InvoiceUnpaid {}
|
|
|
|
|
struct InvoicePaid {}
|
|
|
|
|
struct InvoiceCancelled { 1: required string details }
|
|
|
|
|
struct InvoiceFulfilled { 1: required string details }
|
|
|
|
|
|
|
|
|
|
union InvoiceStatus {
|
|
|
|
|
1: InvoiceUnpaid unpaid
|
|
|
|
|
2: InvoicePaid paid
|
|
|
|
|
3: InvoiceCancelled cancelled
|
|
|
|
|
4: InvoiceFulfilled fulfilled
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoicePayment {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: required InvoicePaymentID id
|
|
|
|
|
2: required base.Timestamp created_at
|
|
|
|
|
10: required DataRevision domain_revision
|
2018-07-18 11:01:57 +00:00
|
|
|
|
16: optional PartyID owner_id
|
|
|
|
|
17: optional ShopID shop_id
|
2018-01-19 13:44:26 +00:00
|
|
|
|
15: optional PartyRevision party_revision
|
2017-01-20 09:16:31 +00:00
|
|
|
|
3: required InvoicePaymentStatus status
|
2017-10-23 12:00:48 +00:00
|
|
|
|
14: required Payer payer
|
2017-01-20 09:16:31 +00:00
|
|
|
|
8: required Cash cost
|
2017-08-29 15:51:12 +00:00
|
|
|
|
13: required InvoicePaymentFlow flow
|
2018-09-26 11:55:10 +00:00
|
|
|
|
18: optional bool make_recurrent
|
2017-01-20 09:16:31 +00:00
|
|
|
|
6: optional InvoicePaymentContext context
|
2019-04-02 15:38:22 +00:00
|
|
|
|
19: optional string external_id
|
2019-08-15 12:32:03 +00:00
|
|
|
|
20: optional string payment_deadline
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
struct InvoicePaymentPending {}
|
2016-09-27 13:01:50 +00:00
|
|
|
|
struct InvoicePaymentProcessed {}
|
2019-01-28 10:52:37 +00:00
|
|
|
|
struct InvoicePaymentCaptured {
|
|
|
|
|
1: optional string reason
|
|
|
|
|
2: optional Cash cost
|
2019-05-17 09:07:25 +00:00
|
|
|
|
3: optional InvoiceCart cart
|
2019-01-28 10:52:37 +00:00
|
|
|
|
}
|
2017-09-12 09:36:42 +00:00
|
|
|
|
struct InvoicePaymentCancelled { 1: optional string reason }
|
|
|
|
|
struct InvoicePaymentRefunded {}
|
2016-12-13 17:23:13 +00:00
|
|
|
|
struct InvoicePaymentFailed { 1: required OperationFailure failure }
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
2017-07-26 10:32:38 +00:00
|
|
|
|
/**
|
|
|
|
|
* Шаблон инвойса.
|
|
|
|
|
* Согласно https://github.com/rbkmoney/coredocs/blob/0a5ae1a79f977be3134c3b22028631da5225d407/docs/domain/entities/invoice.md#шаблон-инвойса
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
typedef base.ID InvoiceTemplateID
|
|
|
|
|
|
|
|
|
|
struct InvoiceTemplate {
|
2017-10-25 12:44:15 +00:00
|
|
|
|
1: required InvoiceTemplateID id
|
|
|
|
|
2: required PartyID owner_id
|
|
|
|
|
3: required ShopID shop_id
|
|
|
|
|
5: required LifetimeInterval invoice_lifetime
|
|
|
|
|
9: required string product # for backward compatibility
|
|
|
|
|
10: optional string description
|
|
|
|
|
8: required InvoiceTemplateDetails details
|
|
|
|
|
7: optional InvoiceContext context
|
2017-07-26 10:32:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-25 12:44:15 +00:00
|
|
|
|
union InvoiceTemplateDetails {
|
|
|
|
|
1: InvoiceCart cart
|
|
|
|
|
2: InvoiceTemplateProduct product
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoiceTemplateProduct {
|
|
|
|
|
1: required string product
|
|
|
|
|
2: required InvoiceTemplateProductPrice price
|
|
|
|
|
3: required map<string, msgpack.Value> metadata
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union InvoiceTemplateProductPrice {
|
2017-07-26 10:32:38 +00:00
|
|
|
|
1: Cash fixed
|
|
|
|
|
2: CashRange range
|
|
|
|
|
3: InvoiceTemplateCostUnlimited unlim
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoiceTemplateCostUnlimited {}
|
|
|
|
|
|
2016-09-27 13:01:50 +00:00
|
|
|
|
/**
|
|
|
|
|
* Статус платежа.
|
|
|
|
|
*/
|
2016-06-16 15:07:06 +00:00
|
|
|
|
union InvoicePaymentStatus {
|
|
|
|
|
1: InvoicePaymentPending pending
|
2016-09-27 13:01:50 +00:00
|
|
|
|
4: InvoicePaymentProcessed processed
|
|
|
|
|
2: InvoicePaymentCaptured captured
|
|
|
|
|
5: InvoicePaymentCancelled cancelled
|
2017-09-12 09:36:42 +00:00
|
|
|
|
6: InvoicePaymentRefunded refunded
|
2016-06-16 15:07:06 +00:00
|
|
|
|
3: InvoicePaymentFailed failed
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/**
|
|
|
|
|
* Целевое значение статуса платежа.
|
|
|
|
|
*/
|
|
|
|
|
union TargetInvoicePaymentStatus {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Платёж обработан.
|
|
|
|
|
*
|
|
|
|
|
* При достижении платежом этого статуса процессинг должен обладать:
|
|
|
|
|
* - фактом того, что провайдер _по крайней мере_ авторизовал списание денежных средств в
|
|
|
|
|
* пользу системы;
|
|
|
|
|
* - данными транзакции провайдера.
|
|
|
|
|
*/
|
|
|
|
|
1: InvoicePaymentProcessed processed
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Платёж подтверждён.
|
|
|
|
|
*
|
|
|
|
|
* При достижении платежом этого статуса процессинг должен быть уверен в том, что провайдер
|
|
|
|
|
* _по крайней мере_ подтвердил финансовые обязательства перед системой.
|
|
|
|
|
*/
|
|
|
|
|
2: InvoicePaymentCaptured captured
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Платёж отменён.
|
|
|
|
|
*
|
|
|
|
|
* При достижении платежом этого статуса процессинг должен быть уверен в том, что провайдер
|
|
|
|
|
* аннулировал неподтверждённое списание денежных средств.
|
|
|
|
|
*
|
|
|
|
|
* В случае, если в рамках сессии проведения платежа провайдер авторизовал, но _ещё не
|
|
|
|
|
* подтвердил_ списание средств, эта цель является обратной цели `processed`. В ином случае
|
|
|
|
|
* эта цель недостижима, и взаимодействие в рамках сессии должно завершится с ошибкой.
|
|
|
|
|
*/
|
|
|
|
|
3: InvoicePaymentCancelled cancelled
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
/**
|
|
|
|
|
* Платёж возвращён.
|
|
|
|
|
*
|
|
|
|
|
* При достижении платежом этого статуса процессинг должен быть уверен в том, что провайдер
|
|
|
|
|
* возвратил денежные средства плательщику, потраченные им в ходе подтверждённого списания.
|
|
|
|
|
*
|
|
|
|
|
* Если эта цель недостижима, взаимодействие в рамках сессии должно завершится с ошибкой.
|
|
|
|
|
*/
|
|
|
|
|
4: InvoicePaymentRefunded refunded
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
union Payer {
|
|
|
|
|
1: PaymentResourcePayer payment_resource
|
|
|
|
|
2: CustomerPayer customer
|
2018-09-26 11:55:10 +00:00
|
|
|
|
3: RecurrentPayer recurrent
|
2017-10-23 12:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PaymentResourcePayer {
|
|
|
|
|
1: required DisposablePaymentResource resource
|
|
|
|
|
2: required ContactInfo contact_info
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CustomerPayer {
|
|
|
|
|
1: required CustomerID customer_id
|
|
|
|
|
2: required CustomerBindingID customer_binding_id
|
|
|
|
|
3: required RecurrentPaymentToolID rec_payment_tool_id
|
|
|
|
|
4: required PaymentTool payment_tool
|
2017-11-22 10:21:20 +00:00
|
|
|
|
5: required ContactInfo contact_info
|
2017-10-23 12:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-09-26 11:55:10 +00:00
|
|
|
|
struct RecurrentPayer {
|
|
|
|
|
1: required PaymentTool payment_tool
|
|
|
|
|
2: required RecurrentParentPayment recurrent_parent
|
|
|
|
|
3: required ContactInfo contact_info
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-28 12:01:03 +00:00
|
|
|
|
struct ClientInfo {
|
|
|
|
|
1: optional IPAddress ip_address
|
|
|
|
|
2: optional Fingerprint fingerprint
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct PaymentRoute {
|
2016-10-17 14:27:32 +00:00
|
|
|
|
1: required ProviderRef provider
|
|
|
|
|
2: required TerminalRef terminal
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-26 11:55:10 +00:00
|
|
|
|
struct RecurrentParentPayment {
|
|
|
|
|
1: required InvoiceID invoice_id
|
|
|
|
|
2: required InvoicePaymentID payment_id
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
/* Adjustments */
|
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
struct InvoicePaymentAdjustment {
|
|
|
|
|
1: required InvoicePaymentAdjustmentID id
|
|
|
|
|
2: required InvoicePaymentAdjustmentStatus status
|
|
|
|
|
3: required base.Timestamp created_at
|
|
|
|
|
4: required DataRevision domain_revision
|
|
|
|
|
5: required string reason
|
|
|
|
|
6: required FinalCashFlow new_cash_flow
|
|
|
|
|
7: required FinalCashFlow old_cash_flow_inverse
|
2018-09-17 13:18:37 +00:00
|
|
|
|
8: optional PartyRevision party_revision
|
2017-06-15 16:24:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoicePaymentAdjustmentPending {}
|
2019-06-28 11:14:00 +00:00
|
|
|
|
struct InvoicePaymentAdjustmentProcessed {}
|
2017-06-15 16:24:35 +00:00
|
|
|
|
struct InvoicePaymentAdjustmentCaptured { 1: required base.Timestamp at }
|
|
|
|
|
struct InvoicePaymentAdjustmentCancelled { 1: required base.Timestamp at }
|
|
|
|
|
|
|
|
|
|
union InvoicePaymentAdjustmentStatus {
|
2019-06-28 11:14:00 +00:00
|
|
|
|
1: InvoicePaymentAdjustmentPending pending
|
|
|
|
|
2: InvoicePaymentAdjustmentCaptured captured
|
2017-06-15 16:24:35 +00:00
|
|
|
|
3: InvoicePaymentAdjustmentCancelled cancelled
|
2019-06-28 11:14:00 +00:00
|
|
|
|
4: InvoicePaymentAdjustmentProcessed processed
|
2017-06-15 16:24:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-29 15:51:12 +00:00
|
|
|
|
/**
|
|
|
|
|
* Процесс выполнения платежа.
|
|
|
|
|
*/
|
|
|
|
|
union InvoicePaymentFlow {
|
|
|
|
|
1: InvoicePaymentFlowInstant instant
|
|
|
|
|
2: InvoicePaymentFlowHold hold
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoicePaymentFlowInstant {}
|
|
|
|
|
|
|
|
|
|
struct InvoicePaymentFlowHold {
|
|
|
|
|
1: required OnHoldExpiration on_hold_expiration
|
|
|
|
|
2: required base.Timestamp held_until
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum OnHoldExpiration {
|
|
|
|
|
cancel
|
|
|
|
|
capture
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
/* Refunds */
|
|
|
|
|
|
|
|
|
|
struct InvoicePaymentRefund {
|
|
|
|
|
1: required InvoicePaymentRefundID id
|
|
|
|
|
2: required InvoicePaymentRefundStatus status
|
|
|
|
|
3: required base.Timestamp created_at
|
|
|
|
|
4: required DataRevision domain_revision
|
2018-09-17 13:18:37 +00:00
|
|
|
|
7: optional PartyRevision party_revision
|
2018-03-06 14:04:49 +00:00
|
|
|
|
6: optional Cash cash
|
2017-09-12 09:36:42 +00:00
|
|
|
|
5: optional string reason
|
2019-05-17 09:07:25 +00:00
|
|
|
|
8: optional InvoiceCart cart
|
2019-07-16 13:30:05 +00:00
|
|
|
|
9: optional string external_id
|
2017-09-12 09:36:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union InvoicePaymentRefundStatus {
|
|
|
|
|
1: InvoicePaymentRefundPending pending
|
|
|
|
|
2: InvoicePaymentRefundSucceeded succeeded
|
|
|
|
|
3: InvoicePaymentRefundFailed failed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoicePaymentRefundPending {}
|
|
|
|
|
struct InvoicePaymentRefundSucceeded {}
|
|
|
|
|
|
|
|
|
|
struct InvoicePaymentRefundFailed {
|
|
|
|
|
1: required OperationFailure failure
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
/* Blocking and suspension */
|
|
|
|
|
|
|
|
|
|
union Blocking {
|
|
|
|
|
1: Unblocked unblocked
|
|
|
|
|
2: Blocked blocked
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct Unblocked {
|
|
|
|
|
1: required string reason
|
2017-07-17 10:21:41 +00:00
|
|
|
|
2: required base.Timestamp since
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct Blocked {
|
|
|
|
|
1: required string reason
|
2017-07-17 10:21:41 +00:00
|
|
|
|
2: required base.Timestamp since
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union Suspension {
|
|
|
|
|
1: Active active
|
|
|
|
|
2: Suspended suspended
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct Active {
|
|
|
|
|
1: required base.Timestamp since
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct Suspended {
|
|
|
|
|
1: required base.Timestamp since
|
|
|
|
|
}
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
|
|
|
|
/* Parties */
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
typedef base.ID PartyID
|
2018-01-19 13:44:26 +00:00
|
|
|
|
typedef i64 PartyRevision
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
2017-08-03 10:48:31 +00:00
|
|
|
|
typedef string PartyMetaNamespace
|
|
|
|
|
typedef msgpack.Value PartyMetaData
|
|
|
|
|
typedef map<PartyMetaNamespace, PartyMetaData> PartyMeta
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
/** Участник. */
|
|
|
|
|
struct Party {
|
|
|
|
|
1: required PartyID id
|
2017-01-17 13:12:35 +00:00
|
|
|
|
7: required PartyContactInfo contact_info
|
2017-07-17 10:21:41 +00:00
|
|
|
|
8: required base.Timestamp created_at
|
2016-08-10 12:06:59 +00:00
|
|
|
|
2: required Blocking blocking
|
|
|
|
|
3: required Suspension suspension
|
2018-07-17 14:32:10 +00:00
|
|
|
|
9: required map<ContractorID, PartyContractor> contractors
|
2017-01-20 09:16:31 +00:00
|
|
|
|
4: required map<ContractID, Contract> contracts
|
|
|
|
|
5: required map<ShopID, Shop> shops
|
2018-07-17 14:32:10 +00:00
|
|
|
|
10: required map<WalletID, Wallet> wallets
|
2018-01-19 13:44:26 +00:00
|
|
|
|
6: required PartyRevision revision
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-17 13:12:35 +00:00
|
|
|
|
struct PartyContactInfo {
|
|
|
|
|
1: required string email
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
/* Shops */
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
typedef base.ID ShopID
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
|
|
|
|
/** Магазин мерчанта. */
|
|
|
|
|
struct Shop {
|
|
|
|
|
1: required ShopID id
|
2017-07-17 10:21:41 +00:00
|
|
|
|
11: required base.Timestamp created_at
|
2016-08-10 12:06:59 +00:00
|
|
|
|
2: required Blocking blocking
|
|
|
|
|
3: required Suspension suspension
|
2016-10-10 13:14:58 +00:00
|
|
|
|
4: required ShopDetails details
|
2017-07-17 10:21:41 +00:00
|
|
|
|
10: required ShopLocation location
|
2016-10-10 13:14:58 +00:00
|
|
|
|
5: required CategoryRef category
|
2016-12-14 11:09:57 +00:00
|
|
|
|
6: optional ShopAccount account
|
2016-12-09 12:05:35 +00:00
|
|
|
|
7: required ContractID contract_id
|
2017-01-20 09:16:31 +00:00
|
|
|
|
8: optional PayoutToolID payout_tool_id
|
2018-05-16 13:03:37 +00:00
|
|
|
|
12: optional BusinessScheduleRef payout_schedule
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
struct ShopAccount {
|
2016-10-10 13:14:58 +00:00
|
|
|
|
1: required CurrencyRef currency
|
2016-12-14 11:09:57 +00:00
|
|
|
|
2: required AccountID settlement
|
2016-10-10 13:14:58 +00:00
|
|
|
|
3: required AccountID guarantee
|
2017-01-19 13:32:22 +00:00
|
|
|
|
/* Аккаунт на который выводятся деньги из системы */
|
|
|
|
|
4: required AccountID payout
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
struct ShopDetails {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: optional string description
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
union ShopLocation {
|
|
|
|
|
1: string url
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
|
|
|
|
|
/** RBKM Wallets **/
|
|
|
|
|
|
|
|
|
|
typedef base.ID WalletID
|
|
|
|
|
|
|
|
|
|
struct Wallet {
|
|
|
|
|
1: required WalletID id
|
|
|
|
|
2: optional string name
|
|
|
|
|
3: required base.Timestamp created_at
|
|
|
|
|
4: required Blocking blocking
|
|
|
|
|
5: required Suspension suspension
|
|
|
|
|
6: required ContractID contract
|
|
|
|
|
7: optional WalletAccount account
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct WalletAccount {
|
|
|
|
|
1: required CurrencyRef currency
|
|
|
|
|
2: required AccountID settlement
|
|
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
// ?????
|
|
|
|
|
3: required AccountID payout
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 13:03:31 +00:00
|
|
|
|
/* Инспекция платежа */
|
|
|
|
|
|
|
|
|
|
enum RiskScore {
|
|
|
|
|
low = 1
|
|
|
|
|
high = 100
|
2017-08-10 08:43:26 +00:00
|
|
|
|
fatal = 9999
|
2016-12-09 13:03:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
/* Contracts */
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
typedef base.ID ContractorID
|
|
|
|
|
typedef base.Opaque IdentityDocumentToken
|
|
|
|
|
|
|
|
|
|
struct PartyContractor {
|
|
|
|
|
1: required ContractorID id
|
|
|
|
|
2: required Contractor contractor
|
|
|
|
|
3: required ContractorIdentificationLevel status
|
|
|
|
|
4: required list<IdentityDocumentToken> identity_documents
|
|
|
|
|
}
|
2016-10-10 13:14:58 +00:00
|
|
|
|
|
2016-04-26 16:01:04 +00:00
|
|
|
|
/** Лицо, выступающее стороной договора. */
|
2017-07-17 10:21:41 +00:00
|
|
|
|
union Contractor {
|
|
|
|
|
2: RegisteredUser registered_user
|
2018-07-17 14:32:10 +00:00
|
|
|
|
1: LegalEntity legal_entity
|
|
|
|
|
3: PrivateEntity private_entity
|
2016-12-09 15:01:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct RegisteredUser {
|
|
|
|
|
1: required string email
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union LegalEntity {
|
2016-12-09 15:01:35 +00:00
|
|
|
|
1: RussianLegalEntity russian_legal_entity
|
2018-01-19 13:44:26 +00:00
|
|
|
|
2: InternationalLegalEntity international_legal_entity
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
// TODO refactor with RepresentativePerson
|
2016-12-09 15:01:35 +00:00
|
|
|
|
/** Юридическое лицо-резидент РФ */
|
|
|
|
|
struct RussianLegalEntity {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/* Наименование */
|
2016-12-09 15:01:35 +00:00
|
|
|
|
1: required string registered_name
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/* ОГРН */
|
2016-12-09 15:01:35 +00:00
|
|
|
|
2: required string registered_number
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/* ИНН/КПП */
|
2016-12-09 15:01:35 +00:00
|
|
|
|
3: required string inn
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/* Адрес места нахождения */
|
2016-12-09 15:01:35 +00:00
|
|
|
|
4: required string actual_address
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/* Адрес для отправки корреспонденции (почтовый) */
|
2016-12-09 15:01:35 +00:00
|
|
|
|
5: required string post_address
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/* Наименование должности ЕИО/представителя */
|
2016-12-09 15:01:35 +00:00
|
|
|
|
6: required string representative_position
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/* ФИО ЕИО/представителя */
|
2016-12-09 15:01:35 +00:00
|
|
|
|
7: required string representative_full_name
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/* Наименование документа, на основании которого действует ЕИО/представитель */
|
2016-12-09 15:01:35 +00:00
|
|
|
|
8: required string representative_document
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/* Реквизиты юр.лица */
|
2018-01-19 13:44:26 +00:00
|
|
|
|
9: required RussianBankAccount russian_bank_account
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InternationalLegalEntity {
|
|
|
|
|
/* Наименование */
|
|
|
|
|
1: required string legal_name
|
|
|
|
|
/* Торговое наименование (если применимо) */
|
|
|
|
|
2: optional string trading_name
|
|
|
|
|
/* Адрес места регистрации */
|
|
|
|
|
3: required string registered_address
|
|
|
|
|
/* Адрес места нахождения (если отличается от регистрации)*/
|
|
|
|
|
4: optional string actual_address
|
2018-02-26 12:14:59 +00:00
|
|
|
|
/* Регистрационный номер */
|
|
|
|
|
5: optional string registered_number
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
enum ContractorIdentificationLevel {
|
|
|
|
|
none = 100
|
|
|
|
|
partial = 200
|
|
|
|
|
full = 300
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
/** Банковский счёт. */
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
struct RussianBankAccount {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: required string account
|
|
|
|
|
2: required string bank_name
|
|
|
|
|
3: required string bank_post_account
|
|
|
|
|
4: required string bank_bik
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
struct InternationalBankAccount {
|
2018-08-31 16:53:40 +00:00
|
|
|
|
|
|
|
|
|
// common
|
|
|
|
|
6: optional string number
|
|
|
|
|
7: optional InternationalBankDetails bank
|
|
|
|
|
8: optional InternationalBankAccount correspondent_account
|
|
|
|
|
|
|
|
|
|
// sources
|
|
|
|
|
4: optional string iban // International Bank Account Number (ISO 13616)
|
|
|
|
|
|
|
|
|
|
// deprecated
|
|
|
|
|
1: optional string account_holder // we have `InternationalLegalEntity.legal_name` for that purpose
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InternationalBankDetails {
|
|
|
|
|
|
|
|
|
|
// common
|
|
|
|
|
1: optional string bic // Business Identifier Code (ISO 9362)
|
|
|
|
|
2: optional Residence country
|
|
|
|
|
3: optional string name
|
|
|
|
|
4: optional string address
|
|
|
|
|
|
|
|
|
|
// sources
|
|
|
|
|
5: optional string aba_rtn // ABA Routing Transit Number
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-10 11:00:35 +00:00
|
|
|
|
struct WalletInfo {
|
|
|
|
|
1: required WalletID wallet_id
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
union PrivateEntity {
|
|
|
|
|
1: RussianPrivateEntity russian_private_entity
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct RussianPrivateEntity {
|
|
|
|
|
1: required string first_name
|
|
|
|
|
2: required string second_name
|
|
|
|
|
3: required string middle_name
|
|
|
|
|
4: required ContactInfo contact_info
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
typedef base.ID PayoutToolID
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
struct PayoutTool {
|
|
|
|
|
1: required PayoutToolID id
|
2017-07-17 10:21:41 +00:00
|
|
|
|
4: required base.Timestamp created_at
|
2016-12-09 12:05:35 +00:00
|
|
|
|
2: required CurrencyRef currency
|
2017-01-20 09:16:31 +00:00
|
|
|
|
3: required PayoutToolInfo payout_tool_info
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
union PayoutToolInfo {
|
2018-01-19 13:44:26 +00:00
|
|
|
|
1: RussianBankAccount russian_bank_account
|
|
|
|
|
2: InternationalBankAccount international_bank_account
|
2018-12-10 11:00:35 +00:00
|
|
|
|
3: WalletInfo wallet_info
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
typedef base.ID ContractID
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
|
|
|
|
/** Договор */
|
|
|
|
|
struct Contract {
|
|
|
|
|
1: required ContractID id
|
2018-07-17 14:32:10 +00:00
|
|
|
|
14: optional ContractorID contractor_id
|
2018-01-19 13:44:26 +00:00
|
|
|
|
12: optional PaymentInstitutionRef payment_institution
|
2017-07-17 10:21:41 +00:00
|
|
|
|
11: required base.Timestamp created_at
|
2017-01-20 09:16:31 +00:00
|
|
|
|
4: optional base.Timestamp valid_since
|
|
|
|
|
5: optional base.Timestamp valid_until
|
|
|
|
|
6: required ContractStatus status
|
|
|
|
|
7: required TermSetHierarchyRef terms
|
|
|
|
|
8: required list<ContractAdjustment> adjustments
|
2018-07-17 14:32:10 +00:00
|
|
|
|
// TODO think about it
|
|
|
|
|
// looks like payout tools are a bit off here,
|
|
|
|
|
// maybe they should be directly in party
|
2017-01-20 09:16:31 +00:00
|
|
|
|
9: required list<PayoutTool> payout_tools
|
|
|
|
|
10: optional LegalAgreement legal_agreement
|
2018-05-16 13:03:37 +00:00
|
|
|
|
13: optional ReportPreferences report_preferences
|
2018-07-17 14:32:10 +00:00
|
|
|
|
// deprecated
|
|
|
|
|
3: optional Contractor contractor
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
/** Юридическое соглашение */
|
|
|
|
|
struct LegalAgreement {
|
|
|
|
|
1: required base.Timestamp signed_at
|
|
|
|
|
2: required string legal_agreement_id
|
2018-05-16 13:03:37 +00:00
|
|
|
|
3: optional base.Timestamp valid_until
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ReportPreferences {
|
|
|
|
|
1: optional ServiceAcceptanceActPreferences service_acceptance_act_preferences
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ServiceAcceptanceActPreferences {
|
|
|
|
|
1: required BusinessScheduleRef schedule
|
|
|
|
|
2: required Representative signer
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct Representative {
|
|
|
|
|
/* Наименование должности ЕИО/представителя */
|
|
|
|
|
1: required string position
|
|
|
|
|
/* ФИО ЕИО/представителя */
|
|
|
|
|
2: required string full_name
|
|
|
|
|
/* Документ, на основании которого действует ЕИО/представитель */
|
|
|
|
|
3: required RepresentativeDocument document
|
2017-01-20 09:16:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
union RepresentativeDocument {
|
|
|
|
|
1: ArticlesOfAssociation articles_of_association // устав
|
|
|
|
|
2: LegalAgreement power_of_attorney // доверенность
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ArticlesOfAssociation {}
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
union ContractStatus {
|
|
|
|
|
1: ContractActive active
|
|
|
|
|
2: ContractTerminated terminated
|
2017-07-17 10:21:41 +00:00
|
|
|
|
3: ContractExpired expired
|
2017-01-20 09:16:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractActive {}
|
|
|
|
|
struct ContractTerminated { 1: required base.Timestamp terminated_at }
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct ContractExpired {}
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
/* Categories */
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct CategoryRef { 1: required ObjectID id }
|
|
|
|
|
|
2016-10-20 10:47:12 +00:00
|
|
|
|
enum CategoryType {
|
|
|
|
|
test
|
|
|
|
|
live
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
/** Категория продаваемых товаров или услуг. */
|
|
|
|
|
struct Category {
|
|
|
|
|
1: required string name
|
2016-10-20 10:47:12 +00:00
|
|
|
|
2: required string description
|
|
|
|
|
3: optional CategoryType type = CategoryType.test
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
struct ContractTemplateRef { 1: required ObjectID id }
|
|
|
|
|
|
|
|
|
|
/** Шаблон договора или поправки **/
|
|
|
|
|
struct ContractTemplate {
|
2017-05-24 09:41:15 +00:00
|
|
|
|
4: optional string name
|
|
|
|
|
5: optional string description
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: optional Lifetime valid_since
|
|
|
|
|
2: optional Lifetime valid_until
|
|
|
|
|
3: required TermSetHierarchyRef terms
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union Lifetime {
|
|
|
|
|
1: base.Timestamp timestamp
|
2017-01-20 09:16:31 +00:00
|
|
|
|
2: LifetimeInterval interval
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
struct LifetimeInterval {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: optional i16 years
|
|
|
|
|
2: optional i16 months
|
|
|
|
|
3: optional i16 days
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
union ContractTemplateSelector {
|
|
|
|
|
1: list<ContractTemplateDecision> decisions
|
|
|
|
|
2: ContractTemplateRef value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractTemplateDecision {
|
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required ContractTemplateSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
/** Поправки к договору **/
|
2017-07-17 10:21:41 +00:00
|
|
|
|
typedef base.ID ContractAdjustmentID
|
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
struct ContractAdjustment {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: required ContractAdjustmentID id
|
|
|
|
|
5: required base.Timestamp created_at
|
2017-01-20 09:16:31 +00:00
|
|
|
|
2: optional base.Timestamp valid_since
|
|
|
|
|
3: optional base.Timestamp valid_until
|
|
|
|
|
4: required TermSetHierarchyRef terms
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Условия **/
|
|
|
|
|
// Service
|
|
|
|
|
// Payments
|
|
|
|
|
// Regular
|
|
|
|
|
// Held
|
|
|
|
|
// Recurring
|
|
|
|
|
// ...
|
|
|
|
|
// Payouts
|
|
|
|
|
// ...
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
struct TermSet {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: optional PaymentsServiceTerms payments
|
2017-11-22 10:21:20 +00:00
|
|
|
|
2: optional RecurrentPaytoolsServiceTerms recurrent_paytools
|
2018-02-26 12:14:59 +00:00
|
|
|
|
3: optional PayoutsServiceTerms payouts
|
2018-05-16 13:03:37 +00:00
|
|
|
|
4: optional ReportsServiceTerms reports
|
2018-07-17 14:32:10 +00:00
|
|
|
|
5: optional WalletServiceTerms wallets
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
struct TimedTermSet {
|
|
|
|
|
1: required base.TimestampInterval action_time
|
|
|
|
|
2: required TermSet terms
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct TermSetHierarchy {
|
2017-05-24 09:41:15 +00:00
|
|
|
|
3: optional string name
|
|
|
|
|
4: optional string description
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: optional TermSetHierarchyRef parent_terms
|
|
|
|
|
2: required list<TimedTermSet> term_sets
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct TermSetHierarchyRef { 1: required ObjectID id }
|
|
|
|
|
|
2017-11-22 10:21:20 +00:00
|
|
|
|
/* Payments service terms */
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
|
|
|
|
struct PaymentsServiceTerms {
|
|
|
|
|
/* Shop level */
|
2018-02-26 12:14:59 +00:00
|
|
|
|
// TODO It looks like you belong to the better place, something they call `AccountsServiceTerms`.
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: optional CurrencySelector currencies
|
|
|
|
|
2: optional CategorySelector categories
|
|
|
|
|
/* Invoice level*/
|
|
|
|
|
4: optional PaymentMethodSelector payment_methods
|
2016-12-14 11:09:57 +00:00
|
|
|
|
5: optional CashLimitSelector cash_limit
|
2016-12-09 12:05:35 +00:00
|
|
|
|
/* Payment level */
|
|
|
|
|
6: optional CashFlowSelector fees
|
2017-09-12 09:36:42 +00:00
|
|
|
|
9: optional PaymentHoldsServiceTerms holds
|
|
|
|
|
8: optional PaymentRefundsServiceTerms refunds
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
struct PaymentHoldsServiceTerms {
|
|
|
|
|
1: optional PaymentMethodSelector payment_methods
|
|
|
|
|
2: optional HoldLifetimeSelector lifetime
|
2019-02-22 08:05:25 +00:00
|
|
|
|
/* Allow partial capture if this undefined, otherwise throw exception */
|
|
|
|
|
3: optional PartialCaptureServiceTerms partial_captures
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-22 08:05:25 +00:00
|
|
|
|
struct PartialCaptureServiceTerms {}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
struct PaymentRefundsServiceTerms {
|
|
|
|
|
1: optional PaymentMethodSelector payment_methods
|
|
|
|
|
2: optional CashFlowSelector fees
|
2018-03-06 14:04:49 +00:00
|
|
|
|
3: optional TimeSpanSelector eligibility_time
|
|
|
|
|
4: optional PartialRefundsServiceTerms partial_refunds
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PartialRefundsServiceTerms {
|
|
|
|
|
1: optional CashLimitSelector cash_limit
|
2017-08-29 15:51:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
/* Recurrent payment tools service terms */
|
|
|
|
|
|
|
|
|
|
struct RecurrentPaytoolsServiceTerms {
|
|
|
|
|
1: optional PaymentMethodSelector payment_methods
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Payouts service terms */
|
|
|
|
|
|
|
|
|
|
struct PayoutsServiceTerms {
|
|
|
|
|
/* Payout schedule level */
|
2018-05-16 13:03:37 +00:00
|
|
|
|
4: optional BusinessScheduleSelector payout_schedules
|
2018-02-26 12:14:59 +00:00
|
|
|
|
/* Payout level */
|
|
|
|
|
1: optional PayoutMethodSelector payout_methods
|
|
|
|
|
2: optional CashLimitSelector cash_limit
|
|
|
|
|
3: optional CashFlowSelector fees
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
|
|
|
|
|
// legacy
|
2018-02-26 12:14:59 +00:00
|
|
|
|
struct PayoutCompilationPolicy {
|
|
|
|
|
1: required base.TimeSpan assets_freeze_for
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
/** Wallets service terms **/
|
|
|
|
|
|
|
|
|
|
struct WalletServiceTerms {
|
|
|
|
|
1: optional CurrencySelector currencies
|
2018-10-04 15:07:15 +00:00
|
|
|
|
2: optional CashLimitSelector wallet_limit
|
2018-07-17 14:32:10 +00:00
|
|
|
|
3: optional CumulativeLimitSelector turnover_limit
|
2018-10-04 15:07:15 +00:00
|
|
|
|
4: optional WithdrawalServiceTerms withdrawals
|
2018-07-17 14:32:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union CumulativeLimitSelector {
|
|
|
|
|
1: list<CumulativeLimitDecision> decisions
|
|
|
|
|
2: set<CumulativeLimit> value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CumulativeLimitDecision {
|
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required CumulativeLimitSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO think about abstracting period & cash to some union of diferend metrics & bounds
|
|
|
|
|
struct CumulativeLimit {
|
|
|
|
|
1: required CumulativeLimitPeriod period
|
|
|
|
|
2: required CashRange cash
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum CumulativeLimitPeriod {
|
|
|
|
|
today
|
|
|
|
|
this_week
|
|
|
|
|
this_month
|
|
|
|
|
this_year
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-04 15:07:15 +00:00
|
|
|
|
/** Withdrawal service terms **/
|
|
|
|
|
|
|
|
|
|
struct WithdrawalServiceTerms {
|
|
|
|
|
1: optional CurrencySelector currencies
|
|
|
|
|
2: optional CashLimitSelector cash_limit
|
|
|
|
|
3: optional CashFlowSelector cash_flow
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
/* Payout methods */
|
|
|
|
|
|
|
|
|
|
enum PayoutMethod {
|
|
|
|
|
russian_bank_account
|
|
|
|
|
international_bank_account
|
2018-12-10 11:00:35 +00:00
|
|
|
|
wallet_info
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PayoutMethodRef { 1: required PayoutMethod id }
|
|
|
|
|
|
|
|
|
|
/** Способ вывода, категория средства вывода. */
|
|
|
|
|
struct PayoutMethodDefinition {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: required string description
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union PayoutMethodSelector {
|
|
|
|
|
1: list<PayoutMethodDecision> decisions
|
|
|
|
|
2: set<PayoutMethodRef> value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PayoutMethodDecision {
|
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required PayoutMethodSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
/* Reports service terms */
|
|
|
|
|
struct ReportsServiceTerms {
|
|
|
|
|
1: optional ServiceAcceptanceActsTerms acts
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Service Acceptance Acts (Акты об оказании услуг) */
|
|
|
|
|
struct ServiceAcceptanceActsTerms {
|
|
|
|
|
1: optional BusinessScheduleSelector schedules
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/* Currencies */
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/** Символьный код, уникально идентифицирующий валюту. */
|
|
|
|
|
typedef string CurrencySymbolicCode
|
|
|
|
|
|
|
|
|
|
struct CurrencyRef { 1: required CurrencySymbolicCode symbolic_code }
|
|
|
|
|
|
|
|
|
|
/** Валюта. */
|
|
|
|
|
struct Currency {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: required CurrencySymbolicCode symbolic_code
|
|
|
|
|
3: required i16 numeric_code
|
|
|
|
|
4: required i16 exponent
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
union CurrencySelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<CurrencyDecision> decisions
|
2016-12-09 12:05:35 +00:00
|
|
|
|
2: set<CurrencyRef> value
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-13 17:23:13 +00:00
|
|
|
|
struct CurrencyDecision {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required CurrencySelector then_
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Категории */
|
|
|
|
|
|
|
|
|
|
union CategorySelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<CategoryDecision> decisions
|
2016-12-09 12:05:35 +00:00
|
|
|
|
2: set<CategoryRef> value
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-13 17:23:13 +00:00
|
|
|
|
struct CategoryDecision {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required CategorySelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
/* Резиденция */
|
|
|
|
|
// Для обозначения спользуется alpha-3 код по стандарту ISO_3166-1
|
|
|
|
|
// https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
|
|
|
|
|
|
|
|
|
enum Residence {
|
2019-07-02 09:46:01 +00:00
|
|
|
|
ABH = 0 /*Abkhazia*/
|
|
|
|
|
AUS = 1 /*Australia*/
|
|
|
|
|
AUT = 2 /*Austria*/
|
|
|
|
|
AZE = 3 /*Azerbaijan*/
|
|
|
|
|
ALB = 4 /*Albania*/
|
|
|
|
|
DZA = 5 /*Algeria*/
|
|
|
|
|
ASM = 6 /*American Samoa*/
|
|
|
|
|
AIA = 7 /*Anguilla*/
|
|
|
|
|
AGO = 8 /*Angola*/
|
|
|
|
|
AND = 9 /*Andorra*/
|
|
|
|
|
ATA = 10 /*Antarctica*/
|
|
|
|
|
ATG = 11 /*Antigua and Barbuda*/
|
|
|
|
|
ARG = 12 /*Argentina*/
|
|
|
|
|
ARM = 13 /*Armenia*/
|
|
|
|
|
ABW = 14 /*Aruba*/
|
|
|
|
|
AFG = 15 /*Afghanistan*/
|
|
|
|
|
BHS = 16 /*Bahamas*/
|
|
|
|
|
BGD = 17 /*Bangladesh*/
|
|
|
|
|
BRB = 18 /*Barbados*/
|
|
|
|
|
BHR = 19 /*Bahrain*/
|
|
|
|
|
BLR = 20 /*Belarus*/
|
|
|
|
|
BLZ = 21 /*Belize*/
|
|
|
|
|
BEL = 22 /*Belgium*/
|
|
|
|
|
BEN = 23 /*Benin*/
|
|
|
|
|
BMU = 24 /*Bermuda*/
|
|
|
|
|
BGR = 25 /*Bulgaria*/
|
|
|
|
|
BOL = 26 /*Bolivia, plurinational state of*/
|
|
|
|
|
BES = 27 /*Bonaire, Sint Eustatius and Saba*/
|
|
|
|
|
BIH = 28 /*Bosnia and Herzegovina*/
|
|
|
|
|
BWA = 29 /*Botswana*/
|
|
|
|
|
BRA = 30 /*Brazil*/
|
|
|
|
|
IOT = 31 /*British Indian Ocean Territory*/
|
|
|
|
|
BRN = 32 /*Brunei Darussalam*/
|
|
|
|
|
BFA = 33 /*Burkina Faso*/
|
|
|
|
|
BDI = 34 /*Burundi*/
|
|
|
|
|
BTN = 35 /*Bhutan*/
|
|
|
|
|
VUT = 36 /*Vanuatu*/
|
|
|
|
|
HUN = 37 /*Hungary*/
|
|
|
|
|
VEN = 38 /*Venezuela*/
|
|
|
|
|
VGB = 39 /*Virgin Islands, British*/
|
|
|
|
|
VIR = 40 /*Virgin Islands, U.S.*/
|
|
|
|
|
VNM = 41 /*Vietnam*/
|
|
|
|
|
GAB = 42 /*Gabon*/
|
|
|
|
|
HTI = 43 /*Haiti*/
|
|
|
|
|
GUY = 44 /*Guyana*/
|
|
|
|
|
GMB = 45 /*Gambia*/
|
|
|
|
|
GHA = 46 /*Ghana*/
|
|
|
|
|
GLP = 47 /*Guadeloupe*/
|
|
|
|
|
GTM = 48 /*Guatemala*/
|
|
|
|
|
GIN = 49 /*Guinea*/
|
|
|
|
|
GNB = 50 /*Guinea-Bissau*/
|
|
|
|
|
DEU = 51 /*Germany*/
|
|
|
|
|
GGY = 52 /*Guernsey*/
|
|
|
|
|
GIB = 53 /*Gibraltar*/
|
|
|
|
|
HND = 54 /*Honduras*/
|
|
|
|
|
HKG = 55 /*Hong Kong*/
|
|
|
|
|
GRD = 56 /*Grenada*/
|
|
|
|
|
GRL = 57 /*Greenland*/
|
|
|
|
|
GRC = 58 /*Greece*/
|
|
|
|
|
GEO = 59 /*Georgia*/
|
|
|
|
|
GUM = 60 /*Guam*/
|
|
|
|
|
DNK = 61 /*Denmark*/
|
|
|
|
|
JEY = 62 /*Jersey*/
|
|
|
|
|
DJI = 63 /*Djibouti*/
|
|
|
|
|
DMA = 64 /*Dominica*/
|
|
|
|
|
DOM = 65 /*Dominican Republic*/
|
|
|
|
|
EGY = 66 /*Egypt*/
|
|
|
|
|
ZMB = 67 /*Zambia*/
|
|
|
|
|
ESH = 68 /*Western Sahara*/
|
|
|
|
|
ZWE = 69 /*Zimbabwe*/
|
|
|
|
|
ISR = 70 /*Israel*/
|
|
|
|
|
IND = 71 /*India*/
|
|
|
|
|
IDN = 72 /*Indonesia*/
|
|
|
|
|
JOR = 73 /*Jordan*/
|
|
|
|
|
IRQ = 74 /*Iraq*/
|
|
|
|
|
IRN = 75 /*Iran, Islamic Republic of*/
|
|
|
|
|
IRL = 76 /*Ireland*/
|
|
|
|
|
ISL = 77 /*Iceland*/
|
|
|
|
|
ESP = 78 /*Spain*/
|
|
|
|
|
ITA = 79 /*Italy*/
|
|
|
|
|
YEM = 80 /*Yemen*/
|
|
|
|
|
CPV = 81 /*Cape Verde*/
|
|
|
|
|
KAZ = 82 /*Kazakhstan*/
|
|
|
|
|
KHM = 83 /*Cambodia*/
|
|
|
|
|
CMR = 84 /*Cameroon*/
|
|
|
|
|
CAN = 85 /*Canada*/
|
|
|
|
|
QAT = 86 /*Qatar*/
|
|
|
|
|
KEN = 87 /*Kenya*/
|
|
|
|
|
CYP = 88 /*Cyprus*/
|
|
|
|
|
KGZ = 89 /*Kyrgyzstan*/
|
|
|
|
|
KIR = 90 /*Kiribati*/
|
|
|
|
|
CHN = 91 /*China*/
|
|
|
|
|
CCK = 92 /*Cocos (Keeling) Islands*/
|
|
|
|
|
COL = 93 /*Colombia*/
|
|
|
|
|
COM = 94 /*Comoros*/
|
|
|
|
|
COG = 95 /*Congo*/
|
|
|
|
|
COD = 96 /*Congo, Democratic Republic of the*/
|
|
|
|
|
PRK = 97 /*Korea, Democratic People's republic of*/
|
|
|
|
|
KOR = 98 /*Korea, Republic of*/
|
|
|
|
|
CRI = 99 /*Costa Rica*/
|
|
|
|
|
CIV = 100 /*Cote d'Ivoire*/
|
|
|
|
|
CUB = 101 /*Cuba*/
|
|
|
|
|
KWT = 102 /*Kuwait*/
|
|
|
|
|
CUW = 103 /*Curaçao*/
|
|
|
|
|
LAO = 104 /*Lao People's Democratic Republic*/
|
|
|
|
|
LVA = 105 /*Latvia*/
|
|
|
|
|
LSO = 106 /*Lesotho*/
|
|
|
|
|
LBN = 107 /*Lebanon*/
|
|
|
|
|
LBY = 108 /*Libyan Arab Jamahiriya*/
|
|
|
|
|
LBR = 109 /*Liberia*/
|
|
|
|
|
LIE = 110 /*Liechtenstein*/
|
|
|
|
|
LTU = 111 /*Lithuania*/
|
|
|
|
|
LUX = 112 /*Luxembourg*/
|
|
|
|
|
MUS = 113 /*Mauritius*/
|
|
|
|
|
MRT = 114 /*Mauritania*/
|
|
|
|
|
MDG = 115 /*Madagascar*/
|
|
|
|
|
MYT = 116 /*Mayotte*/
|
|
|
|
|
MAC = 117 /*Macao*/
|
|
|
|
|
MWI = 118 /*Malawi*/
|
|
|
|
|
MYS = 119 /*Malaysia*/
|
|
|
|
|
MLI = 120 /*Mali*/
|
|
|
|
|
UMI = 121 /*United States Minor Outlying Islands*/
|
|
|
|
|
MDV = 122 /*Maldives*/
|
|
|
|
|
MLT = 123 /*Malta*/
|
|
|
|
|
MAR = 124 /*Morocco*/
|
|
|
|
|
MTQ = 125 /*Martinique*/
|
|
|
|
|
MHL = 126 /*Marshall Islands*/
|
|
|
|
|
MEX = 127 /*Mexico*/
|
|
|
|
|
FSM = 128 /*Micronesia, Federated States of*/
|
|
|
|
|
MOZ = 129 /*Mozambique*/
|
|
|
|
|
MDA = 130 /*Moldova*/
|
|
|
|
|
MCO = 131 /*Monaco*/
|
|
|
|
|
MNG = 132 /*Mongolia*/
|
|
|
|
|
MSR = 133 /*Montserrat*/
|
|
|
|
|
MMR = 134 /*Burma*/
|
|
|
|
|
NAM = 135 /*Namibia*/
|
|
|
|
|
NRU = 136 /*Nauru*/
|
|
|
|
|
NPL = 137 /*Nepal*/
|
|
|
|
|
NER = 138 /*Niger*/
|
|
|
|
|
NGA = 139 /*Nigeria*/
|
|
|
|
|
NLD = 140 /*Netherlands*/
|
|
|
|
|
NIC = 141 /*Nicaragua*/
|
|
|
|
|
NIU = 142 /*Niue*/
|
|
|
|
|
NZL = 143 /*New Zealand*/
|
|
|
|
|
NCL = 144 /*New Caledonia*/
|
|
|
|
|
NOR = 145 /*Norway*/
|
|
|
|
|
ARE = 146 /*United Arab Emirates*/
|
|
|
|
|
OMN = 147 /*Oman*/
|
|
|
|
|
BVT = 148 /*Bouvet Island*/
|
|
|
|
|
IMN = 149 /*Isle of Man*/
|
|
|
|
|
NFK = 150 /*Norfolk Island*/
|
|
|
|
|
CXR = 151 /*Christmas Island*/
|
|
|
|
|
HMD = 152 /*Heard Island and McDonald Islands*/
|
|
|
|
|
CYM = 153 /*Cayman Islands*/
|
|
|
|
|
COK = 154 /*Cook Islands*/
|
|
|
|
|
TCA = 155 /*Turks and Caicos Islands*/
|
|
|
|
|
PAK = 156 /*Pakistan*/
|
|
|
|
|
PLW = 157 /*Palau*/
|
|
|
|
|
PSE = 158 /*Palestinian Territory, Occupied*/
|
|
|
|
|
PAN = 159 /*Panama*/
|
|
|
|
|
VAT = 160 /*Holy See (Vatican City State)*/
|
|
|
|
|
PNG = 161 /*Papua New Guinea*/
|
|
|
|
|
PRY = 162 /*Paraguay*/
|
|
|
|
|
PER = 163 /*Peru*/
|
|
|
|
|
PCN = 164 /*Pitcairn*/
|
|
|
|
|
POL = 165 /*Poland*/
|
|
|
|
|
PRT = 166 /*Portugal*/
|
|
|
|
|
PRI = 167 /*Puerto Rico*/
|
|
|
|
|
MKD = 168 /*Macedonia, The Former Yugoslav Republic Of*/
|
|
|
|
|
REU = 169 /*Reunion*/
|
|
|
|
|
RUS = 170 /*Russian Federation*/
|
|
|
|
|
RWA = 171 /*Rwanda*/
|
|
|
|
|
ROU = 172 /*Romania*/
|
|
|
|
|
WSM = 173 /*Samoa*/
|
|
|
|
|
SMR = 174 /*San Marino*/
|
|
|
|
|
STP = 175 /*Sao Tome and Principe*/
|
|
|
|
|
SAU = 176 /*Saudi Arabia*/
|
|
|
|
|
SWZ = 177 /*Swaziland*/
|
|
|
|
|
SHN = 178 /*Saint Helena, Ascension And Tristan Da Cunha*/
|
|
|
|
|
MNP = 179 /*Northern Mariana Islands*/
|
|
|
|
|
BLM = 180 /*Saint Barthélemy*/
|
|
|
|
|
MAF = 181 /*Saint Martin (French Part)*/
|
|
|
|
|
SEN = 182 /*Senegal*/
|
|
|
|
|
VCT = 183 /*Saint Vincent and the Grenadines*/
|
|
|
|
|
KNA = 184 /*Saint Kitts and Nevis*/
|
|
|
|
|
LCA = 185 /*Saint Lucia*/
|
|
|
|
|
SPM = 186 /*Saint Pierre and Miquelon*/
|
|
|
|
|
SRB = 187 /*Serbia*/
|
|
|
|
|
SYC = 188 /*Seychelles*/
|
|
|
|
|
SGP = 189 /*Singapore*/
|
|
|
|
|
SXM = 190 /*Sint Maarten*/
|
|
|
|
|
SYR = 191 /*Syrian Arab Republic*/
|
|
|
|
|
SVK = 192 /*Slovakia*/
|
|
|
|
|
SVN = 193 /*Slovenia*/
|
|
|
|
|
GBR = 194 /*United Kingdom*/
|
|
|
|
|
USA = 195 /*United States*/
|
|
|
|
|
SLB = 196 /*Solomon Islands*/
|
|
|
|
|
SOM = 197 /*Somalia*/
|
|
|
|
|
SDN = 198 /*Sudan*/
|
|
|
|
|
SUR = 199 /*Suriname*/
|
|
|
|
|
SLE = 200 /*Sierra Leone*/
|
|
|
|
|
TJK = 201 /*Tajikistan*/
|
|
|
|
|
THA = 202 /*Thailand*/
|
|
|
|
|
TWN = 203 /*Taiwan, Province of China*/
|
|
|
|
|
TZA = 204 /*Tanzania, United Republic Of*/
|
|
|
|
|
TLS = 205 /*Timor-Leste*/
|
|
|
|
|
TGO = 206 /*Togo*/
|
|
|
|
|
TKL = 207 /*Tokelau*/
|
|
|
|
|
TON = 208 /*Tonga*/
|
|
|
|
|
TTO = 209 /*Trinidad and Tobago*/
|
|
|
|
|
TUV = 210 /*Tuvalu*/
|
|
|
|
|
TUN = 211 /*Tunisia*/
|
|
|
|
|
TKM = 212 /*Turkmenistan*/
|
|
|
|
|
TUR = 213 /*Turkey*/
|
|
|
|
|
UGA = 214 /*Uganda*/
|
|
|
|
|
UZB = 215 /*Uzbekistan*/
|
|
|
|
|
UKR = 216 /*Ukraine*/
|
|
|
|
|
WLF = 217 /*Wallis and Futuna*/
|
|
|
|
|
URY = 218 /*Uruguay*/
|
|
|
|
|
FRO = 219 /*Faroe Islands*/
|
|
|
|
|
FJI = 220 /*Fiji*/
|
|
|
|
|
PHL = 221 /*Philippines*/
|
|
|
|
|
FIN = 222 /*Finland*/
|
|
|
|
|
FLK = 223 /*Falkland Islands (Malvinas)*/
|
|
|
|
|
FRA = 224 /*France*/
|
|
|
|
|
GUF = 225 /*French Guiana*/
|
|
|
|
|
PYF = 226 /*French Polynesia*/
|
|
|
|
|
ATF = 227 /*French Southern Territories*/
|
|
|
|
|
HRV = 228 /*Croatia*/
|
|
|
|
|
CAF = 229 /*Central African Republic*/
|
|
|
|
|
TCD = 230 /*Chad*/
|
|
|
|
|
MNE = 231 /*Montenegro*/
|
|
|
|
|
CZE = 232 /*Czech Republic*/
|
|
|
|
|
CHL = 233 /*Chile*/
|
|
|
|
|
CHE = 234 /*Switzerland*/
|
|
|
|
|
SWE = 235 /*Sweden*/
|
|
|
|
|
SJM = 236 /*Svalbard and Jan Mayen*/
|
|
|
|
|
LKA = 237 /*Sri Lanka*/
|
|
|
|
|
ECU = 238 /*Ecuador*/
|
|
|
|
|
GNQ = 239 /*Equatorial Guinea*/
|
|
|
|
|
ALA = 240 /*Aland Islands*/
|
|
|
|
|
SLV = 241 /*El Salvador*/
|
|
|
|
|
ERI = 242 /*Eritrea*/
|
|
|
|
|
EST = 243 /*Estonia*/
|
|
|
|
|
ETH = 244 /*Ethiopia*/
|
|
|
|
|
ZAF = 245 /*South Africa*/
|
|
|
|
|
SGS = 246 /*South Georgia and the South Sandwich Islands*/
|
|
|
|
|
OST = 247 /*South Ossetia*/
|
|
|
|
|
SSD = 248 /*South Sudan*/
|
|
|
|
|
JAM = 249 /*Jamaica*/
|
|
|
|
|
JPN = 250 /*Japan*/
|
2018-01-19 13:44:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
/* Schedules */
|
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
struct BusinessScheduleRef { 1: required ObjectID id }
|
2018-02-26 12:14:59 +00:00
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
struct BusinessSchedule {
|
2018-02-26 12:14:59 +00:00
|
|
|
|
1: required string name
|
|
|
|
|
2: optional string description
|
|
|
|
|
3: required base.Schedule schedule
|
2018-05-16 13:03:37 +00:00
|
|
|
|
5: optional base.TimeSpan delay
|
|
|
|
|
// legacy
|
|
|
|
|
4: optional PayoutCompilationPolicy policy
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
union BusinessScheduleSelector {
|
|
|
|
|
1: list<BusinessScheduleDecision> decisions
|
|
|
|
|
2: set<BusinessScheduleRef> value
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
struct BusinessScheduleDecision {
|
2018-02-26 12:14:59 +00:00
|
|
|
|
1: required Predicate if_
|
2018-05-16 13:03:37 +00:00
|
|
|
|
2: required BusinessScheduleSelector then_
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Calendars */
|
|
|
|
|
|
|
|
|
|
struct CalendarRef { 1: required ObjectID id }
|
|
|
|
|
|
|
|
|
|
struct Calendar {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: optional string description
|
|
|
|
|
3: required base.Timezone timezone
|
|
|
|
|
4: required CalendarHolidaySet holidays
|
2018-05-16 13:03:37 +00:00
|
|
|
|
5: optional base.DayOfWeek first_day_of_week
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typedef map<base.Year, set<CalendarHoliday>> CalendarHolidaySet
|
|
|
|
|
|
|
|
|
|
struct CalendarHoliday {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: optional string description
|
|
|
|
|
3: required base.DayOfMonth day
|
|
|
|
|
4: required base.Month month
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/* Limits */
|
|
|
|
|
|
2017-02-01 10:38:33 +00:00
|
|
|
|
struct CashRange {
|
|
|
|
|
1: required CashBound upper
|
|
|
|
|
2: required CashBound lower
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
union CashBound {
|
|
|
|
|
1: Cash inclusive
|
|
|
|
|
2: Cash exclusive
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
union CashLimitSelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<CashLimitDecision> decisions
|
2017-02-01 10:38:33 +00:00
|
|
|
|
2: CashRange value
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
struct CashLimitDecision {
|
2016-10-10 13:14:58 +00:00
|
|
|
|
1: required Predicate if_
|
2016-12-14 11:09:57 +00:00
|
|
|
|
2: required CashLimitSelector then_
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Payment methods */
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
union PaymentMethod {
|
|
|
|
|
1: BankCardPaymentSystem bank_card
|
2017-08-17 11:53:40 +00:00
|
|
|
|
2: TerminalPaymentProvider payment_terminal
|
2018-01-24 13:14:35 +00:00
|
|
|
|
3: DigitalWalletProvider digital_wallet
|
2018-05-08 09:28:28 +00:00
|
|
|
|
4: TokenizedBankCard tokenized_bank_card
|
2019-02-19 09:07:27 +00:00
|
|
|
|
5: BankCardPaymentSystem empty_cvv_bank_card
|
2019-05-17 15:13:45 +00:00
|
|
|
|
6: CryptoCurrency crypto_currency
|
2019-07-19 15:48:38 +00:00
|
|
|
|
7: MobileOperator mobile
|
2018-05-08 09:28:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct TokenizedBankCard {
|
|
|
|
|
1: required BankCardPaymentSystem payment_system
|
|
|
|
|
2: required BankCardTokenProvider token_provider
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum BankCardPaymentSystem {
|
|
|
|
|
visa
|
|
|
|
|
mastercard
|
2016-10-20 10:44:47 +00:00
|
|
|
|
visaelectron
|
|
|
|
|
maestro
|
|
|
|
|
forbrugsforeningen
|
|
|
|
|
dankort
|
|
|
|
|
amex
|
|
|
|
|
dinersclub
|
|
|
|
|
discover
|
|
|
|
|
unionpay
|
|
|
|
|
jcb
|
|
|
|
|
nspkmir
|
2016-04-26 16:01:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-05-08 09:28:28 +00:00
|
|
|
|
/** Тип платежного токена **/
|
|
|
|
|
|
|
|
|
|
enum BankCardTokenProvider {
|
|
|
|
|
applepay
|
|
|
|
|
googlepay
|
|
|
|
|
samsungpay
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
typedef base.ID CustomerID
|
|
|
|
|
typedef base.ID CustomerBindingID
|
|
|
|
|
typedef base.ID RecurrentPaymentToolID
|
|
|
|
|
|
2016-04-26 16:01:04 +00:00
|
|
|
|
union PaymentTool {
|
|
|
|
|
1: BankCard bank_card
|
2017-08-11 09:01:10 +00:00
|
|
|
|
2: PaymentTerminal payment_terminal
|
2018-01-24 13:14:35 +00:00
|
|
|
|
3: DigitalWallet digital_wallet
|
2019-05-17 15:13:45 +00:00
|
|
|
|
4: CryptoCurrency crypto_currency
|
2019-07-01 10:50:00 +00:00
|
|
|
|
5: MobileCommerce mobile_commerce
|
2016-04-26 16:01:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct DisposablePaymentResource {
|
2018-09-26 11:55:10 +00:00
|
|
|
|
1: required PaymentTool payment_tool
|
|
|
|
|
2: optional PaymentSessionID payment_session_id
|
|
|
|
|
3: optional ClientInfo client_info
|
2017-10-23 12:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-26 12:06:07 +00:00
|
|
|
|
typedef string Token
|
|
|
|
|
|
|
|
|
|
struct BankCard {
|
|
|
|
|
1: required Token token
|
|
|
|
|
2: required BankCardPaymentSystem payment_system
|
|
|
|
|
3: required string bin
|
|
|
|
|
4: required string masked_pan
|
2018-05-08 09:28:28 +00:00
|
|
|
|
5: optional BankCardTokenProvider token_provider
|
2018-09-27 09:12:43 +00:00
|
|
|
|
6: optional Residence issuer_country
|
|
|
|
|
7: optional string bank_name
|
2018-09-27 14:27:52 +00:00
|
|
|
|
8: optional map<string, msgpack.Value> metadata
|
2019-02-19 09:07:27 +00:00
|
|
|
|
9: optional bool is_cvv_empty
|
2016-05-26 12:06:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-05-15 10:44:12 +00:00
|
|
|
|
struct CryptoWallet {
|
|
|
|
|
1: required string id // ID or wallet of the recipient in the third-party payment system
|
|
|
|
|
2: required CryptoCurrency crypto_currency
|
2019-07-15 10:06:53 +00:00
|
|
|
|
// A destination tag is a unique 9-digit figure assigned to each Ripple (XRP) account
|
|
|
|
|
3: optional string destination_tag
|
2019-05-15 10:44:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum CryptoCurrency {
|
|
|
|
|
bitcoin
|
|
|
|
|
litecoin
|
|
|
|
|
bitcoin_cash
|
|
|
|
|
ripple
|
|
|
|
|
ethereum
|
|
|
|
|
zcash
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-01 10:50:00 +00:00
|
|
|
|
struct MobileCommerce {
|
|
|
|
|
1: required MobileOperator operator
|
|
|
|
|
2: required MobilePhone phone
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum MobileOperator {
|
|
|
|
|
mts = 1
|
|
|
|
|
beeline = 2
|
|
|
|
|
megafone = 3
|
|
|
|
|
tele2 = 4
|
|
|
|
|
yota = 5
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Телефонный номер согласно (E.164 — рекомендация ITU-T)
|
|
|
|
|
* +79114363738
|
|
|
|
|
* cc = 7 - код страны(1-3 цифры)
|
|
|
|
|
* ctn = 9114363738 - 10-ти значный номер абонента(макс 12)
|
|
|
|
|
*/
|
|
|
|
|
struct MobilePhone {
|
|
|
|
|
1: required string cc
|
|
|
|
|
2: required string ctn
|
|
|
|
|
}
|
2019-05-15 10:44:12 +00:00
|
|
|
|
|
2017-08-11 09:01:10 +00:00
|
|
|
|
/** Платеж через терминал **/
|
|
|
|
|
struct PaymentTerminal {
|
|
|
|
|
1: required TerminalPaymentProvider terminal_type
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Вид платежного терминала
|
|
|
|
|
*
|
|
|
|
|
* например Евросеть
|
|
|
|
|
**/
|
|
|
|
|
enum TerminalPaymentProvider {
|
|
|
|
|
euroset
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-24 13:14:35 +00:00
|
|
|
|
typedef string DigitalWalletID
|
|
|
|
|
|
|
|
|
|
struct DigitalWallet {
|
|
|
|
|
1: required DigitalWalletProvider provider
|
|
|
|
|
2: required DigitalWalletID id
|
2019-06-20 14:34:58 +00:00
|
|
|
|
3: optional Token token
|
2018-01-24 13:14:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum DigitalWalletProvider {
|
|
|
|
|
qiwi
|
2018-07-17 14:32:10 +00:00
|
|
|
|
rbkmoney
|
2019-05-15 10:44:12 +00:00
|
|
|
|
yandex_money
|
2018-01-24 13:14:35 +00:00
|
|
|
|
}
|
2017-08-11 09:01:10 +00:00
|
|
|
|
|
2018-10-11 08:50:58 +00:00
|
|
|
|
struct BankRef { 1: required ObjectID id }
|
|
|
|
|
|
|
|
|
|
struct Bank {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: required string description
|
2018-10-12 13:24:58 +00:00
|
|
|
|
4: optional set<string> binbase_id_patterns
|
|
|
|
|
|
|
|
|
|
/* legacy */
|
|
|
|
|
3: required set<string> bins
|
2018-10-11 08:50:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct PaymentMethodRef { 1: required PaymentMethod id }
|
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
/** Способ платежа, категория платёжного средства. */
|
2016-04-26 16:01:04 +00:00
|
|
|
|
struct PaymentMethodDefinition {
|
2016-04-19 15:59:22 +00:00
|
|
|
|
1: required string name
|
2016-10-10 13:14:58 +00:00
|
|
|
|
2: required string description
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
union PaymentMethodSelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<PaymentMethodDecision> decisions
|
2016-10-10 13:14:58 +00:00
|
|
|
|
2: set<PaymentMethodRef> value
|
|
|
|
|
}
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-12-13 17:23:13 +00:00
|
|
|
|
struct PaymentMethodDecision {
|
2016-10-10 13:14:58 +00:00
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required PaymentMethodSelector then_
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-29 15:51:12 +00:00
|
|
|
|
/* Holds */
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
struct HoldLifetime {
|
|
|
|
|
1: required i32 seconds
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-29 15:51:12 +00:00
|
|
|
|
union HoldLifetimeSelector {
|
|
|
|
|
1: list<HoldLifetimeDecision> decisions
|
|
|
|
|
2: HoldLifetime value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct HoldLifetimeDecision {
|
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required HoldLifetimeSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-06 14:04:49 +00:00
|
|
|
|
/* Refunds */
|
|
|
|
|
|
|
|
|
|
union TimeSpanSelector {
|
|
|
|
|
1: list<TimeSpanDecision> decisions
|
|
|
|
|
2: base.TimeSpan value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct TimeSpanDecision {
|
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required TimeSpanSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/* Flows */
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
|
|
/* Cash flows */
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
/** Счёт в графе финансовых потоков. */
|
|
|
|
|
union CashFlowAccount {
|
|
|
|
|
1: MerchantCashFlowAccount merchant
|
|
|
|
|
2: ProviderCashFlowAccount provider
|
|
|
|
|
3: SystemCashFlowAccount system
|
|
|
|
|
4: ExternalCashFlowAccount external
|
2018-07-17 14:32:10 +00:00
|
|
|
|
5: WalletCashFlowAccount wallet
|
2016-10-17 14:27:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
enum MerchantCashFlowAccount {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Расчётный счёт:
|
|
|
|
|
* - учёт прибыли по платежам в магазине;
|
|
|
|
|
* - учёт возмещённых вознаграждений.
|
|
|
|
|
*/
|
|
|
|
|
settlement
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Счёт гарантийного депозита:
|
|
|
|
|
* - учёт средств для погашения реализовавшихся рисков по мерчанту.
|
|
|
|
|
*/
|
|
|
|
|
guarantee
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
/**
|
|
|
|
|
* Счёт выплаченных средств:
|
|
|
|
|
* - учёт средств выплаченных мерчанту.
|
|
|
|
|
*/
|
|
|
|
|
payout
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum ProviderCashFlowAccount {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Расчётный счёт:
|
|
|
|
|
* - учёт полученных средств;
|
|
|
|
|
* - учёт вознаграждений.
|
|
|
|
|
*/
|
|
|
|
|
settlement
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum SystemCashFlowAccount {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Расчётный счёт:
|
|
|
|
|
* - учёт полученных и возмещённых вознаграждений.
|
|
|
|
|
*/
|
|
|
|
|
settlement
|
|
|
|
|
|
2019-01-29 09:57:21 +00:00
|
|
|
|
/**
|
|
|
|
|
* Расчётный счёт:
|
|
|
|
|
* - проводки между внутренними участниками взаиморасчётов.
|
|
|
|
|
*/
|
|
|
|
|
subagent
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum ExternalCashFlowAccount {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Счёт поступлений:
|
|
|
|
|
* - учёт любых поступлений в систему извне.
|
|
|
|
|
*/
|
|
|
|
|
income
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Счёт выводов:
|
|
|
|
|
* - учёт любых выводов из системы вовне.
|
|
|
|
|
*/
|
|
|
|
|
outcome
|
|
|
|
|
|
|
|
|
|
}
|
2016-10-17 14:27:32 +00:00
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
enum WalletCashFlowAccount {
|
2018-10-15 12:49:08 +00:00
|
|
|
|
sender_source
|
|
|
|
|
sender_settlement
|
|
|
|
|
receiver_settlement
|
|
|
|
|
receiver_destination
|
2018-07-17 14:32:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-17 14:27:32 +00:00
|
|
|
|
enum CashFlowConstant {
|
2018-02-26 12:14:59 +00:00
|
|
|
|
operation_amount = 1
|
2016-10-17 14:27:32 +00:00
|
|
|
|
// ...
|
|
|
|
|
// TODO
|
2018-02-26 12:14:59 +00:00
|
|
|
|
|
|
|
|
|
/* deprecated */
|
|
|
|
|
// invoice_amount = 0
|
|
|
|
|
// payment_amount = 1
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
typedef map<CashFlowConstant, Cash> CashFlowContext
|
2016-10-10 13:14:58 +00:00
|
|
|
|
|
|
|
|
|
/** Граф финансовых потоков. */
|
|
|
|
|
typedef list<CashFlowPosting> CashFlow
|
|
|
|
|
|
|
|
|
|
/** Денежный поток между двумя участниками. */
|
|
|
|
|
struct CashFlowPosting {
|
|
|
|
|
1: required CashFlowAccount source
|
|
|
|
|
2: required CashFlowAccount destination
|
|
|
|
|
3: required CashVolume volume
|
2016-12-14 11:09:57 +00:00
|
|
|
|
4: optional string details
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Полностью вычисленный граф финансовых потоков с проводками всех участников. */
|
|
|
|
|
typedef list<FinalCashFlowPosting> FinalCashFlow
|
|
|
|
|
|
|
|
|
|
/** Вычисленный денежный поток между двумя участниками. */
|
|
|
|
|
struct FinalCashFlowPosting {
|
|
|
|
|
1: required FinalCashFlowAccount source
|
|
|
|
|
2: required FinalCashFlowAccount destination
|
|
|
|
|
3: required Cash volume
|
|
|
|
|
4: optional string details
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct FinalCashFlowAccount {
|
|
|
|
|
1: required CashFlowAccount account_type
|
|
|
|
|
2: required AccountID account_id
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/** Объём финансовой проводки. */
|
|
|
|
|
union CashVolume {
|
|
|
|
|
1: CashVolumeFixed fixed
|
|
|
|
|
2: CashVolumeShare share
|
2016-12-14 11:09:57 +00:00
|
|
|
|
3: CashVolumeProduct product
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/** Объём в абсолютных денежных единицах. */
|
|
|
|
|
struct CashVolumeFixed {
|
2016-12-14 11:09:57 +00:00
|
|
|
|
1: required Cash cash
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Объём в относительных единицах. */
|
|
|
|
|
struct CashVolumeShare {
|
|
|
|
|
1: required base.Rational parts
|
|
|
|
|
2: required CashFlowConstant of
|
2018-01-24 13:14:35 +00:00
|
|
|
|
3: optional RoundingMethod rounding_method
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Метод округления к целому числу. */
|
|
|
|
|
enum RoundingMethod {
|
|
|
|
|
/** https://en.wikipedia.org/wiki/Rounding#Round_half_towards_zero. */
|
|
|
|
|
round_half_towards_zero
|
|
|
|
|
/** https://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero. */
|
|
|
|
|
round_half_away_from_zero
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
/** Композиция различных объёмов. */
|
|
|
|
|
union CashVolumeProduct {
|
|
|
|
|
/** Минимальный из полученных объёмов. */
|
|
|
|
|
1: set<CashVolume> min_of
|
|
|
|
|
/** Максимальный из полученных объёмов. */
|
|
|
|
|
2: set<CashVolume> max_of
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
union CashFlowSelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<CashFlowDecision> decisions
|
2016-10-10 13:14:58 +00:00
|
|
|
|
2: CashFlow value
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-13 17:23:13 +00:00
|
|
|
|
struct CashFlowDecision {
|
2016-10-10 13:14:58 +00:00
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required CashFlowSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Providers */
|
|
|
|
|
|
|
|
|
|
struct ProviderRef { 1: required ObjectID id }
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct Provider {
|
2016-04-19 15:59:22 +00:00
|
|
|
|
1: required string name
|
2016-10-10 13:14:58 +00:00
|
|
|
|
2: required string description
|
|
|
|
|
3: required Proxy proxy
|
|
|
|
|
4: required TerminalSelector terminal
|
2017-01-19 13:32:22 +00:00
|
|
|
|
/* Счет для платажей принятых эквайеромв АБС*/
|
|
|
|
|
5: required string abs_account
|
2017-11-22 10:21:20 +00:00
|
|
|
|
6: optional PaymentsProvisionTerms payment_terms
|
|
|
|
|
8: optional RecurrentPaytoolsProvisionTerms recurrent_paytool_terms
|
2017-09-12 09:36:42 +00:00
|
|
|
|
7: optional ProviderAccountSet accounts = {}
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-30 12:37:51 +00:00
|
|
|
|
struct WithdrawalProviderRef { 1: required ObjectID id }
|
2018-12-26 17:27:44 +00:00
|
|
|
|
|
2019-01-30 12:37:51 +00:00
|
|
|
|
struct WithdrawalProvider {
|
2018-12-26 17:27:44 +00:00
|
|
|
|
1: required string name
|
|
|
|
|
2: optional string description
|
|
|
|
|
3: required Proxy proxy
|
|
|
|
|
4: optional string identity
|
2019-01-30 12:37:51 +00:00
|
|
|
|
5: optional WithdrawalProvisionTerms withdrawal_terms
|
2018-12-26 17:27:44 +00:00
|
|
|
|
6: optional ProviderAccountSet accounts = {}
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
struct PaymentsProvisionTerms {
|
2019-05-30 11:07:59 +00:00
|
|
|
|
1: optional CurrencySelector currencies
|
|
|
|
|
2: optional CategorySelector categories
|
|
|
|
|
3: optional PaymentMethodSelector payment_methods
|
|
|
|
|
6: optional CashLimitSelector cash_limit
|
|
|
|
|
4: optional CashFlowSelector cash_flow
|
2017-09-12 09:36:42 +00:00
|
|
|
|
5: optional PaymentHoldsProvisionTerms holds
|
|
|
|
|
7: optional PaymentRefundsProvisionTerms refunds
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PaymentHoldsProvisionTerms {
|
|
|
|
|
1: required HoldLifetimeSelector lifetime
|
2019-02-22 08:05:25 +00:00
|
|
|
|
/* Allow partial capture if this undefined, otherwise throw exception */
|
|
|
|
|
2: optional PartialCaptureProvisionTerms partial_captures
|
2017-09-12 09:36:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-22 08:05:25 +00:00
|
|
|
|
struct PartialCaptureProvisionTerms {}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
struct PaymentRefundsProvisionTerms {
|
|
|
|
|
1: required CashFlowSelector cash_flow
|
2018-03-06 14:04:49 +00:00
|
|
|
|
/**
|
|
|
|
|
* Условия для частичных рефандов.
|
|
|
|
|
*/
|
|
|
|
|
2: optional PartialRefundsProvisionTerms partial_refunds
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PartialRefundsProvisionTerms {
|
|
|
|
|
1: required CashLimitSelector cash_limit
|
2017-09-12 09:36:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-22 10:21:20 +00:00
|
|
|
|
struct RecurrentPaytoolsProvisionTerms {
|
|
|
|
|
1: required CashValueSelector cash_value
|
|
|
|
|
2: required CategorySelector categories
|
|
|
|
|
3: required PaymentMethodSelector payment_methods
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-30 12:37:51 +00:00
|
|
|
|
struct WithdrawalProvisionTerms {
|
2018-12-26 17:27:44 +00:00
|
|
|
|
1: required CurrencySelector currencies
|
|
|
|
|
2: required PayoutMethodSelector payout_methods
|
|
|
|
|
3: required CashLimitSelector cash_limit
|
|
|
|
|
4: required CashFlowSelector cash_flow
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-22 10:21:20 +00:00
|
|
|
|
union CashValueSelector {
|
|
|
|
|
1: list<CashValueDecision> decisions
|
|
|
|
|
2: Cash value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CashValueDecision {
|
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required CashValueSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
typedef map<CurrencyRef, ProviderAccount> ProviderAccountSet
|
|
|
|
|
|
|
|
|
|
struct ProviderAccount {
|
|
|
|
|
1: required AccountID settlement
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
union ProviderSelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<ProviderDecision> decisions
|
2016-10-10 13:14:58 +00:00
|
|
|
|
2: set<ProviderRef> value
|
|
|
|
|
}
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2016-12-13 17:23:13 +00:00
|
|
|
|
struct ProviderDecision {
|
2016-10-10 13:14:58 +00:00
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required ProviderSelector then_
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-30 12:37:51 +00:00
|
|
|
|
union WithdrawalProviderSelector {
|
|
|
|
|
1: list<WithdrawalProviderDecision> decisions
|
|
|
|
|
2: set<WithdrawalProviderRef> value
|
2018-12-26 17:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-30 12:37:51 +00:00
|
|
|
|
struct WithdrawalProviderDecision {
|
2018-12-26 17:27:44 +00:00
|
|
|
|
1: required Predicate if_
|
2019-01-30 12:37:51 +00:00
|
|
|
|
2: required WithdrawalProviderSelector then_
|
2018-12-26 17:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 13:03:31 +00:00
|
|
|
|
/** Inspectors */
|
|
|
|
|
|
|
|
|
|
struct InspectorRef { 1: required ObjectID id }
|
|
|
|
|
|
|
|
|
|
struct Inspector {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: required string description
|
|
|
|
|
3: required Proxy proxy
|
2018-08-02 10:53:49 +00:00
|
|
|
|
4: optional RiskScore fallback_risk_score
|
2016-12-09 13:03:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-02-01 10:38:33 +00:00
|
|
|
|
union InspectorSelector {
|
2017-02-03 13:16:37 +00:00
|
|
|
|
1: list<InspectorDecision> decisions
|
2017-02-01 10:38:33 +00:00
|
|
|
|
2: InspectorRef value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InspectorDecision {
|
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required InspectorSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/**
|
|
|
|
|
* Обобщённый терминал у провайдера.
|
|
|
|
|
*
|
|
|
|
|
* Представляет собой единицу предоставления услуг по процессингу платежей со
|
|
|
|
|
* стороны провайдера, согласно нашим с ним договорённостям.
|
|
|
|
|
*/
|
|
|
|
|
struct Terminal {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: required string description
|
2016-12-13 17:23:13 +00:00
|
|
|
|
9: optional ProxyOptions options
|
2016-12-09 13:03:31 +00:00
|
|
|
|
10: required RiskScore risk_coverage
|
2019-05-22 10:26:49 +00:00
|
|
|
|
12: optional PaymentsProvisionTerms terms
|
2016-06-02 11:38:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
union TerminalSelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<TerminalDecision> decisions
|
2019-06-24 13:45:43 +00:00
|
|
|
|
2: set<ProviderTerminalRef> value
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-13 17:23:13 +00:00
|
|
|
|
struct TerminalDecision {
|
2016-10-10 13:14:58 +00:00
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required TerminalSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-24 13:45:43 +00:00
|
|
|
|
struct ProviderTerminalRef {
|
|
|
|
|
1: required ObjectID id
|
|
|
|
|
2: optional i64 priority = 1000
|
2019-07-09 13:20:25 +00:00
|
|
|
|
3: optional i64 weight
|
2019-06-24 13:45:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct TerminalRef {
|
|
|
|
|
1: required ObjectID id
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/* Predicates / conditions */
|
|
|
|
|
|
|
|
|
|
union Predicate {
|
2017-02-01 10:38:33 +00:00
|
|
|
|
5: bool constant
|
2016-10-10 13:14:58 +00:00
|
|
|
|
1: Condition condition
|
|
|
|
|
2: Predicate is_not
|
|
|
|
|
3: set<Predicate> all_of
|
|
|
|
|
4: set<Predicate> any_of
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union Condition {
|
|
|
|
|
1: CategoryRef category_is
|
|
|
|
|
2: CurrencyRef currency_is
|
2017-02-01 10:38:33 +00:00
|
|
|
|
4: CashRange cost_in
|
2016-12-13 17:23:13 +00:00
|
|
|
|
3: PaymentToolCondition payment_tool
|
2017-02-01 10:38:33 +00:00
|
|
|
|
5: ShopLocation shop_location_is
|
|
|
|
|
6: PartyCondition party
|
2018-02-26 12:14:59 +00:00
|
|
|
|
7: PayoutMethodRef payout_method_is
|
2018-07-17 14:32:10 +00:00
|
|
|
|
8: ContractorIdentificationLevel identification_level_is
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union PaymentToolCondition {
|
2016-12-13 17:23:13 +00:00
|
|
|
|
1: BankCardCondition bank_card
|
2018-01-24 13:14:35 +00:00
|
|
|
|
2: PaymentTerminalCondition payment_terminal
|
|
|
|
|
3: DigitalWalletCondition digital_wallet
|
2019-05-21 14:21:25 +00:00
|
|
|
|
4: CryptoCurrencyCondition crypto_currency
|
2019-07-01 10:50:00 +00:00
|
|
|
|
5: MobileCommerceCondition mobile_commerce
|
2018-01-24 13:14:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct BankCardCondition {
|
|
|
|
|
3: optional BankCardConditionDefinition definition
|
2016-12-13 17:23:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-01-24 13:14:35 +00:00
|
|
|
|
union BankCardConditionDefinition {
|
2018-05-08 09:28:28 +00:00
|
|
|
|
1: BankCardPaymentSystem payment_system_is // deprecated
|
2018-10-12 13:24:58 +00:00
|
|
|
|
2: BankRef issuer_bank_is
|
2018-05-08 09:28:28 +00:00
|
|
|
|
3: PaymentSystemCondition payment_system
|
2018-10-04 09:30:40 +00:00
|
|
|
|
4: Residence issuer_country_is
|
2019-02-19 09:07:27 +00:00
|
|
|
|
5: bool empty_cvv_is
|
2018-05-08 09:28:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PaymentSystemCondition {
|
|
|
|
|
1: required BankCardPaymentSystem payment_system_is
|
|
|
|
|
2: optional BankCardTokenProvider token_provider_is
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-01-24 13:14:35 +00:00
|
|
|
|
struct PaymentTerminalCondition {
|
|
|
|
|
1: optional PaymentTerminalConditionDefinition definition
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union PaymentTerminalConditionDefinition {
|
|
|
|
|
1: TerminalPaymentProvider provider_is
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct DigitalWalletCondition {
|
|
|
|
|
1: optional DigitalWalletConditionDefinition definition
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union DigitalWalletConditionDefinition {
|
|
|
|
|
1: DigitalWalletProvider provider_is
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-21 14:21:25 +00:00
|
|
|
|
struct CryptoCurrencyCondition {
|
|
|
|
|
1: optional CryptoCurrencyConditionDefinition definition
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union CryptoCurrencyConditionDefinition {
|
|
|
|
|
1: CryptoCurrency crypto_currency_is
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-01 10:50:00 +00:00
|
|
|
|
struct MobileCommerceCondition {
|
|
|
|
|
1: optional MobileCommerceConditionDefinition definition
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union MobileCommerceConditionDefinition {
|
|
|
|
|
1: MobileOperator operator_is
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-01 10:38:33 +00:00
|
|
|
|
struct PartyCondition {
|
|
|
|
|
1: required PartyID id
|
|
|
|
|
2: optional PartyConditionDefinition definition
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union PartyConditionDefinition {
|
|
|
|
|
1: ShopID shop_is
|
2018-07-17 14:32:10 +00:00
|
|
|
|
2: WalletID wallet_is
|
2017-02-01 10:38:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/* Proxies */
|
|
|
|
|
|
|
|
|
|
typedef base.StringMap ProxyOptions
|
|
|
|
|
|
2016-06-02 11:38:27 +00:00
|
|
|
|
struct ProxyRef { 1: required ObjectID id }
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct ProxyDefinition {
|
2016-12-13 17:23:13 +00:00
|
|
|
|
1: required string name
|
|
|
|
|
2: required string description
|
|
|
|
|
3: required string url
|
|
|
|
|
4: required ProxyOptions options
|
2016-10-10 13:14:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct Proxy {
|
2016-06-02 11:38:27 +00:00
|
|
|
|
1: required ProxyRef ref
|
2017-01-13 14:24:47 +00:00
|
|
|
|
2: required ProxyOptions additional
|
2016-06-02 11:38:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-17 14:27:32 +00:00
|
|
|
|
/* System accounts */
|
|
|
|
|
|
|
|
|
|
struct SystemAccountSetRef { 1: required ObjectID id }
|
|
|
|
|
|
|
|
|
|
struct SystemAccountSet {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: required string description
|
2016-12-14 11:09:57 +00:00
|
|
|
|
3: required map<CurrencyRef, SystemAccount> accounts
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct SystemAccount {
|
|
|
|
|
1: required AccountID settlement
|
2019-01-29 09:57:21 +00:00
|
|
|
|
2: optional AccountID subagent
|
2016-10-17 14:27:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union SystemAccountSetSelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<SystemAccountSetDecision> decisions
|
2016-12-14 11:09:57 +00:00
|
|
|
|
2: SystemAccountSetRef value
|
2016-10-17 14:27:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-13 17:23:13 +00:00
|
|
|
|
struct SystemAccountSetDecision {
|
2016-10-17 14:27:32 +00:00
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required SystemAccountSetSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
/* External accounts */
|
|
|
|
|
|
|
|
|
|
struct ExternalAccountSetRef { 1: required ObjectID id }
|
|
|
|
|
|
|
|
|
|
struct ExternalAccountSet {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: required string description
|
|
|
|
|
3: required map<CurrencyRef, ExternalAccount> accounts
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ExternalAccount {
|
|
|
|
|
1: required AccountID income
|
|
|
|
|
2: required AccountID outcome
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ExternalAccountSetSelector {
|
2017-01-20 09:16:31 +00:00
|
|
|
|
1: list<ExternalAccountSetDecision> decisions
|
2016-12-14 11:09:57 +00:00
|
|
|
|
2: ExternalAccountSetRef value
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 14:33:44 +00:00
|
|
|
|
struct ExternalAccountSetDecision {
|
2016-12-14 11:09:57 +00:00
|
|
|
|
1: required Predicate if_
|
|
|
|
|
2: required ExternalAccountSetSelector then_
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
/* Payment institution */
|
|
|
|
|
|
|
|
|
|
struct PaymentInstitutionRef { 1: required ObjectID id }
|
|
|
|
|
|
|
|
|
|
struct PaymentInstitution {
|
|
|
|
|
1: required string name
|
|
|
|
|
2: optional string description
|
2018-02-26 12:14:59 +00:00
|
|
|
|
9: optional CalendarRef calendar
|
2018-01-19 13:44:26 +00:00
|
|
|
|
3: required SystemAccountSetSelector system_account_set
|
|
|
|
|
4: required ContractTemplateSelector default_contract_template
|
2018-07-17 14:32:10 +00:00
|
|
|
|
10: optional ContractTemplateSelector default_wallet_contract_template
|
2018-01-19 13:44:26 +00:00
|
|
|
|
5: required ProviderSelector providers
|
|
|
|
|
6: required InspectorSelector inspector
|
|
|
|
|
7: required PaymentInstitutionRealm realm
|
|
|
|
|
8: required set<Residence> residences
|
2018-12-26 17:27:44 +00:00
|
|
|
|
/* TODO: separated system accounts for wallets look weird */
|
|
|
|
|
11: optional SystemAccountSetSelector wallet_system_account_set
|
|
|
|
|
12: optional string identity
|
2019-01-30 12:37:51 +00:00
|
|
|
|
13: optional WithdrawalProviderSelector withdrawal_providers
|
2018-01-19 13:44:26 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum PaymentInstitutionRealm {
|
|
|
|
|
test
|
|
|
|
|
live
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractPaymentInstitutionDefaults {
|
|
|
|
|
1: required PaymentInstitutionRef test
|
|
|
|
|
2: required PaymentInstitutionRef live
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-18 12:18:13 +00:00
|
|
|
|
/* legacy */
|
|
|
|
|
/* TODO rework (de)serializer to handle those cases more politely and then remove */
|
|
|
|
|
|
|
|
|
|
struct PartyPrototypeRef { 1: required ObjectID id }
|
|
|
|
|
|
|
|
|
|
struct PartyPrototype {}
|
|
|
|
|
|
|
|
|
|
struct PartyPrototypeObject {
|
|
|
|
|
1: required PartyPrototypeRef ref
|
|
|
|
|
2: required PartyPrototype data
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
/* Root config */
|
|
|
|
|
|
|
|
|
|
struct GlobalsRef {}
|
|
|
|
|
|
|
|
|
|
struct Globals {
|
2018-01-19 13:44:26 +00:00
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
4: required ExternalAccountSetSelector external_account_set
|
2018-01-19 13:44:26 +00:00
|
|
|
|
8: optional set<PaymentInstitutionRef> payment_institutions
|
|
|
|
|
42: optional ContractPaymentInstitutionDefaults contract_payment_institution_defaults
|
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-08 12:07:07 +00:00
|
|
|
|
/** Dummy (for integrity test purpose) */
|
|
|
|
|
struct Dummy {}
|
|
|
|
|
|
|
|
|
|
struct DummyRef {
|
|
|
|
|
1: base.ID id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct DummyObject {
|
|
|
|
|
1: DummyRef ref
|
|
|
|
|
2: Dummy data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct DummyLink {
|
|
|
|
|
1: DummyRef link
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct DummyLinkRef {
|
|
|
|
|
1: base.ID id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct DummyLinkObject {
|
|
|
|
|
1: DummyLinkRef ref
|
|
|
|
|
2: DummyLink data
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
/* Type enumerations */
|
2018-02-26 12:14:59 +00:00
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
struct ContractTemplateObject {
|
|
|
|
|
1: required ContractTemplateRef ref
|
|
|
|
|
2: required ContractTemplate data
|
|
|
|
|
}
|
2016-04-19 15:59:22 +00:00
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
struct TermSetHierarchyObject {
|
|
|
|
|
1: required TermSetHierarchyRef ref
|
|
|
|
|
2: required TermSetHierarchy data
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct CategoryObject {
|
|
|
|
|
1: required CategoryRef ref
|
|
|
|
|
2: required Category data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CurrencyObject {
|
|
|
|
|
1: required CurrencyRef ref
|
|
|
|
|
2: required Currency data
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-16 13:03:37 +00:00
|
|
|
|
struct BusinessScheduleObject {
|
|
|
|
|
1: required BusinessScheduleRef ref
|
|
|
|
|
2: required BusinessSchedule data
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CalendarObject {
|
|
|
|
|
1: required CalendarRef ref
|
|
|
|
|
2: required Calendar data
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct PaymentMethodObject {
|
|
|
|
|
1: required PaymentMethodRef ref
|
|
|
|
|
2: required PaymentMethodDefinition data
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
struct PayoutMethodObject {
|
|
|
|
|
1: required PayoutMethodRef ref
|
|
|
|
|
2: required PayoutMethodDefinition data
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-11 08:50:58 +00:00
|
|
|
|
struct BankObject {
|
|
|
|
|
1: required BankRef ref
|
|
|
|
|
2: required Bank data
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct ProviderObject {
|
|
|
|
|
1: required ProviderRef ref
|
|
|
|
|
2: required Provider data
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-30 12:37:51 +00:00
|
|
|
|
struct WithdrawalProviderObject {
|
|
|
|
|
1: required WithdrawalProviderRef ref
|
|
|
|
|
2: required WithdrawalProvider data
|
2018-12-26 17:27:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct TerminalObject {
|
|
|
|
|
1: required TerminalRef ref
|
|
|
|
|
2: required Terminal data
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 13:03:31 +00:00
|
|
|
|
struct InspectorObject {
|
|
|
|
|
1: required InspectorRef ref
|
|
|
|
|
2: required Inspector data
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
struct PaymentInstitutionObject {
|
|
|
|
|
1: required PaymentInstitutionRef ref
|
|
|
|
|
2: required PaymentInstitution data
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-17 14:27:32 +00:00
|
|
|
|
struct SystemAccountSetObject {
|
|
|
|
|
1: required SystemAccountSetRef ref
|
|
|
|
|
2: required SystemAccountSet data
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
struct ExternalAccountSetObject {
|
|
|
|
|
1: required ExternalAccountSetRef ref
|
|
|
|
|
2: required ExternalAccountSet data
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-10 13:14:58 +00:00
|
|
|
|
struct ProxyObject {
|
|
|
|
|
1: required ProxyRef ref
|
|
|
|
|
2: required ProxyDefinition data
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct GlobalsObject {
|
|
|
|
|
1: required GlobalsRef ref
|
|
|
|
|
2: required Globals data
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-19 15:59:22 +00:00
|
|
|
|
union Reference {
|
2016-10-10 13:14:58 +00:00
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
1 : CategoryRef category
|
|
|
|
|
2 : CurrencyRef currency
|
2018-05-16 13:03:37 +00:00
|
|
|
|
19 : BusinessScheduleRef business_schedule
|
2018-02-26 12:14:59 +00:00
|
|
|
|
20 : CalendarRef calendar
|
2016-12-14 11:09:57 +00:00
|
|
|
|
3 : PaymentMethodRef payment_method
|
2018-02-26 12:14:59 +00:00
|
|
|
|
21 : PayoutMethodRef payout_method
|
2018-10-12 13:24:58 +00:00
|
|
|
|
5 : BankRef bank
|
2016-12-14 11:09:57 +00:00
|
|
|
|
6 : ContractTemplateRef contract_template
|
2017-01-20 09:16:31 +00:00
|
|
|
|
17 : TermSetHierarchyRef term_set_hierarchy
|
2018-01-19 13:44:26 +00:00
|
|
|
|
18 : PaymentInstitutionRef payment_institution
|
2016-12-14 11:09:57 +00:00
|
|
|
|
7 : ProviderRef provider
|
|
|
|
|
8 : TerminalRef terminal
|
|
|
|
|
15 : InspectorRef inspector
|
|
|
|
|
14 : SystemAccountSetRef system_account_set
|
|
|
|
|
16 : ExternalAccountSetRef external_account_set
|
|
|
|
|
9 : ProxyRef proxy
|
|
|
|
|
11 : GlobalsRef globals
|
2019-01-30 12:37:51 +00:00
|
|
|
|
22 : WithdrawalProviderRef withdrawal_provider
|
2016-10-10 13:14:58 +00:00
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
12 : DummyRef dummy
|
|
|
|
|
13 : DummyLinkRef dummy_link
|
2018-07-18 12:18:13 +00:00
|
|
|
|
|
|
|
|
|
/* legacy */
|
|
|
|
|
10 : PartyPrototypeRef party_prototype
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-05-26 12:06:07 +00:00
|
|
|
|
union DomainObject {
|
2016-10-10 13:14:58 +00:00
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
1 : CategoryObject category
|
|
|
|
|
2 : CurrencyObject currency
|
2018-05-16 13:03:37 +00:00
|
|
|
|
19 : BusinessScheduleObject business_schedule
|
2018-02-26 12:14:59 +00:00
|
|
|
|
20 : CalendarObject calendar
|
2016-12-14 11:09:57 +00:00
|
|
|
|
3 : PaymentMethodObject payment_method
|
2018-02-26 12:14:59 +00:00
|
|
|
|
21 : PayoutMethodObject payout_method
|
2018-10-12 13:24:58 +00:00
|
|
|
|
5 : BankObject bank
|
2016-12-14 11:09:57 +00:00
|
|
|
|
6 : ContractTemplateObject contract_template
|
2017-01-20 09:16:31 +00:00
|
|
|
|
17 : TermSetHierarchyObject term_set_hierarchy
|
2018-01-19 13:44:26 +00:00
|
|
|
|
18 : PaymentInstitutionObject payment_institution
|
2016-12-14 11:09:57 +00:00
|
|
|
|
7 : ProviderObject provider
|
|
|
|
|
8 : TerminalObject terminal
|
|
|
|
|
15 : InspectorObject inspector
|
|
|
|
|
14 : SystemAccountSetObject system_account_set
|
|
|
|
|
16 : ExternalAccountSetObject external_account_set
|
|
|
|
|
9 : ProxyObject proxy
|
|
|
|
|
11 : GlobalsObject globals
|
2019-01-30 12:37:51 +00:00
|
|
|
|
22 : WithdrawalProviderObject withdrawal_provider
|
2016-12-14 11:09:57 +00:00
|
|
|
|
|
|
|
|
|
12 : DummyObject dummy
|
|
|
|
|
13 : DummyLinkObject dummy_link
|
2018-07-18 12:18:13 +00:00
|
|
|
|
|
|
|
|
|
/* legacy */
|
|
|
|
|
10 : PartyPrototypeObject party_prototype
|
2016-04-19 15:59:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Domain */
|
|
|
|
|
|
2016-05-26 12:06:07 +00:00
|
|
|
|
typedef map<Reference, DomainObject> Domain
|