2016-05-20 16:31:53 +00:00
|
|
|
|
/**
|
|
|
|
|
* Определения и сервисы процессинга.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
include "base.thrift"
|
|
|
|
|
include "domain.thrift"
|
2016-09-23 20:54:14 +00:00
|
|
|
|
include "user_interaction.thrift"
|
2019-02-22 15:08:13 +00:00
|
|
|
|
include "repairing.thrift"
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
namespace java com.rbkmoney.damsel.payment_processing
|
|
|
|
|
namespace erlang payproc
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
/* Interface clients */
|
|
|
|
|
|
|
|
|
|
typedef base.ID UserID
|
|
|
|
|
|
|
|
|
|
struct UserInfo {
|
|
|
|
|
1: required UserID id
|
2017-01-13 11:44:56 +00:00
|
|
|
|
2: required UserType type
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-13 11:44:56 +00:00
|
|
|
|
/* Временная замена ролям пользователей для разграничения доступа в HG */
|
|
|
|
|
union UserType {
|
|
|
|
|
1: InternalUser internal_user
|
|
|
|
|
2: ExternalUser external_user
|
|
|
|
|
3: ServiceUser service_user
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InternalUser {}
|
|
|
|
|
|
|
|
|
|
struct ExternalUser {}
|
|
|
|
|
|
|
|
|
|
struct ServiceUser {}
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
/* Events */
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
typedef list<Event> Events
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие, атомарный фрагмент истории бизнес-объекта, например инвойса.
|
|
|
|
|
*/
|
2016-05-20 16:31:53 +00:00
|
|
|
|
struct Event {
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Идентификатор события.
|
|
|
|
|
* Монотонно возрастающее целочисленное значение, таким образом на множестве
|
|
|
|
|
* событий задаётся отношение полного порядка (total order).
|
|
|
|
|
*/
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: required base.EventID id
|
2016-06-21 15:45:09 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Время создания события.
|
|
|
|
|
*/
|
|
|
|
|
2: required base.Timestamp created_at
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Идентификатор бизнес-объекта, источника события.
|
|
|
|
|
*/
|
2017-07-17 10:21:41 +00:00
|
|
|
|
3: required EventSource source
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2017-07-17 10:21:41 +00:00
|
|
|
|
* Содержание события, состоящее из списка (возможно пустого)
|
|
|
|
|
* изменений состояния бизнес-объекта, источника события.
|
2016-06-16 15:07:06 +00:00
|
|
|
|
*/
|
2017-07-17 10:21:41 +00:00
|
|
|
|
4: required EventPayload payload
|
2018-11-12 12:27:03 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Идентификатор события в рамках одной машины.
|
|
|
|
|
* Монотонно возрастающее целочисленное значение.
|
|
|
|
|
*/
|
|
|
|
|
5: optional base.SequenceID sequence
|
2016-06-16 15:07:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Источник события, идентификатор бизнес-объекта, который породил его в
|
|
|
|
|
* процессе выполнения определённого бизнес-процесса.
|
|
|
|
|
*/
|
|
|
|
|
union EventSource {
|
|
|
|
|
/** Идентификатор инвойса, который породил событие. */
|
2017-07-26 10:32:38 +00:00
|
|
|
|
1: domain.InvoiceID invoice_id
|
2016-08-11 11:07:40 +00:00
|
|
|
|
/** Идентификатор участника, который породил событие. */
|
2017-07-26 10:32:38 +00:00
|
|
|
|
2: domain.PartyID party_id
|
|
|
|
|
/** Идентификатор шаблона инвойса, который породил событие. */
|
|
|
|
|
3: domain.InvoiceTemplateID invoice_template_id
|
2017-10-23 12:00:48 +00:00
|
|
|
|
/** Идентификатор плательщика, который породил событие. */
|
2018-01-19 13:44:26 +00:00
|
|
|
|
4: domain.CustomerID customer_id
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов содержания события.
|
|
|
|
|
*/
|
|
|
|
|
union EventPayload {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/** Набор изменений, порождённых инвойсом. */
|
2017-07-26 10:32:38 +00:00
|
|
|
|
1: list<InvoiceChange> invoice_changes
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/** Набор изменений, порождённых участником. */
|
2017-07-26 10:32:38 +00:00
|
|
|
|
2: list<PartyChange> party_changes
|
|
|
|
|
/** Набор изменений, порождённых шаблоном инвойса. */
|
|
|
|
|
3: list<InvoiceTemplateChange> invoice_template_changes
|
2017-10-23 12:00:48 +00:00
|
|
|
|
/** Некоторое событие, порождённое плательщиком. */
|
|
|
|
|
4: list<CustomerChange> customer_changes
|
2016-06-16 15:07:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов события, порождённого инвойсом.
|
|
|
|
|
*/
|
2017-07-17 10:21:41 +00:00
|
|
|
|
union InvoiceChange {
|
2016-06-16 15:07:06 +00:00
|
|
|
|
1: InvoiceCreated invoice_created
|
|
|
|
|
2: InvoiceStatusChanged invoice_status_changed
|
2017-07-17 10:21:41 +00:00
|
|
|
|
3: InvoicePaymentChange invoice_payment_change
|
2016-06-16 15:07:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-26 10:32:38 +00:00
|
|
|
|
union InvoiceTemplateChange {
|
|
|
|
|
1: InvoiceTemplateCreated invoice_template_created
|
|
|
|
|
2: InvoiceTemplateUpdated invoice_template_updated
|
|
|
|
|
3: InvoiceTemplateDeleted invoice_template_deleted
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие о создании нового инвойса.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoiceCreated {
|
|
|
|
|
/** Данные созданного инвойса. */
|
2016-05-20 16:31:53 +00:00
|
|
|
|
1: required domain.Invoice invoice
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении статуса инвойса.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoiceStatusChanged {
|
|
|
|
|
/** Новый статус инвойса. */
|
|
|
|
|
1: required domain.InvoiceStatus status
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие, касающееся определённого платежа по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentChange {
|
|
|
|
|
1: required domain.InvoicePaymentID id
|
|
|
|
|
2: required InvoicePaymentChangePayload payload
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов события, порождённого платежом по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
union InvoicePaymentChangePayload {
|
2019-08-01 09:37:38 +00:00
|
|
|
|
1: InvoicePaymentStarted invoice_payment_started
|
|
|
|
|
8: InvoicePaymentRiskScoreChanged invoice_payment_risk_score_changed
|
|
|
|
|
9: InvoicePaymentRouteChanged invoice_payment_route_changed
|
|
|
|
|
10: InvoicePaymentCashFlowChanged invoice_payment_cash_flow_changed
|
|
|
|
|
3: InvoicePaymentStatusChanged invoice_payment_status_changed
|
|
|
|
|
2: InvoicePaymentSessionChange invoice_payment_session_change
|
|
|
|
|
7: InvoicePaymentRefundChange invoice_payment_refund_change
|
|
|
|
|
6: InvoicePaymentAdjustmentChange invoice_payment_adjustment_change
|
|
|
|
|
11: InvoicePaymentRecTokenAcquired invoice_payment_rec_token_acquired
|
|
|
|
|
12: InvoicePaymentCaptureStarted invoice_payment_capture_started
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие об запуске платежа по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentStarted {
|
|
|
|
|
/** Данные запущенного платежа. */
|
|
|
|
|
1: required domain.InvoicePayment payment
|
2018-07-04 14:56:19 +00:00
|
|
|
|
|
|
|
|
|
/** deprecated */
|
|
|
|
|
/** Оценка риска платежа. */
|
|
|
|
|
4: optional domain.RiskScore risk_score
|
|
|
|
|
/** Выбранный маршрут обработки платежа. */
|
|
|
|
|
2: optional domain.PaymentRoute route
|
|
|
|
|
/** Данные финансового взаимодействия. */
|
|
|
|
|
3: optional domain.FinalCashFlow cash_flow
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении оценки риска платежа.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentRiskScoreChanged {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/** Оценка риска платежа. */
|
2018-07-04 14:56:19 +00:00
|
|
|
|
1: required domain.RiskScore risk_score
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении маршрута обработки платежа.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentRouteChanged {
|
2016-10-17 14:27:32 +00:00
|
|
|
|
/** Выбранный маршрут обработки платежа. */
|
2018-07-04 14:56:19 +00:00
|
|
|
|
1: required domain.PaymentRoute route
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении данных финансового взаимодействия.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentCashFlowChanged {
|
2016-10-17 14:27:32 +00:00
|
|
|
|
/** Данные финансового взаимодействия. */
|
2018-07-04 14:56:19 +00:00
|
|
|
|
1: required domain.FinalCashFlow cash_flow
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении статуса платежа по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentStatusChanged {
|
|
|
|
|
/** Статус платежа по инвойсу. */
|
|
|
|
|
1: required domain.InvoicePaymentStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-10-23 12:00:48 +00:00
|
|
|
|
* Событие в рамках сессии взаимодействия с провайдером.
|
2017-07-17 10:21:41 +00:00
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentSessionChange {
|
|
|
|
|
1: required domain.TargetInvoicePaymentStatus target
|
2017-10-23 12:00:48 +00:00
|
|
|
|
2: required SessionChangePayload payload
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов события, порождённого сессией взаимодействия.
|
|
|
|
|
*/
|
2017-10-23 12:00:48 +00:00
|
|
|
|
union SessionChangePayload {
|
|
|
|
|
1: SessionStarted session_started
|
|
|
|
|
2: SessionFinished session_finished
|
|
|
|
|
3: SessionSuspended session_suspended
|
|
|
|
|
4: SessionActivated session_activated
|
|
|
|
|
5: SessionTransactionBound session_transaction_bound
|
|
|
|
|
6: SessionProxyStateChanged session_proxy_state_changed
|
|
|
|
|
7: SessionInteractionRequested session_interaction_requested
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct SessionStarted {}
|
2017-07-17 10:21:41 +00:00
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct SessionFinished {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: required SessionResult result
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct SessionSuspended {
|
2017-09-28 16:21:55 +00:00
|
|
|
|
1: optional base.Tag tag
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct SessionActivated {}
|
2017-07-17 10:21:41 +00:00
|
|
|
|
|
|
|
|
|
union SessionResult {
|
|
|
|
|
1: SessionSucceeded succeeded
|
|
|
|
|
2: SessionFailed failed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct SessionSucceeded {}
|
|
|
|
|
|
|
|
|
|
struct SessionFailed {
|
|
|
|
|
1: required domain.OperationFailure failure
|
2016-06-16 15:07:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-26 10:32:38 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие о создании нового шаблона инвойса.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoiceTemplateCreated {
|
|
|
|
|
/** Данные созданного шаблона инвойса. */
|
|
|
|
|
1: required domain.InvoiceTemplate invoice_template
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие о модификации шаблона инвойса.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoiceTemplateUpdated {
|
|
|
|
|
/** Данные модифицированного шаблона инвойса. */
|
|
|
|
|
1: required InvoiceTemplateUpdateParams diff
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об удалении шаблона инвойса.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoiceTemplateDeleted {}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие о том, что появилась связь между платежом по инвойсу и транзакцией
|
|
|
|
|
* у провайдера.
|
|
|
|
|
*/
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct SessionTransactionBound {
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/** Данные о связанной транзакции у провайдера. */
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: required domain.TransactionInfo trx
|
2016-06-16 15:07:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2017-07-17 10:21:41 +00:00
|
|
|
|
* Событие о том, что изменилось непрозрачное состояние прокси в рамках сессии.
|
2016-06-16 15:07:06 +00:00
|
|
|
|
*/
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct SessionProxyStateChanged {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: required base.Opaque proxy_state
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-09-23 20:54:14 +00:00
|
|
|
|
/**
|
2017-07-17 10:21:41 +00:00
|
|
|
|
* Событие о запросе взаимодействия с плательщиком.
|
2016-09-23 20:54:14 +00:00
|
|
|
|
*/
|
2017-10-23 12:00:48 +00:00
|
|
|
|
struct SessionInteractionRequested {
|
2016-09-23 20:54:14 +00:00
|
|
|
|
/** Необходимое взаимодействие */
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: required user_interaction.UserInteraction interaction
|
2016-09-23 20:54:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие, касающееся определённого возврата платежа.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentRefundChange {
|
|
|
|
|
1: required domain.InvoicePaymentRefundID id
|
|
|
|
|
2: required InvoicePaymentRefundChangePayload payload
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов события, порождённого возратом платежа по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
union InvoicePaymentRefundChangePayload {
|
|
|
|
|
1: InvoicePaymentRefundCreated invoice_payment_refund_created
|
|
|
|
|
2: InvoicePaymentRefundStatusChanged invoice_payment_refund_status_changed
|
|
|
|
|
3: InvoicePaymentSessionChange invoice_payment_session_change
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие о создании возврата платежа
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentRefundCreated {
|
|
|
|
|
1: required domain.InvoicePaymentRefund refund
|
|
|
|
|
2: required domain.FinalCashFlow cash_flow
|
2019-06-28 11:14:00 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Данные проведённой вручную транзакции.
|
|
|
|
|
* В случае присутствия при обработке возврата этап обращения к адаптеру будет пропущен,
|
|
|
|
|
* а эти данные будут использованы в качестве результата
|
|
|
|
|
*/
|
|
|
|
|
3: optional domain.TransactionInfo transaction_info
|
2017-09-12 09:36:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении статуса возврата платежа
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentRefundStatusChanged {
|
|
|
|
|
1: required domain.InvoicePaymentRefundStatus status
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-09 13:03:31 +00:00
|
|
|
|
/**
|
2017-07-17 10:21:41 +00:00
|
|
|
|
* Событие, касающееся определённой корректировки платежа.
|
2016-12-09 13:03:31 +00:00
|
|
|
|
*/
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct InvoicePaymentAdjustmentChange {
|
|
|
|
|
1: required domain.InvoicePaymentAdjustmentID id
|
|
|
|
|
2: required InvoicePaymentAdjustmentChangePayload payload
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Один из возможных вариантов события, порождённого корректировкой платежа по инвойсу.
|
|
|
|
|
*/
|
|
|
|
|
union InvoicePaymentAdjustmentChangePayload {
|
|
|
|
|
1: InvoicePaymentAdjustmentCreated invoice_payment_adjustment_created
|
|
|
|
|
2: InvoicePaymentAdjustmentStatusChanged invoice_payment_adjustment_status_changed
|
2016-12-09 13:03:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие о создании корректировки платежа
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentAdjustmentCreated {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: required domain.InvoicePaymentAdjustment adjustment
|
2017-06-15 16:24:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении статуса корректировки платежа
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentAdjustmentStatusChanged {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: required domain.InvoicePaymentAdjustmentStatus status
|
2017-06-15 16:24:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-09-26 11:55:10 +00:00
|
|
|
|
/**
|
|
|
|
|
* Событие о полуечнии рекуррентного токена
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentRecTokenAcquired {
|
|
|
|
|
1: required domain.Token token
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-01 09:37:38 +00:00
|
|
|
|
struct InvoicePaymentCaptureStarted {
|
|
|
|
|
1: required InvoicePaymentCaptureParams params
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/**
|
|
|
|
|
* Диапазон для выборки событий.
|
|
|
|
|
*/
|
2016-05-20 16:31:53 +00:00
|
|
|
|
struct EventRange {
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Идентификатор события, за которым должны следовать попадающие в выборку
|
|
|
|
|
* события.
|
|
|
|
|
*
|
|
|
|
|
* Если `after` не указано, в выборку попадут события с начала истории; если
|
|
|
|
|
* указано, например, `42`, то в выборку попадут события, случившиеся _после_
|
|
|
|
|
* события `42`.
|
|
|
|
|
*/
|
2016-06-15 10:21:44 +00:00
|
|
|
|
1: optional base.EventID after
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Максимальное количество событий в выборке.
|
|
|
|
|
*
|
|
|
|
|
* В выборку может попасть количество событий, _не больше_ указанного в
|
|
|
|
|
* `limit`. Если в выборку попало событий _меньше_, чем значение `limit`,
|
|
|
|
|
* был достигнут конец текущей истории.
|
|
|
|
|
*
|
|
|
|
|
* _Допустимые значения_: неотрицательные числа
|
|
|
|
|
*/
|
2016-05-20 16:31:53 +00:00
|
|
|
|
2: required i32 limit
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/* Invoicing service definitions */
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
struct InvoiceParams {
|
2016-10-13 13:16:41 +00:00
|
|
|
|
1: required PartyID party_id
|
|
|
|
|
2: required ShopID shop_id
|
2016-12-21 12:53:12 +00:00
|
|
|
|
3: required domain.InvoiceDetails details
|
2016-12-13 17:23:13 +00:00
|
|
|
|
4: required base.Timestamp due
|
|
|
|
|
5: required domain.Cash cost
|
|
|
|
|
6: required domain.InvoiceContext context
|
2019-04-02 15:38:22 +00:00
|
|
|
|
7: optional domain.InvoiceID id
|
|
|
|
|
8: optional string external_id
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-26 10:32:38 +00:00
|
|
|
|
struct InvoiceWithTemplateParams {
|
|
|
|
|
1: required domain.InvoiceTemplateID template_id
|
|
|
|
|
2: optional domain.Cash cost
|
|
|
|
|
3: optional domain.InvoiceContext context
|
2019-04-02 15:38:22 +00:00
|
|
|
|
4: optional domain.InvoiceID id
|
|
|
|
|
5: optional string external_id
|
2017-07-26 10:32:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoiceTemplateCreateParams {
|
|
|
|
|
1: required PartyID party_id
|
|
|
|
|
2: required ShopID shop_id
|
|
|
|
|
4: required domain.LifetimeInterval invoice_lifetime
|
2017-10-25 12:44:15 +00:00
|
|
|
|
7: required string product # for backward compatibility
|
|
|
|
|
8: optional string description
|
|
|
|
|
9: required domain.InvoiceTemplateDetails details
|
2017-07-26 10:32:38 +00:00
|
|
|
|
6: required domain.InvoiceContext context
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoiceTemplateUpdateParams {
|
|
|
|
|
2: optional domain.LifetimeInterval invoice_lifetime
|
2017-10-25 12:44:15 +00:00
|
|
|
|
5: optional string product # for backward compatibility
|
|
|
|
|
6: optional string description
|
|
|
|
|
7: optional domain.InvoiceTemplateDetails details
|
2017-07-26 10:32:38 +00:00
|
|
|
|
4: optional domain.InvoiceContext context
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
struct InvoicePaymentParams {
|
2017-10-23 12:00:48 +00:00
|
|
|
|
1: required PayerParams payer
|
2017-08-29 15:51:12 +00:00
|
|
|
|
2: required InvoicePaymentParamsFlow flow
|
2018-09-26 11:55:10 +00:00
|
|
|
|
3: optional bool make_recurrent
|
2019-04-02 15:38:22 +00:00
|
|
|
|
4: optional domain.InvoicePaymentID id
|
|
|
|
|
5: optional string external_id
|
2019-04-30 14:43:41 +00:00
|
|
|
|
6: optional domain.InvoicePaymentContext context
|
2017-08-29 15:51:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
union PayerParams {
|
|
|
|
|
1: PaymentResourcePayerParams payment_resource
|
|
|
|
|
2: CustomerPayerParams customer
|
2018-09-26 11:55:10 +00:00
|
|
|
|
3: RecurrentPayerParams recurrent
|
2017-10-23 12:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PaymentResourcePayerParams {
|
|
|
|
|
1: required domain.DisposablePaymentResource resource
|
|
|
|
|
2: required domain.ContactInfo contact_info
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CustomerPayerParams {
|
|
|
|
|
1: required domain.CustomerID customer_id
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-26 11:55:10 +00:00
|
|
|
|
struct RecurrentPayerParams{
|
|
|
|
|
1: required domain.RecurrentParentPayment recurrent_parent
|
|
|
|
|
2: required domain.ContactInfo contact_info
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-29 15:51:12 +00:00
|
|
|
|
union InvoicePaymentParamsFlow {
|
|
|
|
|
1: InvoicePaymentParamsFlowInstant instant
|
|
|
|
|
2: InvoicePaymentParamsFlowHold hold
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-26 11:55:10 +00:00
|
|
|
|
struct InvoicePaymentParamsFlowInstant {}
|
2017-08-29 15:51:12 +00:00
|
|
|
|
|
|
|
|
|
struct InvoicePaymentParamsFlowHold {
|
|
|
|
|
1: required domain.OnHoldExpiration on_hold_expiration
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct Invoice {
|
|
|
|
|
1: required domain.Invoice invoice
|
|
|
|
|
2: required list<InvoicePayment> payments
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvoicePayment {
|
|
|
|
|
1: required domain.InvoicePayment payment
|
2017-09-12 09:36:42 +00:00
|
|
|
|
3: required list<InvoicePaymentRefund> refunds
|
2017-07-17 10:21:41 +00:00
|
|
|
|
2: required list<InvoicePaymentAdjustment> adjustments
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
typedef domain.InvoicePaymentRefund InvoicePaymentRefund
|
2017-07-17 10:21:41 +00:00
|
|
|
|
typedef domain.InvoicePaymentAdjustment InvoicePaymentAdjustment
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
/**
|
|
|
|
|
* Параметры создаваемого возврата платежа.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentRefundParams {
|
|
|
|
|
/** Причина, на основании которой производится возврат. */
|
|
|
|
|
1: optional string reason
|
2018-04-19 16:44:56 +00:00
|
|
|
|
/**
|
|
|
|
|
* Сумма возврата.
|
2018-03-06 14:04:49 +00:00
|
|
|
|
* Если сумма не указана, то считаем, что это возврат на полную сумму платежа.
|
|
|
|
|
*/
|
|
|
|
|
2: optional domain.Cash cash
|
2019-02-25 09:04:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* Данные проведённой вручную транзакции
|
|
|
|
|
*/
|
|
|
|
|
3: optional domain.TransactionInfo transaction_info
|
2019-05-17 09:07:25 +00:00
|
|
|
|
/**
|
|
|
|
|
* Итоговая корзина товаров.
|
|
|
|
|
* Используется для частичного возврата, содержит позиции, которые остались после возврата.
|
|
|
|
|
*/
|
|
|
|
|
4: optional domain.InvoiceCart cart
|
2019-07-16 13:30:05 +00:00
|
|
|
|
/**
|
|
|
|
|
* Идентификатор рефанда
|
|
|
|
|
*/
|
|
|
|
|
5: optional domain.InvoicePaymentRefundID id
|
|
|
|
|
/**
|
|
|
|
|
* Внешний идентификатор объекта
|
|
|
|
|
*/
|
|
|
|
|
6: optional string external_id
|
2017-09-12 09:36:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-24 13:02:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* Параметры подтверждаемого платежа.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentCaptureParams {
|
|
|
|
|
/** Причина совершения операции. */
|
|
|
|
|
1: required string reason
|
|
|
|
|
/**
|
|
|
|
|
* Подтверждаемая сумма.
|
|
|
|
|
* Если сумма не указана, то считаем, что подтверждаем полную сумму платежа.
|
|
|
|
|
*/
|
|
|
|
|
2: optional domain.Cash cash
|
2019-05-17 09:07:25 +00:00
|
|
|
|
3: optional domain.InvoiceCart cart
|
2019-01-24 13:02:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
/**
|
|
|
|
|
* Параметры создаваемой поправки к платежу.
|
|
|
|
|
*/
|
|
|
|
|
struct InvoicePaymentAdjustmentParams {
|
|
|
|
|
/** Ревизия, относительно которой необходимо пересчитать граф финансовых потоков. */
|
|
|
|
|
1: optional domain.DataRevision domain_revision
|
|
|
|
|
/** Причина, на основании которой создаётся поправка. */
|
|
|
|
|
2: required string reason
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-18 09:45:47 +00:00
|
|
|
|
/* Сценарий, проверяющий состояние упавшей машины и, в случае если
|
|
|
|
|
платеж упал раньше похода к провайдеру, начинает процедуру корректного
|
|
|
|
|
завершения, используя заданную ошибку*/
|
|
|
|
|
|
|
|
|
|
struct InvoiceRepairFailPreProcessing {
|
|
|
|
|
1: required domain.Failure failure
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Сценарий, позволяющий пропустить испекцию платежа, подменив ее результат заданым. */
|
|
|
|
|
|
|
|
|
|
struct InvoiceRepairSkipInspector {
|
|
|
|
|
1: required domain.RiskScore risk_score
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Сценарий, использующий заданную ошибку, чтобы сконструировать результат похода к адаптеру */
|
|
|
|
|
|
|
|
|
|
struct InvoiceRepairFailSession {
|
|
|
|
|
1: required domain.Failure failure
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Комбинированная структура */
|
|
|
|
|
|
|
|
|
|
struct InvoiceRepairComplex {
|
|
|
|
|
1: required list<InvoiceRepairScenario> scenarios
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union InvoiceRepairScenario{
|
|
|
|
|
1: InvoiceRepairComplex complex
|
|
|
|
|
2: InvoiceRepairFailPreProcessing fail_pre_processing
|
|
|
|
|
3: InvoiceRepairSkipInspector skip_inspector
|
|
|
|
|
4: InvoiceRepairFailSession fail_session
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-20 12:31:30 +00:00
|
|
|
|
/* Параметры adhoc починки упавшей машины. */
|
|
|
|
|
struct InvoiceRepairParams {
|
|
|
|
|
1: optional bool validate_transitions = true
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-13 13:16:41 +00:00
|
|
|
|
// Exceptions
|
|
|
|
|
|
|
|
|
|
// forward-declared
|
|
|
|
|
exception PartyNotFound {}
|
2017-10-02 15:42:13 +00:00
|
|
|
|
exception PartyNotExistsYet {}
|
2018-01-19 13:44:26 +00:00
|
|
|
|
exception InvalidPartyRevision {}
|
2016-10-13 13:16:41 +00:00
|
|
|
|
exception ShopNotFound {}
|
2018-07-17 14:32:10 +00:00
|
|
|
|
exception WalletNotFound {}
|
2017-03-03 17:24:31 +00:00
|
|
|
|
exception InvalidPartyStatus { 1: required InvalidStatus status }
|
|
|
|
|
exception InvalidShopStatus { 1: required InvalidStatus status }
|
2018-07-17 14:32:10 +00:00
|
|
|
|
exception InvalidWalletStatus { 1: required InvalidStatus status }
|
2017-07-17 10:21:41 +00:00
|
|
|
|
exception InvalidContractStatus { 1: required domain.ContractStatus status }
|
|
|
|
|
|
|
|
|
|
union InvalidStatus {
|
|
|
|
|
1: domain.Blocking blocking
|
|
|
|
|
2: domain.Suspension suspension
|
|
|
|
|
}
|
2016-10-13 13:16:41 +00:00
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
exception InvalidUser {}
|
2017-06-15 16:24:35 +00:00
|
|
|
|
exception InvoiceNotFound {}
|
2016-05-26 12:06:07 +00:00
|
|
|
|
exception InvoicePaymentNotFound {}
|
2017-09-12 09:36:42 +00:00
|
|
|
|
exception InvoicePaymentRefundNotFound {}
|
2017-06-15 16:24:35 +00:00
|
|
|
|
exception InvoicePaymentAdjustmentNotFound {}
|
2016-05-20 16:31:53 +00:00
|
|
|
|
exception EventNotFound {}
|
2017-09-12 09:36:42 +00:00
|
|
|
|
exception OperationNotPermitted {}
|
2018-12-10 11:00:35 +00:00
|
|
|
|
exception PayoutToolNotFound {}
|
2017-09-21 07:18:01 +00:00
|
|
|
|
exception InsufficientAccountBalance {}
|
2018-09-26 11:55:10 +00:00
|
|
|
|
exception InvalidRecurrentParentPayment {
|
|
|
|
|
1: optional string details
|
|
|
|
|
}
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
|
|
|
|
exception InvoicePaymentPending {
|
|
|
|
|
1: required domain.InvoicePaymentID id
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
exception InvoicePaymentRefundPending {
|
|
|
|
|
1: required domain.InvoicePaymentRefundID id
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
exception InvoicePaymentAdjustmentPending {
|
|
|
|
|
1: required domain.InvoicePaymentAdjustmentID id
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
exception InvalidInvoiceStatus {
|
|
|
|
|
1: required domain.InvoiceStatus status
|
|
|
|
|
}
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2017-06-15 16:24:35 +00:00
|
|
|
|
exception InvalidPaymentStatus {
|
|
|
|
|
1: required domain.InvoicePaymentStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exception InvalidPaymentAdjustmentStatus {
|
|
|
|
|
1: required domain.InvoicePaymentAdjustmentStatus status
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-26 10:32:38 +00:00
|
|
|
|
exception InvoiceTemplateNotFound {}
|
|
|
|
|
exception InvoiceTemplateRemoved {}
|
|
|
|
|
|
2018-03-06 14:04:49 +00:00
|
|
|
|
exception InvoicePaymentAmountExceeded {
|
|
|
|
|
1: required domain.Cash maximum
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-22 12:42:45 +00:00
|
|
|
|
exception InconsistentRefundCurrency {
|
|
|
|
|
1: required domain.CurrencySymbolicCode currency
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-24 13:02:48 +00:00
|
|
|
|
exception InconsistentCaptureCurrency {
|
|
|
|
|
1: required domain.CurrencySymbolicCode payment_currency
|
|
|
|
|
2: optional domain.CurrencySymbolicCode passed_currency
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exception AmountExceededCaptureBalance {
|
|
|
|
|
1: required domain.Amount payment_amount
|
|
|
|
|
2: optional domain.Amount passed_amount
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
service Invoicing {
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
Invoice Create (1: UserInfo user, 2: InvoiceParams params)
|
2016-10-13 13:16:41 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: base.InvalidRequest ex2,
|
|
|
|
|
3: PartyNotFound ex3,
|
2017-03-03 17:24:31 +00:00
|
|
|
|
4: ShopNotFound ex4,
|
|
|
|
|
5: InvalidPartyStatus ex5,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
6: InvalidShopStatus ex6,
|
|
|
|
|
7: InvalidContractStatus ex7
|
2016-10-13 13:16:41 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2017-07-26 10:32:38 +00:00
|
|
|
|
Invoice CreateWithTemplate (1: UserInfo user, 2: InvoiceWithTemplateParams params)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: base.InvalidRequest ex2,
|
|
|
|
|
3: InvalidPartyStatus ex3,
|
|
|
|
|
4: InvalidShopStatus ex4,
|
|
|
|
|
5: InvalidContractStatus ex5
|
|
|
|
|
6: InvoiceTemplateNotFound ex6,
|
|
|
|
|
7: InvoiceTemplateRemoved ex7
|
|
|
|
|
)
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
Invoice Get (1: UserInfo user, 2: domain.InvoiceID id)
|
2016-10-13 13:16:41 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2
|
2016-10-13 13:16:41 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
|
|
|
|
Events GetEvents (1: UserInfo user, 2: domain.InvoiceID id, 3: EventRange range)
|
2016-06-02 11:38:27 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2016-06-02 11:38:27 +00:00
|
|
|
|
3: EventNotFound ex3,
|
|
|
|
|
4: base.InvalidRequest ex4
|
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2017-09-27 12:47:14 +00:00
|
|
|
|
/* Terms */
|
|
|
|
|
|
|
|
|
|
domain.TermSet ComputeTerms (1: UserInfo user, 2: domain.InvoiceID id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: InvoiceNotFound ex2)
|
|
|
|
|
|
|
|
|
|
/* Payments */
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
InvoicePayment StartPayment (
|
2016-05-20 16:31:53 +00:00
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: InvoicePaymentParams params
|
|
|
|
|
)
|
2016-06-02 11:38:27 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2016-06-02 11:38:27 +00:00
|
|
|
|
3: InvalidInvoiceStatus ex3,
|
|
|
|
|
4: InvoicePaymentPending ex4,
|
2017-03-03 17:24:31 +00:00
|
|
|
|
5: base.InvalidRequest ex5,
|
|
|
|
|
6: InvalidPartyStatus ex6,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
7: InvalidShopStatus ex7,
|
2018-09-26 11:55:10 +00:00
|
|
|
|
8: InvalidContractStatus ex8,
|
|
|
|
|
9: InvalidRecurrentParentPayment ex9,
|
|
|
|
|
10: OperationNotPermitted ex10
|
2016-06-02 11:38:27 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
InvoicePayment GetPayment (
|
2016-10-13 13:16:41 +00:00
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2016-10-13 13:16:41 +00:00
|
|
|
|
3: InvoicePaymentNotFound ex3
|
|
|
|
|
)
|
2016-05-26 12:06:07 +00:00
|
|
|
|
|
2017-08-29 15:51:12 +00:00
|
|
|
|
void CancelPayment (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: string reason
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvalidPaymentStatus ex4,
|
|
|
|
|
5: base.InvalidRequest ex5,
|
2017-09-12 09:36:42 +00:00
|
|
|
|
6: OperationNotPermitted ex6,
|
2017-08-29 15:51:12 +00:00
|
|
|
|
7: InvalidPartyStatus ex7,
|
|
|
|
|
8: InvalidShopStatus ex8
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
void CapturePayment (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
2019-05-17 09:07:25 +00:00
|
|
|
|
4: InvoicePaymentCaptureParams params
|
2017-08-29 15:51:12 +00:00
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvalidPaymentStatus ex4,
|
|
|
|
|
5: base.InvalidRequest ex5,
|
2017-09-12 09:36:42 +00:00
|
|
|
|
6: OperationNotPermitted ex6,
|
2017-08-29 15:51:12 +00:00
|
|
|
|
7: InvalidPartyStatus ex7,
|
2019-05-17 09:07:25 +00:00
|
|
|
|
8: InvalidShopStatus ex8,
|
|
|
|
|
9: InconsistentCaptureCurrency ex9,
|
|
|
|
|
10: AmountExceededCaptureBalance ex10
|
2017-08-29 15:51:12 +00:00
|
|
|
|
)
|
2019-01-24 13:02:48 +00:00
|
|
|
|
|
|
|
|
|
void CapturePaymentNew (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: InvoicePaymentCaptureParams params
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvalidPaymentStatus ex4,
|
|
|
|
|
5: base.InvalidRequest ex5,
|
|
|
|
|
6: OperationNotPermitted ex6,
|
|
|
|
|
7: InvalidPartyStatus ex7,
|
|
|
|
|
8: InvalidShopStatus ex8,
|
|
|
|
|
9: InconsistentCaptureCurrency ex9,
|
|
|
|
|
10: AmountExceededCaptureBalance ex10
|
|
|
|
|
)
|
2017-06-15 16:24:35 +00:00
|
|
|
|
/**
|
|
|
|
|
* Создать поправку к платежу.
|
|
|
|
|
*
|
|
|
|
|
* После создания поправку необходимо либо подтвердить, если её эффекты
|
|
|
|
|
* соответствуют ожиданиям, либо отклонить в противном случае (по аналогии с
|
|
|
|
|
* заявками).
|
|
|
|
|
* Пока созданная поправка ни подтверждена, ни отклонена, другую поправку
|
|
|
|
|
* создать невозможно.
|
|
|
|
|
*/
|
2017-07-17 10:21:41 +00:00
|
|
|
|
InvoicePaymentAdjustment CreatePaymentAdjustment (
|
2017-06-15 16:24:35 +00:00
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id,
|
|
|
|
|
4: InvoicePaymentAdjustmentParams params
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvalidPaymentStatus ex4,
|
|
|
|
|
5: InvoicePaymentAdjustmentPending ex5
|
|
|
|
|
)
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
InvoicePaymentAdjustment GetPaymentAdjustment (
|
2017-06-15 16:24:35 +00:00
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: domain.InvoicePaymentAdjustmentID adjustment_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvoicePaymentAdjustmentNotFound ex4
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
void CapturePaymentAdjustment (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: domain.InvoicePaymentAdjustmentID adjustment_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvoicePaymentAdjustmentNotFound ex4,
|
|
|
|
|
5: InvalidPaymentAdjustmentStatus ex5
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
void CancelPaymentAdjustment (
|
|
|
|
|
1: UserInfo user
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: domain.InvoicePaymentAdjustmentID adjustment_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvoicePaymentAdjustmentNotFound ex4,
|
|
|
|
|
5: InvalidPaymentAdjustmentStatus ex5
|
|
|
|
|
)
|
2017-09-12 09:36:42 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Сделать возврат платежа.
|
|
|
|
|
*/
|
|
|
|
|
domain.InvoicePaymentRefund RefundPayment (
|
|
|
|
|
1: UserInfo user
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: InvoicePaymentRefundParams params
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvalidPaymentStatus ex4,
|
2017-09-21 07:18:01 +00:00
|
|
|
|
6: OperationNotPermitted ex6,
|
|
|
|
|
7: InsufficientAccountBalance ex7,
|
|
|
|
|
8: base.InvalidRequest ex8
|
2018-03-06 14:04:49 +00:00
|
|
|
|
9: InvoicePaymentAmountExceeded ex9
|
2018-03-22 12:42:45 +00:00
|
|
|
|
10: InconsistentRefundCurrency ex10
|
2018-10-02 13:35:41 +00:00
|
|
|
|
11: InvalidPartyStatus ex11
|
|
|
|
|
12: InvalidShopStatus ex12
|
|
|
|
|
13: InvalidContractStatus ex13
|
2017-09-12 09:36:42 +00:00
|
|
|
|
)
|
|
|
|
|
|
2019-02-25 09:04:22 +00:00
|
|
|
|
/**
|
|
|
|
|
* Сделать ручной возврат.
|
|
|
|
|
*/
|
|
|
|
|
domain.InvoicePaymentRefund CreateManualRefund (
|
|
|
|
|
1: UserInfo user
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: InvoicePaymentRefundParams params
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvalidPaymentStatus ex4,
|
|
|
|
|
6: OperationNotPermitted ex6,
|
|
|
|
|
7: InsufficientAccountBalance ex7,
|
|
|
|
|
8: InvoicePaymentAmountExceeded ex8
|
|
|
|
|
9: InconsistentRefundCurrency ex9
|
|
|
|
|
10: InvalidPartyStatus ex10
|
|
|
|
|
11: InvalidShopStatus ex11
|
|
|
|
|
12: InvalidContractStatus ex12
|
2019-07-25 10:43:26 +00:00
|
|
|
|
13: base.InvalidRequest ex13
|
2019-02-25 09:04:22 +00:00
|
|
|
|
)
|
|
|
|
|
|
2017-09-12 09:36:42 +00:00
|
|
|
|
domain.InvoicePaymentRefund GetPaymentRefund (
|
|
|
|
|
1: UserInfo user
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: domain.InvoicePaymentID payment_id
|
|
|
|
|
4: domain.InvoicePaymentRefundID refund_id
|
|
|
|
|
)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: InvoicePaymentNotFound ex3,
|
|
|
|
|
4: InvoicePaymentRefundNotFound ex4
|
|
|
|
|
)
|
2017-06-15 16:24:35 +00:00
|
|
|
|
|
2016-05-20 16:31:53 +00:00
|
|
|
|
void Fulfill (1: UserInfo user, 2: domain.InvoiceID id, 3: string reason)
|
2016-10-13 13:16:41 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2017-03-03 17:24:31 +00:00
|
|
|
|
3: InvalidInvoiceStatus ex3,
|
|
|
|
|
4: InvalidPartyStatus ex4,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
5: InvalidShopStatus ex5,
|
|
|
|
|
6: InvalidContractStatus ex6
|
2016-10-13 13:16:41 +00:00
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2016-06-21 15:45:09 +00:00
|
|
|
|
void Rescind (1: UserInfo user, 2: domain.InvoiceID id, 3: string reason)
|
2016-10-13 13:16:41 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
2017-06-15 16:24:35 +00:00
|
|
|
|
2: InvoiceNotFound ex2,
|
2016-10-13 13:16:41 +00:00
|
|
|
|
3: InvalidInvoiceStatus ex3,
|
2017-03-03 17:24:31 +00:00
|
|
|
|
4: InvoicePaymentPending ex4,
|
|
|
|
|
5: InvalidPartyStatus ex5,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
6: InvalidShopStatus ex6,
|
|
|
|
|
7: InvalidContractStatus ex7
|
2016-10-13 13:16:41 +00:00
|
|
|
|
)
|
2018-02-15 08:20:36 +00:00
|
|
|
|
|
|
|
|
|
/* Ad-hoc repairs */
|
|
|
|
|
|
2019-02-22 15:08:13 +00:00
|
|
|
|
void Repair (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: domain.InvoiceID id,
|
|
|
|
|
3: list<InvoiceChange> changes,
|
2019-05-20 12:31:30 +00:00
|
|
|
|
4: repairing.ComplexAction action,
|
|
|
|
|
5: InvoiceRepairParams params
|
2019-02-22 15:08:13 +00:00
|
|
|
|
)
|
2018-02-15 08:20:36 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: base.InvalidRequest ex3
|
|
|
|
|
)
|
|
|
|
|
|
2018-10-18 09:45:47 +00:00
|
|
|
|
/* Invoice payments repairs */
|
|
|
|
|
|
|
|
|
|
void RepairWithScenario (1: UserInfo user, 2: domain.InvoiceID id, 3: InvoiceRepairScenario Scenario)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceNotFound ex2,
|
|
|
|
|
3: base.InvalidRequest ex3
|
|
|
|
|
)
|
2018-02-15 08:20:36 +00:00
|
|
|
|
}
|
2017-07-26 10:32:38 +00:00
|
|
|
|
|
|
|
|
|
service InvoiceTemplating {
|
2016-05-20 16:31:53 +00:00
|
|
|
|
|
2017-07-26 10:32:38 +00:00
|
|
|
|
domain.InvoiceTemplate Create (1: UserInfo user, 2: InvoiceTemplateCreateParams params)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: InvalidPartyStatus ex3,
|
|
|
|
|
4: ShopNotFound ex4,
|
|
|
|
|
5: InvalidShopStatus ex5,
|
|
|
|
|
6: base.InvalidRequest ex6
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
domain.InvoiceTemplate Get (1: UserInfo user, 2: domain.InvoiceTemplateID id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceTemplateNotFound ex2,
|
|
|
|
|
3: InvoiceTemplateRemoved ex3
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
domain.InvoiceTemplate Update (1: UserInfo user, 2: domain.InvoiceTemplateID id, 3: InvoiceTemplateUpdateParams params)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceTemplateNotFound ex2,
|
|
|
|
|
3: InvoiceTemplateRemoved ex3,
|
|
|
|
|
4: InvalidPartyStatus ex4,
|
|
|
|
|
5: InvalidShopStatus ex5,
|
|
|
|
|
6: base.InvalidRequest ex6
|
|
|
|
|
)
|
2017-10-02 15:42:13 +00:00
|
|
|
|
|
2017-07-26 10:32:38 +00:00
|
|
|
|
void Delete (1: UserInfo user, 2: domain.InvoiceTemplateID id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceTemplateNotFound ex2,
|
|
|
|
|
3: InvoiceTemplateRemoved ex3,
|
|
|
|
|
4: InvalidPartyStatus ex4,
|
|
|
|
|
5: InvalidShopStatus ex5
|
|
|
|
|
)
|
2017-10-02 15:42:13 +00:00
|
|
|
|
|
|
|
|
|
/* Terms */
|
|
|
|
|
|
|
|
|
|
domain.TermSet ComputeTerms (1: UserInfo user, 2: domain.InvoiceTemplateID id, 3: base.Timestamp timestamp)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: InvoiceTemplateNotFound ex2,
|
|
|
|
|
3: InvoiceTemplateRemoved ex3,
|
|
|
|
|
4: PartyNotExistsYet ex4
|
|
|
|
|
)
|
2016-05-20 16:31:53 +00:00
|
|
|
|
}
|
2016-06-16 15:07:06 +00:00
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
/* Customer management service definitions */
|
|
|
|
|
|
|
|
|
|
/* Customers */
|
|
|
|
|
|
|
|
|
|
typedef domain.CustomerID CustomerID
|
|
|
|
|
typedef domain.Metadata Metadata
|
|
|
|
|
|
|
|
|
|
struct CustomerParams {
|
|
|
|
|
1: required PartyID party_id
|
|
|
|
|
2: required ShopID shop_id
|
|
|
|
|
3: required domain.ContactInfo contact_info
|
|
|
|
|
4: required Metadata metadata
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct Customer {
|
|
|
|
|
1: required CustomerID id
|
|
|
|
|
2: required PartyID owner_id
|
|
|
|
|
3: required ShopID shop_id
|
|
|
|
|
4: required CustomerStatus status
|
|
|
|
|
5: required base.Timestamp created_at
|
|
|
|
|
6: required list<CustomerBinding> bindings
|
|
|
|
|
7: required domain.ContactInfo contact_info
|
|
|
|
|
8: required Metadata metadata
|
2017-11-22 10:21:20 +00:00
|
|
|
|
9: optional CustomerBindingID active_binding_id
|
2017-10-23 12:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Статусы плательщика
|
|
|
|
|
*
|
|
|
|
|
* Статус отражает возможость проводить платежи с помощью данного плательщика,
|
|
|
|
|
* то есть существует ли (и она сейчас активна) у него привязка, завершившаяся успешно
|
|
|
|
|
*/
|
|
|
|
|
union CustomerStatus {
|
|
|
|
|
1: CustomerUnready unready
|
|
|
|
|
2: CustomerReady ready
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CustomerUnready {}
|
|
|
|
|
struct CustomerReady {}
|
|
|
|
|
|
2017-11-22 10:21:20 +00:00
|
|
|
|
// События
|
2017-10-23 12:00:48 +00:00
|
|
|
|
union CustomerChange {
|
|
|
|
|
1: CustomerCreated customer_created
|
|
|
|
|
2: CustomerDeleted customer_deleted
|
|
|
|
|
3: CustomerStatusChanged customer_status_changed
|
|
|
|
|
4: CustomerBindingChanged customer_binding_changed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие о создании нового плательщика.
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerCreated {
|
2017-11-22 10:21:20 +00:00
|
|
|
|
2: required CustomerID customer_id
|
|
|
|
|
3: required PartyID owner_id
|
|
|
|
|
4: required ShopID shop_id
|
|
|
|
|
5: required Metadata metadata
|
|
|
|
|
6: required domain.ContactInfo contact_info
|
|
|
|
|
7: required base.Timestamp created_at
|
2017-10-23 12:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об удалении плательщика.
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerDeleted {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении статуса плательщика.
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerStatusChanged {
|
|
|
|
|
1: required CustomerStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие, касающееся определённой привязки плательщика.
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerBindingChanged {
|
|
|
|
|
1: required CustomerBindingID id
|
|
|
|
|
2: required CustomerBindingChangePayload payload
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Bindings */
|
|
|
|
|
|
|
|
|
|
typedef domain.CustomerBindingID CustomerBindingID
|
|
|
|
|
typedef domain.DisposablePaymentResource DisposablePaymentResource
|
|
|
|
|
|
|
|
|
|
struct CustomerBindingParams {
|
|
|
|
|
1: required DisposablePaymentResource payment_resource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CustomerBinding {
|
|
|
|
|
1: required CustomerBindingID id
|
|
|
|
|
2: required RecurrentPaymentToolID rec_payment_tool_id
|
|
|
|
|
3: required DisposablePaymentResource payment_resource
|
|
|
|
|
4: required CustomerBindingStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Statuses
|
|
|
|
|
union CustomerBindingStatus {
|
2019-08-08 11:53:38 +00:00
|
|
|
|
4: CustomerBindingCreating creating
|
2017-10-23 12:00:48 +00:00
|
|
|
|
1: CustomerBindingPending pending
|
|
|
|
|
2: CustomerBindingSucceeded succeeded
|
|
|
|
|
3: CustomerBindingFailed failed
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-08 11:53:38 +00:00
|
|
|
|
/**
|
|
|
|
|
* Привязка находится в процессе создания
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerBindingCreating {}
|
|
|
|
|
|
2017-10-23 12:00:48 +00:00
|
|
|
|
/**
|
|
|
|
|
* Привязка находится в процессе обработки
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerBindingPending {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Привязка завершилась успешно
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerBindingSucceeded {}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Привязка завершилась неудачно
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerBindingFailed { 1: required domain.OperationFailure failure }
|
|
|
|
|
|
|
|
|
|
// Events
|
|
|
|
|
union CustomerBindingChangePayload {
|
|
|
|
|
1: CustomerBindingStarted started
|
|
|
|
|
2: CustomerBindingStatusChanged status_changed
|
|
|
|
|
3: CustomerBindingInteractionRequested interaction_requested
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие о старте процесса привязки
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerBindingStarted {
|
|
|
|
|
1: required CustomerBinding binding
|
2018-09-17 15:30:11 +00:00
|
|
|
|
2: optional base.Timestamp timestamp
|
2017-10-23 12:00:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Событие об изменении статуса привязки
|
|
|
|
|
*/
|
|
|
|
|
struct CustomerBindingStatusChanged {
|
|
|
|
|
1: required CustomerBindingStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct CustomerBindingInteractionRequested {
|
|
|
|
|
1: required user_interaction.UserInteraction interaction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Exceptions
|
|
|
|
|
exception InvalidCustomerStatus {
|
|
|
|
|
1: required CustomerStatus status
|
|
|
|
|
}
|
|
|
|
|
exception CustomerNotFound {}
|
|
|
|
|
exception InvalidPaymentTool {}
|
|
|
|
|
|
|
|
|
|
// Service
|
|
|
|
|
|
|
|
|
|
service CustomerManagement {
|
|
|
|
|
|
|
|
|
|
Customer Create (1: CustomerParams params)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: InvalidPartyStatus invalid_party_status
|
|
|
|
|
3: InvalidShopStatus invalid_shop_status
|
|
|
|
|
4: ShopNotFound shop_not_found
|
|
|
|
|
5: PartyNotFound party_not_found
|
2017-11-22 10:21:20 +00:00
|
|
|
|
6: OperationNotPermitted operation_not_permitted
|
2017-10-23 12:00:48 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Customer Get (1: CustomerID id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: CustomerNotFound not_found
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
void Delete (1: CustomerID id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: CustomerNotFound not_found
|
|
|
|
|
3: InvalidPartyStatus invalid_party_status
|
|
|
|
|
4: InvalidShopStatus invalid_shop_status
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
CustomerBinding StartBinding (1: CustomerID customer_id, 2: CustomerBindingParams params)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: CustomerNotFound customer_not_found
|
|
|
|
|
3: InvalidPartyStatus invalid_party_status
|
|
|
|
|
4: InvalidShopStatus invalid_shop_status
|
|
|
|
|
5: InvalidContractStatus invalid_contract_status
|
|
|
|
|
6: OperationNotPermitted operation_not_permitted
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
CustomerBinding GetActiveBinding (1: CustomerID customer_id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: CustomerNotFound customer_not_found
|
|
|
|
|
3: InvalidCustomerStatus invalid_customer_status
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Events GetEvents (1: CustomerID customer_id, 2: EventRange range)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: CustomerNotFound customer_not_found
|
|
|
|
|
3: EventNotFound event_not_found
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Recurrent Payment Tool */
|
|
|
|
|
|
|
|
|
|
// Types
|
|
|
|
|
typedef domain.RecurrentPaymentToolID RecurrentPaymentToolID
|
|
|
|
|
|
|
|
|
|
// Model
|
|
|
|
|
struct RecurrentPaymentTool {
|
|
|
|
|
1: required RecurrentPaymentToolID id
|
|
|
|
|
2: required ShopID shop_id
|
|
|
|
|
3: required PartyID party_id
|
2018-09-17 13:18:37 +00:00
|
|
|
|
11: optional PartyRevision party_revision
|
2017-10-23 12:00:48 +00:00
|
|
|
|
4: required domain.DataRevision domain_revision
|
|
|
|
|
6: required RecurrentPaymentToolStatus status
|
|
|
|
|
7: required base.Timestamp created_at
|
|
|
|
|
8: required DisposablePaymentResource payment_resource
|
|
|
|
|
9: optional domain.Token rec_token
|
|
|
|
|
10: optional domain.PaymentRoute route
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct RecurrentPaymentToolParams {
|
2019-08-08 11:53:38 +00:00
|
|
|
|
5: optional RecurrentPaymentToolID id
|
2017-10-23 12:00:48 +00:00
|
|
|
|
1: required PartyID party_id
|
2018-09-17 13:18:37 +00:00
|
|
|
|
4: optional PartyRevision party_revision
|
2017-10-23 12:00:48 +00:00
|
|
|
|
2: required ShopID shop_id
|
|
|
|
|
3: required DisposablePaymentResource payment_resource
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Statuses
|
|
|
|
|
struct RecurrentPaymentToolCreated {}
|
|
|
|
|
struct RecurrentPaymentToolAcquired {}
|
|
|
|
|
struct RecurrentPaymentToolAbandoned {}
|
|
|
|
|
struct RecurrentPaymentToolFailed { 1: required domain.OperationFailure failure }
|
|
|
|
|
|
|
|
|
|
union RecurrentPaymentToolStatus {
|
|
|
|
|
1: RecurrentPaymentToolCreated created
|
|
|
|
|
2: RecurrentPaymentToolAcquired acquired
|
|
|
|
|
3: RecurrentPaymentToolAbandoned abandoned
|
|
|
|
|
4: RecurrentPaymentToolFailed failed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Events
|
|
|
|
|
typedef list<RecurrentPaymentToolEvent> RecurrentPaymentToolEvents
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* События, связанные непосредственно с получением рекуррентных токенов
|
|
|
|
|
*/
|
|
|
|
|
struct RecurrentPaymentToolEvent {
|
|
|
|
|
1: required base.EventID id
|
|
|
|
|
2: required base.Timestamp created_at
|
|
|
|
|
3: required RecurrentPaymentToolID source
|
|
|
|
|
4: required list<RecurrentPaymentToolChange> payload
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct RecurrentPaymentToolSessionChange {
|
|
|
|
|
1: required SessionChangePayload payload
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union RecurrentPaymentToolChange {
|
|
|
|
|
1: RecurrentPaymentToolHasCreated rec_payment_tool_created
|
|
|
|
|
2: RecurrentPaymentToolHasAcquired rec_payment_tool_acquired
|
|
|
|
|
3: RecurrentPaymentToolHasAbandoned rec_payment_tool_abandoned
|
|
|
|
|
4: RecurrentPaymentToolHasFailed rec_payment_tool_failed
|
|
|
|
|
5: RecurrentPaymentToolSessionChange rec_payment_tool_session_changed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Создано рекуррентное платежное средство
|
|
|
|
|
*/
|
|
|
|
|
struct RecurrentPaymentToolHasCreated {
|
|
|
|
|
1: required RecurrentPaymentTool rec_payment_tool
|
|
|
|
|
2: required domain.RiskScore risk_score
|
|
|
|
|
3: required domain.PaymentRoute route
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Получен рекуррентный токен => теперь этим платежным средством можно платить
|
|
|
|
|
*/
|
|
|
|
|
struct RecurrentPaymentToolHasAcquired {
|
|
|
|
|
1: required domain.Token token
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Рекуррентное платежное средство отозвано
|
|
|
|
|
*/
|
|
|
|
|
struct RecurrentPaymentToolHasAbandoned {}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* В процессе получения рекуррентного платежного средства произошла ошибка
|
|
|
|
|
*/
|
|
|
|
|
struct RecurrentPaymentToolHasFailed {
|
|
|
|
|
1: required domain.OperationFailure failure
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Exceptions
|
|
|
|
|
exception InvalidBinding {}
|
|
|
|
|
exception BindingNotFound {}
|
|
|
|
|
exception RecurrentPaymentToolNotFound {}
|
|
|
|
|
exception InvalidPaymentMethod {}
|
|
|
|
|
exception InvalidRecurrentPaymentToolStatus {
|
|
|
|
|
1: required RecurrentPaymentToolStatus status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
service RecurrentPaymentTools {
|
|
|
|
|
RecurrentPaymentTool Create (1: RecurrentPaymentToolParams params)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: InvalidPartyStatus invalid_party_status
|
|
|
|
|
3: InvalidShopStatus invalid_shop_status
|
|
|
|
|
4: ShopNotFound shop_not_found
|
|
|
|
|
5: PartyNotFound party_not_found
|
|
|
|
|
6: InvalidContractStatus invalid_contract_status
|
|
|
|
|
7: OperationNotPermitted operation_not_permitted
|
2017-11-22 10:21:20 +00:00
|
|
|
|
8: InvalidPaymentMethod invalid_payment_method
|
2017-10-23 12:00:48 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
RecurrentPaymentTool Abandon (1: RecurrentPaymentToolID id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: RecurrentPaymentToolNotFound rec_payment_tool_not_found
|
|
|
|
|
3: InvalidRecurrentPaymentToolStatus invalid_rec_payment_tool_status
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
RecurrentPaymentTool Get (1: RecurrentPaymentToolID id)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: RecurrentPaymentToolNotFound rec_payment_tool_not_found
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
RecurrentPaymentToolEvents GetEvents (1: RecurrentPaymentToolID id, 2: EventRange range)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser invalid_user
|
|
|
|
|
2: RecurrentPaymentToolNotFound rec_payment_tool_not_found
|
|
|
|
|
3: EventNotFound event_not_found
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exception NoLastEvent {}
|
|
|
|
|
|
|
|
|
|
service RecurrentPaymentToolEventSink {
|
|
|
|
|
RecurrentPaymentToolEvents GetEvents (1: EventRange range)
|
|
|
|
|
throws (1: EventNotFound ex1, 2: base.InvalidRequest ex2)
|
|
|
|
|
|
|
|
|
|
base.EventID GetLastEventID ()
|
|
|
|
|
throws (1: NoLastEvent ex1)
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
/* Party management service definitions */
|
|
|
|
|
|
|
|
|
|
// Types
|
|
|
|
|
|
|
|
|
|
typedef domain.PartyID PartyID
|
2018-09-17 13:18:37 +00:00
|
|
|
|
typedef domain.PartyRevision PartyRevision
|
2016-08-10 12:06:59 +00:00
|
|
|
|
typedef domain.ShopID ShopID
|
2017-09-27 12:47:14 +00:00
|
|
|
|
typedef domain.ContractID ContractID
|
2018-07-17 14:32:10 +00:00
|
|
|
|
typedef domain.ContractorID ContractorID
|
2018-02-26 12:14:59 +00:00
|
|
|
|
typedef domain.PayoutToolID PayoutToolID
|
2018-07-17 14:32:10 +00:00
|
|
|
|
typedef domain.WalletID WalletID
|
2018-01-19 13:44:26 +00:00
|
|
|
|
typedef domain.ContractTemplateRef ContractTemplateRef
|
|
|
|
|
typedef domain.PaymentInstitutionRef PaymentInstitutionRef
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
struct Varset {
|
|
|
|
|
1: optional domain.CategoryRef category
|
|
|
|
|
2: optional domain.CurrencyRef currency
|
|
|
|
|
3: optional domain.Cash amount
|
|
|
|
|
4: optional domain.PaymentMethodRef payment_method
|
|
|
|
|
5: optional domain.PayoutMethodRef payout_method
|
2018-10-15 12:49:08 +00:00
|
|
|
|
6: optional domain.WalletID wallet_id
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-17 13:12:35 +00:00
|
|
|
|
struct PartyParams {
|
|
|
|
|
1: required domain.PartyContactInfo contact_info
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
struct PayoutToolParams {
|
2016-12-09 12:05:35 +00:00
|
|
|
|
1: required domain.CurrencyRef currency
|
2017-01-20 09:16:31 +00:00
|
|
|
|
2: required domain.PayoutToolInfo tool_info
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShopParams {
|
2017-03-06 11:27:08 +00:00
|
|
|
|
1: optional domain.CategoryRef category
|
2017-07-17 10:21:41 +00:00
|
|
|
|
6: required domain.ShopLocation location
|
2016-08-10 12:06:59 +00:00
|
|
|
|
2: required domain.ShopDetails details
|
2017-09-27 12:47:14 +00:00
|
|
|
|
3: required ContractID contract_id
|
2017-01-20 09:16:31 +00:00
|
|
|
|
4: required domain.PayoutToolID payout_tool_id
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShopAccountParams {
|
|
|
|
|
1: required domain.CurrencyRef currency
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractParams {
|
2018-07-17 14:32:10 +00:00
|
|
|
|
4: optional ContractorID contractor_id
|
2018-01-19 13:44:26 +00:00
|
|
|
|
2: optional ContractTemplateRef template
|
|
|
|
|
3: optional PaymentInstitutionRef payment_institution
|
2018-07-17 14:32:10 +00:00
|
|
|
|
|
|
|
|
|
// depricated
|
|
|
|
|
1: optional domain.Contractor contractor
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractAdjustmentParams {
|
2018-01-19 13:44:26 +00:00
|
|
|
|
1: required ContractTemplateRef template
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union PartyModification {
|
2018-07-17 14:32:10 +00:00
|
|
|
|
8: ContractorModificationUnit contractor_modification
|
2016-12-09 12:05:35 +00:00
|
|
|
|
4: ContractModificationUnit contract_modification
|
|
|
|
|
6: ShopModificationUnit shop_modification
|
2018-07-17 14:32:10 +00:00
|
|
|
|
7: WalletModificationUnit wallet_modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractorModificationUnit {
|
|
|
|
|
1: required ContractorID id
|
|
|
|
|
2: required ContractorModification modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ContractorModification {
|
|
|
|
|
1: domain.Contractor creation
|
|
|
|
|
2: domain.ContractorIdentificationLevel identification_level_modification
|
|
|
|
|
3: ContractorIdentityDocumentsModification identity_documents_modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractorIdentityDocumentsModification {
|
|
|
|
|
1: required list<domain.IdentityDocumentToken> identity_documents
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractModificationUnit {
|
2017-09-27 12:47:14 +00:00
|
|
|
|
1: required ContractID id
|
2016-12-09 12:05:35 +00:00
|
|
|
|
2: required ContractModification modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ContractModification {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
1: ContractParams creation
|
|
|
|
|
2: ContractTermination termination
|
|
|
|
|
3: ContractAdjustmentModificationUnit adjustment_modification
|
|
|
|
|
4: PayoutToolModificationUnit payout_tool_modification
|
|
|
|
|
5: domain.LegalAgreement legal_agreement_binding
|
2018-05-16 13:03:37 +00:00
|
|
|
|
6: domain.ReportPreferences report_preferences_modification
|
2018-07-17 14:32:10 +00:00
|
|
|
|
7: ContractorID contractor_modification
|
2016-12-09 12:05:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractTermination {
|
|
|
|
|
2: optional string reason
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct ContractAdjustmentModificationUnit {
|
|
|
|
|
1: required domain.ContractAdjustmentID adjustment_id
|
|
|
|
|
2: required ContractAdjustmentModification modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ContractAdjustmentModification {
|
|
|
|
|
1: ContractAdjustmentParams creation
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PayoutToolModificationUnit {
|
|
|
|
|
1: required domain.PayoutToolID payout_tool_id
|
|
|
|
|
2: required PayoutToolModification modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union PayoutToolModification {
|
|
|
|
|
1: PayoutToolParams creation
|
2018-08-31 16:53:40 +00:00
|
|
|
|
2: domain.PayoutToolInfo info_modification
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
typedef list<PartyModification> PartyChangeset
|
|
|
|
|
|
|
|
|
|
struct ShopModificationUnit {
|
|
|
|
|
1: required ShopID id
|
2016-12-09 12:05:35 +00:00
|
|
|
|
2: required ShopModification modification
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ShopModification {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
5: ShopParams creation
|
|
|
|
|
6: domain.CategoryRef category_modification
|
|
|
|
|
7: domain.ShopDetails details_modification
|
|
|
|
|
8: ShopContractModification contract_modification
|
|
|
|
|
9: domain.PayoutToolID payout_tool_modification
|
|
|
|
|
11: domain.ShopLocation location_modification
|
|
|
|
|
12: ShopAccountParams shop_account_creation
|
2018-02-26 12:14:59 +00:00
|
|
|
|
13: ScheduleModification payout_schedule_modification
|
|
|
|
|
|
|
|
|
|
/* deprecated */
|
|
|
|
|
10: ProxyModification proxy_modification
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct ShopContractModification {
|
2017-09-27 12:47:14 +00:00
|
|
|
|
1: required ContractID contract_id
|
2017-07-17 10:21:41 +00:00
|
|
|
|
2: required domain.PayoutToolID payout_tool_id
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
struct ScheduleModification {
|
2018-05-16 13:03:37 +00:00
|
|
|
|
1: optional domain.BusinessScheduleRef schedule
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* deprecated */
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct ProxyModification {
|
|
|
|
|
1: optional domain.Proxy proxy
|
2017-01-13 14:24:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
struct WalletModificationUnit {
|
|
|
|
|
1: required WalletID id
|
|
|
|
|
2: required WalletModification modification
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union WalletModification {
|
|
|
|
|
1: WalletParams creation
|
|
|
|
|
2: WalletAccountParams account_creation
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct WalletParams {
|
|
|
|
|
1: optional string name
|
|
|
|
|
2: required ContractID contract_id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct WalletAccountParams {
|
|
|
|
|
1: required domain.CurrencyRef currency
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-13 14:24:47 +00:00
|
|
|
|
// Claims
|
|
|
|
|
|
2017-01-20 09:16:31 +00:00
|
|
|
|
typedef i64 ClaimID
|
2017-07-17 10:21:41 +00:00
|
|
|
|
typedef i32 ClaimRevision
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
|
|
|
|
struct Claim {
|
|
|
|
|
1: required ClaimID id
|
|
|
|
|
2: required ClaimStatus status
|
|
|
|
|
3: required PartyChangeset changeset
|
2017-07-17 10:21:41 +00:00
|
|
|
|
4: required ClaimRevision revision
|
|
|
|
|
5: required base.Timestamp created_at
|
|
|
|
|
6: optional base.Timestamp updated_at
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ClaimStatus {
|
|
|
|
|
1: ClaimPending pending
|
2016-09-09 10:11:33 +00:00
|
|
|
|
2: ClaimAccepted accepted
|
|
|
|
|
3: ClaimDenied denied
|
|
|
|
|
4: ClaimRevoked revoked
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ClaimPending {}
|
|
|
|
|
|
|
|
|
|
struct ClaimAccepted {
|
2017-07-17 10:21:41 +00:00
|
|
|
|
2: optional ClaimEffects effects
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ClaimDenied {
|
2017-09-14 12:59:29 +00:00
|
|
|
|
1: optional string reason
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-09-09 10:11:33 +00:00
|
|
|
|
struct ClaimRevoked {
|
2017-09-14 12:59:29 +00:00
|
|
|
|
1: optional string reason
|
2016-09-09 10:11:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
// Claim effects
|
|
|
|
|
|
|
|
|
|
typedef list<ClaimEffect> ClaimEffects
|
|
|
|
|
|
|
|
|
|
union ClaimEffect {
|
|
|
|
|
/* 1: PartyEffect Reserved for future */
|
|
|
|
|
2: ContractEffectUnit contract_effect
|
|
|
|
|
3: ShopEffectUnit shop_effect
|
2018-07-17 14:32:10 +00:00
|
|
|
|
4: ContractorEffectUnit contractor_effect
|
|
|
|
|
5: WalletEffectUnit wallet_effect
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractEffectUnit {
|
2017-09-27 12:47:14 +00:00
|
|
|
|
1: required ContractID contract_id
|
2017-07-17 10:21:41 +00:00
|
|
|
|
2: required ContractEffect effect
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ContractEffect {
|
|
|
|
|
1: domain.Contract created
|
|
|
|
|
2: domain.ContractStatus status_changed
|
|
|
|
|
3: domain.ContractAdjustment adjustment_created
|
2018-02-26 12:14:59 +00:00
|
|
|
|
4: domain.PayoutTool payout_tool_created
|
2018-09-13 14:50:10 +00:00
|
|
|
|
8: PayoutToolInfoChanged payout_tool_info_changed
|
2018-07-17 14:32:10 +00:00
|
|
|
|
5: domain.LegalAgreement legal_agreement_bound
|
2018-05-16 13:03:37 +00:00
|
|
|
|
6: domain.ReportPreferences report_preferences_changed
|
2018-07-17 14:32:10 +00:00
|
|
|
|
7: ContractorID contractor_changed
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShopEffectUnit {
|
|
|
|
|
1: required ShopID shop_id
|
|
|
|
|
2: required ShopEffect effect
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ShopEffect {
|
|
|
|
|
1: domain.Shop created
|
|
|
|
|
2: domain.CategoryRef category_changed
|
|
|
|
|
3: domain.ShopDetails details_changed
|
|
|
|
|
4: ShopContractChanged contract_changed
|
|
|
|
|
5: domain.PayoutToolID payout_tool_changed
|
|
|
|
|
7: domain.ShopLocation location_changed
|
|
|
|
|
8: domain.ShopAccount account_created
|
2018-02-26 12:14:59 +00:00
|
|
|
|
9: ScheduleChanged payout_schedule_changed
|
|
|
|
|
|
|
|
|
|
/* deprecated */
|
|
|
|
|
6: ShopProxyChanged proxy_changed
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShopContractChanged {
|
2017-09-27 12:47:14 +00:00
|
|
|
|
1: required ContractID contract_id
|
2017-07-17 10:21:41 +00:00
|
|
|
|
2: required domain.PayoutToolID payout_tool_id
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
struct ScheduleChanged {
|
2018-05-16 13:03:37 +00:00
|
|
|
|
1: optional domain.BusinessScheduleRef schedule
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
struct ContractorEffectUnit {
|
|
|
|
|
1: required ContractorID id
|
|
|
|
|
2: required ContractorEffect effect
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union ContractorEffect {
|
|
|
|
|
1: domain.PartyContractor created
|
|
|
|
|
2: domain.ContractorIdentificationLevel identification_level_changed
|
|
|
|
|
3: ContractorIdentityDocumentsChanged identity_documents_changed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractorIdentityDocumentsChanged {
|
|
|
|
|
1: required list<domain.IdentityDocumentToken> identity_documents
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-13 14:50:10 +00:00
|
|
|
|
struct PayoutToolInfoChanged {
|
|
|
|
|
1: required domain.PayoutToolID payout_tool_id
|
|
|
|
|
2: required domain.PayoutToolInfo info
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
struct WalletEffectUnit {
|
|
|
|
|
1: required WalletID id
|
|
|
|
|
2: required WalletEffect effect
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union WalletEffect {
|
|
|
|
|
1: domain.Wallet created
|
|
|
|
|
2: domain.WalletAccount account_created
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
/* deprecated */
|
2017-07-17 10:21:41 +00:00
|
|
|
|
struct ShopProxyChanged {
|
|
|
|
|
1: optional domain.Proxy proxy
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
struct AccountState {
|
2016-10-10 15:36:37 +00:00
|
|
|
|
1: required domain.AccountID account_id
|
|
|
|
|
2: required domain.Amount own_amount
|
|
|
|
|
3: required domain.Amount available_amount
|
|
|
|
|
4: required domain.Currency currency
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
// Events
|
2018-01-19 13:44:26 +00:00
|
|
|
|
// changes, marked by '#' may affect Party state and may produce PartyRevisionChanged change as well
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
union PartyChange {
|
2018-01-19 13:44:26 +00:00
|
|
|
|
1: PartyCreated party_created // #
|
|
|
|
|
4: domain.Blocking party_blocking // #
|
|
|
|
|
5: domain.Suspension party_suspension // #
|
|
|
|
|
6: ShopBlocking shop_blocking // #
|
|
|
|
|
7: ShopSuspension shop_suspension // #
|
2018-07-17 14:32:10 +00:00
|
|
|
|
12: WalletBlocking wallet_blocking // #
|
|
|
|
|
13: WalletSuspension wallet_suspension // #
|
2017-07-17 10:21:41 +00:00
|
|
|
|
2: Claim claim_created
|
2018-01-19 13:44:26 +00:00
|
|
|
|
3: ClaimStatusChanged claim_status_changed // #
|
2017-07-17 10:21:41 +00:00
|
|
|
|
8: ClaimUpdated claim_updated
|
2017-08-03 10:48:31 +00:00
|
|
|
|
9: PartyMetaSet party_meta_set
|
|
|
|
|
10: domain.PartyMetaNamespace party_meta_removed
|
2018-01-19 13:44:26 +00:00
|
|
|
|
11: PartyRevisionChanged revision_changed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct PartyCreated {
|
|
|
|
|
1: required PartyID id
|
|
|
|
|
7: required domain.PartyContactInfo contact_info
|
|
|
|
|
8: required base.Timestamp created_at
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShopBlocking {
|
|
|
|
|
1: required ShopID shop_id
|
|
|
|
|
2: required domain.Blocking blocking
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShopSuspension {
|
|
|
|
|
1: required ShopID shop_id
|
|
|
|
|
2: required domain.Suspension suspension
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
struct WalletBlocking {
|
|
|
|
|
1: required WalletID wallet_id
|
|
|
|
|
2: required domain.Blocking blocking
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct WalletSuspension {
|
|
|
|
|
1: required WalletID wallet_id
|
|
|
|
|
2: required domain.Suspension suspension
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
struct ClaimStatusChanged {
|
|
|
|
|
1: required ClaimID id
|
|
|
|
|
2: required ClaimStatus status
|
2017-07-17 10:21:41 +00:00
|
|
|
|
3: required ClaimRevision revision
|
|
|
|
|
4: required base.Timestamp changed_at
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ClaimUpdated {
|
|
|
|
|
1: required ClaimID id
|
|
|
|
|
2: required PartyChangeset changeset
|
|
|
|
|
3: required ClaimRevision revision
|
|
|
|
|
4: required base.Timestamp updated_at
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-03 10:48:31 +00:00
|
|
|
|
struct PartyMetaSet {
|
|
|
|
|
1: required domain.PartyMetaNamespace ns
|
|
|
|
|
2: required domain.PartyMetaData data
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
struct PartyRevisionChanged {
|
|
|
|
|
1: required base.Timestamp timestamp
|
|
|
|
|
2: required domain.PartyRevision revision
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union PartyRevisionParam {
|
|
|
|
|
1: base.Timestamp timestamp
|
|
|
|
|
2: domain.PartyRevision revision
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
struct PayoutParams {
|
|
|
|
|
1: required ShopID id
|
|
|
|
|
2: required domain.Cash amount
|
|
|
|
|
3: required base.Timestamp timestamp
|
2018-12-10 11:00:35 +00:00
|
|
|
|
4: optional domain.PayoutToolID payout_tool_id
|
2018-02-26 12:14:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
// Exceptions
|
|
|
|
|
|
|
|
|
|
exception PartyExists {}
|
2017-01-20 09:16:31 +00:00
|
|
|
|
exception ContractNotFound {}
|
2017-07-17 10:21:41 +00:00
|
|
|
|
exception ClaimNotFound {}
|
|
|
|
|
exception InvalidClaimRevision {}
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
|
|
|
|
exception InvalidClaimStatus {
|
|
|
|
|
1: required ClaimStatus status
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
exception ChangesetConflict { 1: required ClaimID conflicted_id }
|
|
|
|
|
exception InvalidChangeset { 1: required InvalidChangesetReason reason }
|
|
|
|
|
|
|
|
|
|
union InvalidChangesetReason {
|
2018-04-19 16:44:56 +00:00
|
|
|
|
1: InvalidContract invalid_contract
|
|
|
|
|
2: InvalidShop invalid_shop
|
2018-07-17 14:32:10 +00:00
|
|
|
|
3: InvalidWallet invalid_wallet
|
|
|
|
|
4: InvalidContractor invalid_contractor
|
2018-04-19 16:44:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvalidContract {
|
|
|
|
|
1: required ContractID id
|
|
|
|
|
2: required InvalidContractReason reason
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvalidShop {
|
|
|
|
|
1: required ShopID id
|
|
|
|
|
2: required InvalidShopReason reason
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
struct InvalidWallet {
|
|
|
|
|
1: required WalletID id
|
|
|
|
|
2: required InvalidWalletReason reason
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct InvalidContractor {
|
|
|
|
|
1: required ContractorID id
|
|
|
|
|
2: required InvalidContractorReason reason
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-19 16:44:56 +00:00
|
|
|
|
union InvalidContractReason {
|
|
|
|
|
1: ContractID not_exists
|
|
|
|
|
2: ContractID already_exists
|
|
|
|
|
3: domain.ContractStatus invalid_status
|
2017-07-17 10:21:41 +00:00
|
|
|
|
4: domain.ContractAdjustmentID contract_adjustment_already_exists
|
|
|
|
|
5: domain.PayoutToolID payout_tool_not_exists
|
|
|
|
|
6: domain.PayoutToolID payout_tool_already_exists
|
2018-04-19 16:44:56 +00:00
|
|
|
|
7: InvalidObjectReference invalid_object_reference
|
2018-07-17 14:32:10 +00:00
|
|
|
|
8: ContractorNotExists contractor_not_exists
|
2018-04-19 16:44:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union InvalidShopReason {
|
|
|
|
|
1: ShopID not_exists
|
|
|
|
|
2: ShopID already_exists
|
|
|
|
|
3: ShopID no_account
|
|
|
|
|
4: InvalidStatus invalid_status
|
|
|
|
|
5: ContractTermsViolated contract_terms_violated
|
|
|
|
|
6: ShopPayoutToolInvalid payout_tool_invalid
|
|
|
|
|
7: InvalidObjectReference invalid_object_reference
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
union InvalidWalletReason {
|
|
|
|
|
1: WalletID not_exists
|
|
|
|
|
2: WalletID already_exists
|
|
|
|
|
3: WalletID no_account
|
|
|
|
|
4: InvalidStatus invalid_status
|
|
|
|
|
5: ContractTermsViolated contract_terms_violated
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
union InvalidContractorReason {
|
|
|
|
|
1: ContractorID not_exists
|
|
|
|
|
2: ContractorID already_exists
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ContractorNotExists {
|
|
|
|
|
1: optional ContractorID id
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-19 16:44:56 +00:00
|
|
|
|
struct ContractTermsViolated {
|
2017-09-27 12:47:14 +00:00
|
|
|
|
1: required ContractID contract_id
|
2018-04-19 16:44:56 +00:00
|
|
|
|
2: required domain.TermSet terms
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-04-19 16:44:56 +00:00
|
|
|
|
struct ShopPayoutToolInvalid {
|
|
|
|
|
1: optional domain.PayoutToolID payout_tool_id
|
2017-07-17 10:21:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-04-19 16:44:56 +00:00
|
|
|
|
struct InvalidObjectReference {
|
|
|
|
|
1: optional domain.Reference ref
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-14 19:03:43 +00:00
|
|
|
|
exception AccountNotFound {}
|
2016-10-10 15:36:37 +00:00
|
|
|
|
|
2017-01-11 14:33:44 +00:00
|
|
|
|
exception ShopAccountNotFound {}
|
2016-10-10 15:36:37 +00:00
|
|
|
|
|
2017-08-03 10:48:31 +00:00
|
|
|
|
exception PartyMetaNamespaceNotFound {}
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
exception PaymentInstitutionNotFound {}
|
|
|
|
|
|
|
|
|
|
exception ContractTemplateNotFound {}
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
// Service
|
|
|
|
|
|
|
|
|
|
service PartyManagement {
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/* Party */
|
|
|
|
|
|
2017-01-17 13:12:35 +00:00
|
|
|
|
void Create (1: UserInfo user, 2: PartyID party_id, 3: PartyParams params)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyExists ex2)
|
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
domain.Party Get (1: UserInfo user, 2: PartyID party_id)
|
2018-09-18 11:59:25 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2)
|
|
|
|
|
|
|
|
|
|
PartyRevision GetRevision (1: UserInfo user, 2: PartyID party_id)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2)
|
|
|
|
|
|
2018-01-19 13:44:26 +00:00
|
|
|
|
domain.Party Checkout (1: UserInfo user, 2: PartyID party_id, 3: PartyRevisionParam revision)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyRevision ex3)
|
2017-06-16 11:59:04 +00:00
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
void Suspend (1: UserInfo user, 2: PartyID party_id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
void Activate (1: UserInfo user, 2: PartyID party_id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
void Block (1: UserInfo user, 2: PartyID party_id, 3: string reason)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
|
2017-01-20 09:16:31 +00:00
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
void Unblock (1: UserInfo user, 2: PartyID party_id, 3: string reason)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: InvalidPartyStatus ex3)
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
2017-08-03 10:48:31 +00:00
|
|
|
|
/* Party Meta */
|
|
|
|
|
|
|
|
|
|
domain.PartyMeta GetMeta (1: UserInfo user, 2: PartyID party_id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2)
|
|
|
|
|
|
|
|
|
|
domain.PartyMetaData GetMetaData (1: UserInfo user, 2: PartyID party_id, 3: domain.PartyMetaNamespace ns)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyMetaNamespaceNotFound ex3)
|
|
|
|
|
|
|
|
|
|
void SetMetaData (1: UserInfo user, 2: PartyID party_id, 3: domain.PartyMetaNamespace ns, 4: domain.PartyMetaData data)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2)
|
|
|
|
|
|
|
|
|
|
void RemoveMetaData (1: UserInfo user, 2: PartyID party_id, 3: domain.PartyMetaNamespace ns)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyMetaNamespaceNotFound ex3)
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/* Contract */
|
2016-12-09 12:05:35 +00:00
|
|
|
|
|
2017-09-27 12:47:14 +00:00
|
|
|
|
domain.Contract GetContract (1: UserInfo user, 2: PartyID party_id, 3: ContractID contract_id)
|
2016-12-09 12:05:35 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
3: ContractNotFound ex3
|
2016-12-09 12:05:35 +00:00
|
|
|
|
)
|
|
|
|
|
|
2017-09-27 12:47:14 +00:00
|
|
|
|
domain.TermSet ComputeContractTerms (1: UserInfo user, 2: PartyID party_id, 3: ContractID id, 4: base.Timestamp timestamp)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyNotExistsYet ex3, 4: ContractNotFound ex4)
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/* Shop */
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
2016-12-09 12:05:35 +00:00
|
|
|
|
domain.Shop GetShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3)
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
void SuspendShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id)
|
2017-07-17 10:21:41 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: InvalidShopStatus ex4)
|
|
|
|
|
|
|
|
|
|
void ActivateShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: InvalidShopStatus ex4)
|
|
|
|
|
|
|
|
|
|
void BlockShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id, 4: string reason)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: InvalidShopStatus ex4)
|
|
|
|
|
|
|
|
|
|
void UnblockShop (1: UserInfo user, 2: PartyID party_id, 3: ShopID id, 4: string reason)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: InvalidShopStatus ex4)
|
|
|
|
|
|
2017-09-27 12:47:14 +00:00
|
|
|
|
domain.TermSet ComputeShopTerms (1: UserInfo user, 2: PartyID party_id, 3: ShopID id, 4: base.Timestamp timestamp)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyNotExistsYet ex3, 4: ShopNotFound ex4)
|
|
|
|
|
|
2018-07-17 14:32:10 +00:00
|
|
|
|
/* Wallet */
|
|
|
|
|
|
2018-10-15 12:49:08 +00:00
|
|
|
|
// temporary method for transfer period
|
|
|
|
|
// do not use
|
|
|
|
|
domain.TermSet ComputeWalletTermsNew (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: PartyID party_id,
|
|
|
|
|
3: ContractID contract_id,
|
|
|
|
|
4: base.Timestamp timestamp
|
|
|
|
|
5: Varset varset
|
|
|
|
|
)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyNotExistsYet ex3)
|
|
|
|
|
|
|
|
|
|
// deprecated
|
2018-08-21 21:19:27 +00:00
|
|
|
|
domain.TermSet ComputeWalletTerms (
|
|
|
|
|
1: UserInfo user,
|
|
|
|
|
2: PartyID party_id,
|
|
|
|
|
3: ContractID contract_id,
|
|
|
|
|
4: WalletID wallet_id,
|
|
|
|
|
5: domain.CurrencyRef currency,
|
|
|
|
|
6: base.Timestamp timestamp
|
|
|
|
|
)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PartyNotExistsYet ex3)
|
2018-07-17 14:32:10 +00:00
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
/* Claim */
|
|
|
|
|
|
|
|
|
|
Claim CreateClaim (1: UserInfo user, 2: PartyID party_id, 3: PartyChangeset changeset)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
3: InvalidPartyStatus ex3,
|
|
|
|
|
4: ChangesetConflict ex4,
|
|
|
|
|
5: InvalidChangeset ex5,
|
2016-08-10 12:06:59 +00:00
|
|
|
|
6: base.InvalidRequest ex6
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
Claim GetClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ClaimNotFound ex3)
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
list<Claim> GetClaims (1: UserInfo user, 2: PartyID party_id)
|
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
void AcceptClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id, 4: ClaimRevision revision)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ClaimNotFound ex3,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
4: InvalidClaimStatus ex4,
|
|
|
|
|
5: InvalidClaimRevision ex5,
|
|
|
|
|
6: InvalidChangeset ex6
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
void UpdateClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id, 4: ClaimRevision revision, 5: PartyChangeset changeset)
|
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: InvalidPartyStatus ex3,
|
|
|
|
|
4: ClaimNotFound ex4,
|
|
|
|
|
5: InvalidClaimStatus ex5,
|
|
|
|
|
6: InvalidClaimRevision ex6,
|
|
|
|
|
7: ChangesetConflict ex7,
|
|
|
|
|
8: InvalidChangeset ex8,
|
|
|
|
|
9: base.InvalidRequest ex9
|
2016-08-10 12:06:59 +00:00
|
|
|
|
)
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
void DenyClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id, 4: ClaimRevision revision, 5: string reason)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: ClaimNotFound ex3,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
4: InvalidClaimStatus ex4,
|
|
|
|
|
5: InvalidClaimRevision ex5
|
2016-08-10 12:06:59 +00:00
|
|
|
|
)
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
void RevokeClaim (1: UserInfo user, 2: PartyID party_id, 3: ClaimID id, 4: ClaimRevision revision, 5: string reason)
|
2016-09-09 10:11:33 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: InvalidPartyStatus ex3,
|
|
|
|
|
4: ClaimNotFound ex4,
|
2017-07-17 10:21:41 +00:00
|
|
|
|
5: InvalidClaimStatus ex5,
|
|
|
|
|
6: InvalidClaimRevision ex6
|
2016-09-09 10:11:33 +00:00
|
|
|
|
)
|
|
|
|
|
|
2016-08-10 12:06:59 +00:00
|
|
|
|
/* Event polling */
|
|
|
|
|
|
2017-07-17 10:21:41 +00:00
|
|
|
|
Events GetEvents (1: UserInfo user, 2: PartyID party_id, 3: EventRange range)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: EventNotFound ex3,
|
|
|
|
|
4: base.InvalidRequest ex4
|
|
|
|
|
)
|
|
|
|
|
|
2016-10-10 15:36:37 +00:00
|
|
|
|
/* Accounts */
|
|
|
|
|
|
2016-12-14 11:09:57 +00:00
|
|
|
|
domain.ShopAccount GetShopAccount (1: UserInfo user, 2: PartyID party_id, 3: ShopID shop_id)
|
2017-01-11 14:33:44 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: ShopNotFound ex3, 4: ShopAccountNotFound ex4)
|
2016-12-14 11:09:57 +00:00
|
|
|
|
|
|
|
|
|
AccountState GetAccountState (1: UserInfo user, 2: PartyID party_id, 3: domain.AccountID account_id)
|
2016-10-10 15:36:37 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: AccountNotFound ex3)
|
2018-01-19 13:44:26 +00:00
|
|
|
|
|
|
|
|
|
/* Payment institutions */
|
|
|
|
|
|
2018-02-26 12:14:59 +00:00
|
|
|
|
domain.TermSet ComputePaymentInstitutionTerms (1: UserInfo user, 2: PartyID party_id, 3: PaymentInstitutionRef ref, 4: Varset varset)
|
2018-01-19 13:44:26 +00:00
|
|
|
|
throws (1: InvalidUser ex1, 2: PartyNotFound ex2, 3: PaymentInstitutionNotFound ex3)
|
2018-02-26 12:14:59 +00:00
|
|
|
|
|
|
|
|
|
/* Payouts */
|
|
|
|
|
/* TODO looks like adhoc. Rework after feedback. Or not. */
|
|
|
|
|
domain.FinalCashFlow ComputePayoutCashFlow (1: UserInfo user, 2: PartyID party_id, 3: PayoutParams params)
|
2018-12-10 11:00:35 +00:00
|
|
|
|
throws (
|
|
|
|
|
1: InvalidUser ex1,
|
|
|
|
|
2: PartyNotFound ex2,
|
|
|
|
|
3: PartyNotExistsYet ex3,
|
|
|
|
|
4: ShopNotFound ex4,
|
|
|
|
|
5: OperationNotPermitted ex5,
|
|
|
|
|
6: PayoutToolNotFound ex6
|
|
|
|
|
)
|
2016-08-10 12:06:59 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-16 15:07:06 +00:00
|
|
|
|
/* Event sink service definitions */
|
|
|
|
|
|
|
|
|
|
service EventSink {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Получить последовательный набор событий из истории системы, от более
|
|
|
|
|
* ранних к более поздним, из диапазона, заданного `range`. Результат
|
|
|
|
|
* выполнения запроса может содержать от `0` до `range.limit` событий.
|
|
|
|
|
*
|
|
|
|
|
* Если в `range.after` указан идентификатор неизвестного события, то есть
|
|
|
|
|
* события, не наблюдаемого клиентом ранее в известной ему истории,
|
|
|
|
|
* бросится исключение `EventNotFound`.
|
|
|
|
|
*/
|
|
|
|
|
Events GetEvents (1: EventRange range)
|
|
|
|
|
throws (1: EventNotFound ex1, 2: base.InvalidRequest ex2)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Получить идентификатор наиболее позднего известного на момент исполнения
|
|
|
|
|
* запроса события.
|
|
|
|
|
*/
|
|
|
|
|
base.EventID GetLastEventID ()
|
|
|
|
|
throws (1: NoLastEvent ex1)
|
|
|
|
|
|
|
|
|
|
}
|