outbox for gateways
This commit is contained in:
@@ -16,6 +16,7 @@ enum PaymentMethodType {
|
||||
PAYMENT_METHOD_TYPE_WALLET = 5;
|
||||
PAYMENT_METHOD_TYPE_CRYPTO_ADDRESS = 6;
|
||||
PAYMENT_METHOD_TYPE_LEDGER = 7;
|
||||
PAYMENT_METHOD_TYPE_ACCOUNT = 8;
|
||||
}
|
||||
|
||||
message PaymentMethod {
|
||||
|
||||
@@ -26,6 +26,25 @@ message GetPaymentMethodResponse {
|
||||
payments.endpoint.v1.PaymentMethodRecord payment_method_record = 1;
|
||||
}
|
||||
|
||||
message GetPaymentMethodPrivateRequest {
|
||||
string organization_ref = 1;
|
||||
oneof selector {
|
||||
string payment_method_ref = 2;
|
||||
string payee_ref = 3;
|
||||
}
|
||||
PrivateEndpoint endpoint = 4;
|
||||
}
|
||||
|
||||
enum PrivateEndpoint {
|
||||
PRIVATE_ENDPOINT_UNSPECIFIED = 0;
|
||||
PRIVATE_ENDPOINT_SOURCE = 1;
|
||||
PRIVATE_ENDPOINT_DESTINATION = 2;
|
||||
}
|
||||
|
||||
message GetPaymentMethodPrivateResponse {
|
||||
payments.endpoint.v1.PaymentMethodRecord payment_method_record = 1;
|
||||
}
|
||||
|
||||
message UpdatePaymentMethodRequest {
|
||||
string account_ref = 1;
|
||||
payments.endpoint.v1.PaymentMethodRecord payment_method_record = 2;
|
||||
@@ -78,4 +97,6 @@ service PaymentMethodsService {
|
||||
rpc SetPaymentMethodArchived(SetPaymentMethodArchivedRequest) returns (SetPaymentMethodArchivedResponse);
|
||||
// ListPaymentMethods retrieves a list of payment methods.
|
||||
rpc ListPaymentMethods(ListPaymentMethodsRequest) returns (ListPaymentMethodsResponse);
|
||||
// GetPaymentMethodPrivate retrieves a payment method without permission checks.
|
||||
rpc GetPaymentMethodPrivate(GetPaymentMethodPrivateRequest) returns (GetPaymentMethodPrivateResponse);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ option go_package = "github.com/tech/sendico/pkg/proto/payments/quotation/v2;quo
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "api/proto/common/storable/v1/storable.proto";
|
||||
import "api/proto/common/money/v1/money.proto";
|
||||
import "api/proto/common/fx/v1/fx.proto";
|
||||
import "api/proto/billing/fees/v1/fees.proto";
|
||||
import "api/proto/oracle/v1/oracle.proto";
|
||||
|
||||
@@ -18,11 +17,11 @@ enum QuoteKind {
|
||||
QUOTE_KIND_INDICATIVE = 2; // informational only
|
||||
}
|
||||
|
||||
enum QuoteState {
|
||||
QUOTE_STATE_UNSPECIFIED = 0;
|
||||
enum QuoteLifecycle {
|
||||
QUOTE_LIFECYCLE_UNSPECIFIED = 0;
|
||||
|
||||
QUOTE_STATE_ACTIVE = 1;
|
||||
QUOTE_STATE_EXPIRED = 2;
|
||||
QUOTE_LIFECYCLE_ACTIVE = 1;
|
||||
QUOTE_LIFECYCLE_EXPIRED = 2;
|
||||
}
|
||||
|
||||
enum QuoteBlockReason {
|
||||
@@ -37,12 +36,68 @@ enum QuoteBlockReason {
|
||||
QUOTE_BLOCK_REASON_AMOUNT_TOO_LARGE = 7;
|
||||
}
|
||||
|
||||
enum QuoteExecutionReadiness {
|
||||
QUOTE_EXECUTION_READINESS_UNSPECIFIED = 0;
|
||||
QUOTE_EXECUTION_READINESS_LIQUIDITY_READY = 1;
|
||||
QUOTE_EXECUTION_READINESS_LIQUIDITY_OBTAINABLE = 2;
|
||||
QUOTE_EXECUTION_READINESS_INDICATIVE = 3;
|
||||
}
|
||||
|
||||
enum RouteHopRole {
|
||||
ROUTE_HOP_ROLE_UNSPECIFIED = 0;
|
||||
ROUTE_HOP_ROLE_SOURCE = 1;
|
||||
ROUTE_HOP_ROLE_TRANSIT = 2;
|
||||
ROUTE_HOP_ROLE_DESTINATION = 3;
|
||||
}
|
||||
|
||||
message RouteHop {
|
||||
uint32 index = 1;
|
||||
string rail = 2;
|
||||
string gateway = 3;
|
||||
string instance_id = 4;
|
||||
string network = 5;
|
||||
RouteHopRole role = 6;
|
||||
}
|
||||
|
||||
// Abstract execution route selected during quotation.
|
||||
// This is not an execution plan and must not contain operational steps.
|
||||
message RouteSpecification {
|
||||
string rail = 1;
|
||||
string provider = 2;
|
||||
string payout_method = 3;
|
||||
string settlement_asset = 4;
|
||||
string settlement_model = 5;
|
||||
string network = 6;
|
||||
string route_ref = 7;
|
||||
string pricing_profile_ref = 8;
|
||||
repeated RouteHop hops = 9;
|
||||
}
|
||||
|
||||
// Execution assumptions and constraints evaluated at quotation time.
|
||||
// Operational planning is performed by the execution layer later.
|
||||
message ExecutionConditions {
|
||||
QuoteExecutionReadiness readiness = 1;
|
||||
bool batching_eligible = 2;
|
||||
bool prefunding_required = 3;
|
||||
bool prefunding_cost_included = 4;
|
||||
bool liquidity_check_required_at_execution = 5;
|
||||
string latency_hint = 6;
|
||||
repeated string assumptions = 7;
|
||||
}
|
||||
|
||||
message PaymentQuote {
|
||||
common.storable.v1.Storable storable = 1;
|
||||
QuoteKind kind = 2;
|
||||
QuoteState state = 3;
|
||||
optional QuoteBlockReason block_reason = 4;
|
||||
QuoteLifecycle lifecycle = 3;
|
||||
|
||||
// Execution-status rules:
|
||||
// 1) kind=QUOTE_KIND_INDICATIVE => execution_status must be unset.
|
||||
// 2) lifecycle=QUOTE_LIFECYCLE_EXPIRED => execution_status must be unset.
|
||||
// 3) kind=QUOTE_KIND_EXECUTABLE and lifecycle=QUOTE_LIFECYCLE_ACTIVE => execution_status must be set.
|
||||
oneof execution_status {
|
||||
bool executable = 13; // must be true when set
|
||||
QuoteBlockReason block_reason = 4;
|
||||
}
|
||||
|
||||
common.money.v1.Money debit_amount = 5;
|
||||
common.money.v1.Money credit_amount = 6;
|
||||
@@ -56,4 +111,8 @@ message PaymentQuote {
|
||||
|
||||
google.protobuf.Timestamp expires_at = 11;
|
||||
google.protobuf.Timestamp priced_at = 12;
|
||||
|
||||
RouteSpecification route = 14;
|
||||
ExecutionConditions execution_conditions = 15;
|
||||
common.money.v1.Money total_cost = 16;
|
||||
}
|
||||
|
||||
@@ -35,3 +35,11 @@ message QuotePaymentsResponse {
|
||||
repeated payments.quotation.v2.PaymentQuote quotes = 3;
|
||||
string idempotency_key = 4;
|
||||
}
|
||||
|
||||
// Quotation service interface
|
||||
service QuotationService {
|
||||
// QuotePayment returns a quote for a single payment request.
|
||||
rpc QuotePayment(QuotePaymentRequest) returns (QuotePaymentResponse);
|
||||
// QuotePayments returns quotes for multiple payment requests.
|
||||
rpc QuotePayments(QuotePaymentsRequest) returns (QuotePaymentsResponse);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ package payments.transfer.v1;
|
||||
option go_package = "github.com/tech/sendico/pkg/proto/payments/transfer/v1;transferv1";
|
||||
|
||||
import "api/proto/common/money/v1/money.proto";
|
||||
import "api/proto/common/storable/v1/storable.proto";
|
||||
import "api/proto/payments/endpoint/v1/endpoint.proto";
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user