From b059a28dc1ed8fc4f3382e5642e91ff066d27510 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Thu, 20 Oct 2016 13:47:12 +0300 Subject: [PATCH] HG-64: Expand proxy context + discard terminal descriptors (#78) * HG-64: Expand proxy context + favor options instead of terminal descriptors * HG-64: Add a TODO bullet * HG-64: Fix compilation issue --- TODO.md | 15 ++++++++++++--- proto/domain.thrift | 23 ++++++++++------------- proto/proxy_provider.thrift | 34 ++++++++++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/TODO.md b/TODO.md index 8f27d78..2987b9c 100644 --- a/TODO.md +++ b/TODO.md @@ -1,8 +1,17 @@ # Payments - * Way to specify terminals (terminal descriptor) for a specific merchant + * What to do with terminal descriptors? + + They seemed out of place, therefore been removed for the moment. We need to encompass too much in a single abstraction, looks like we need dynamic schemas for this kind of thing. + + * Way to specify terminal attributes (more generally, attributes of technical interaction) for a specific merchant. + + * Some proxies need to know provider profit / compensation. + + Expose cash flow? # Proxies - * Billing address, for foreign customers (payment session?) - * Provide shop in a payment context + * In order to acquire foreign customers we need to store a _billing address_. + + Maybe a good fit for a payment session? diff --git a/proto/domain.thrift b/proto/domain.thrift index 6c30e22..9383bda 100644 --- a/proto/domain.thrift +++ b/proto/domain.thrift @@ -255,7 +255,7 @@ struct Contractor { } /** Форма юридического лица. */ -union LegalEntity { +struct LegalEntity { } @@ -267,10 +267,16 @@ struct BankAccount { struct CategoryRef { 1: required ObjectID id } +enum CategoryType { + test + live +} + /** Категория продаваемых товаров или услуг. */ struct Category { 1: required string name - 2: required string description = "" + 2: required string description + 3: optional CategoryType type = CategoryType.test } /* Currencies */ @@ -480,7 +486,8 @@ struct Terminal { 4: required CategoryRef category 6: required CashFlow cash_flow 7: required TerminalAccountSet accounts - 8: optional TerminalDescriptor descriptor + // TODO + // 8: optional TerminalDescriptor descriptor 9: optional ProxyOptions options = {} } @@ -500,16 +507,6 @@ struct TerminalPredicate { 2: required TerminalSelector then_ } -union TerminalDescriptor { - 1: AcquiringTerminalDescriptor acquiring -} - -struct AcquiringTerminalDescriptor { - 1: required string terminal_id - 2: required string merchant_id - 3: required string mcc -} - /* Predicates / conditions */ union Predicate { diff --git a/proto/proxy_provider.thrift b/proto/proxy_provider.thrift index daa5da3..86c5bba 100644 --- a/proto/proxy_provider.thrift +++ b/proto/proxy_provider.thrift @@ -3,6 +3,7 @@ include "proxy.thrift" include "domain.thrift" namespace java com.rbkmoney.damsel.proxy_provider +namespace erlang prxprv typedef base.Opaque Callback typedef base.Opaque CallbackResponse @@ -11,8 +12,37 @@ typedef base.Opaque CallbackResponse * Данные платежа, необходимые для обращения к провайдеру. */ struct PaymentInfo { - 1: required domain.Invoice invoice - 2: required domain.InvoicePayment payment + 1: required Shop shop + 2: required Invoice invoice + 3: required InvoicePayment payment +} + +struct Shop { + 1: required domain.ShopID id + 2: required domain.Category category + 3: required domain.ShopDetails details +} + +struct Invoice { + 1: required domain.InvoiceID id + 2: required base.Timestamp created_at + 3: required base.Timestamp due + 4: required string product + 5: optional string description + 6: required Cash cost +} + +struct InvoicePayment { + 1: required domain.InvoicePaymentID id + 2: required base.Timestamp created_at + 3: optional domain.TransactionInfo trx + 4: required domain.Payer payer + 5: required Cash cost +} + +struct Cash { + 1: required domain.Amount amount + 2: required domain.Currency currency } /**