neq quotation definition + priced_at field

This commit is contained in:
Stephan D
2026-02-13 15:35:17 +01:00
parent da1636014b
commit 52c4c046c9
85 changed files with 1180 additions and 162 deletions

View File

@@ -0,0 +1,40 @@
syntax = "proto3";
package payments.endpoint.v1;
option go_package = "github.com/tech/sendico/pkg/proto/payments/endpoint/v1;endpointv1";
import "api/proto/common/describable/v1/describable.proto";
import "api/proto/common/permission_bound/v1/pbound.proto";
enum PaymentMethodType {
PAYMENT_METHOD_TYPE_UNSPECIFIED = 0;
PAYMENT_METHOD_TYPE_IBAN = 1;
PAYMENT_METHOD_TYPE_CARD = 2;
PAYMENT_METHOD_TYPE_CARD_TOKEN = 3;
PAYMENT_METHOD_TYPE_BANK_ACCOUNT = 4;
PAYMENT_METHOD_TYPE_WALLET = 5;
PAYMENT_METHOD_TYPE_CRYPTO_ADDRESS = 6;
PAYMENT_METHOD_TYPE_LEDGER = 7;
}
message PaymentMethod {
common.describable.v1.Describable describable = 1;
string recipient_ref = 2;
PaymentMethodType type = 3;
bytes data = 4;
bool is_main = 5;
}
message PaymentEndpoint {
oneof source {
string payment_method_ref = 1;
PaymentMethod payment_method = 2;
string payee_ref = 3;
}
}
message PaymentMethodRecord {
common.pbound.v1.PermissionBound permission_bound = 1;
PaymentMethod payment_method = 2;
}

View File

@@ -4,18 +4,17 @@ package payments.methods.v1;
option go_package = "github.com/tech/sendico/pkg/proto/payments/methods/v1;methodsv1";
import "google/protobuf/wrappers.proto";
import "common/pagination/v2/cursor.proto";
import "api/proto/common/pagination/v2/cursor.proto";
import "api/proto/payments/endpoint/v1/endpoint.proto";
message CreatePaymentMethodRequest {
string account_ref = 1;
string organization_ref = 2;
bytes payment_method_json = 3;
payments.endpoint.v1.PaymentMethod payment_method = 3;
}
message CreatePaymentMethodResponse {
bytes payment_method_json = 1;
payments.endpoint.v1.PaymentMethodRecord payment_method_record = 1;
}
message GetPaymentMethodRequest {
@@ -24,16 +23,16 @@ message GetPaymentMethodRequest {
}
message GetPaymentMethodResponse {
bytes payment_method_json = 1;
payments.endpoint.v1.PaymentMethodRecord payment_method_record = 1;
}
message UpdatePaymentMethodRequest {
string account_ref = 1;
bytes payment_method_json = 2;
payments.endpoint.v1.PaymentMethodRecord payment_method_record = 2;
}
message UpdatePaymentMethodResponse {
bytes payment_method_json = 1;
payments.endpoint.v1.PaymentMethodRecord payment_method_record = 1;
}
message DeletePaymentMethodRequest {
@@ -62,14 +61,21 @@ message ListPaymentMethodsRequest {
}
message ListPaymentMethodsResponse {
repeated bytes payment_methods_json = 1;
repeated payments.endpoint.v1.PaymentMethodRecord payment_methods = 1;
}
// PaymentMethodsService provides operations for managing payment methods.
service PaymentMethodsService {
// CreatePaymentMethod creates a new payment method.
rpc CreatePaymentMethod(CreatePaymentMethodRequest) returns (CreatePaymentMethodResponse);
// GetPaymentMethod retrieves a payment method by reference.
rpc GetPaymentMethod(GetPaymentMethodRequest) returns (GetPaymentMethodResponse);
// UpdatePaymentMethod updates an existing payment method.
rpc UpdatePaymentMethod(UpdatePaymentMethodRequest) returns (UpdatePaymentMethodResponse);
// Delete exising payment method
rpc DeletePaymentMethod(DeletePaymentMethodRequest) returns (DeletePaymentMethodResponse);
// SetPaymentMethodArchived sets the archived status of a payment method.
rpc SetPaymentMethodArchived(SetPaymentMethodArchivedRequest) returns (SetPaymentMethodArchivedResponse);
// ListPaymentMethods retrieves a list of payment methods.
rpc ListPaymentMethods(ListPaymentMethodsRequest) returns (ListPaymentMethodsResponse);
}

View File

@@ -4,11 +4,11 @@ package payments.orchestration.v1;
option go_package = "github.com/tech/sendico/pkg/proto/payments/orchestration/v1;orchestrationv1";
import "common/pagination/v1/cursor.proto";
import "billing/fees/v1/fees.proto";
import "gateway/chain/v1/chain.proto";
import "gateway/mntx/v1/mntx.proto";
import "payments/shared/v1/shared.proto";
import "api/proto/common/pagination/v1/cursor.proto";
import "api/proto/billing/fees/v1/fees.proto";
import "api/proto/gateway/chain/v1/chain.proto";
import "api/proto/gateway/mntx/v1/mntx.proto";
import "api/proto/payments/shared/v1/shared.proto";
message InitiatePaymentsRequest {
payments.shared.v1.RequestMeta meta = 1;

View File

@@ -0,0 +1,20 @@
syntax = "proto3";
package payments.payment.v1;
option go_package = "github.com/tech/sendico/pkg/proto/payments/payment/v1;paymentv1";
import "api/proto/payments/transfer/v1/transfer.proto";
// -------------------------
// External payment semantics
// -------------------------
message PaymentIntent {
payments.transfer.v1.TransferIntent transfer = 1;
string payer_ref = 2;
string payee_ref = 3;
string purpose = 4;
}

View File

@@ -4,7 +4,8 @@ package payments.quotation.v1;
option go_package = "github.com/tech/sendico/pkg/proto/payments/quotation/v1;quotationv1";
import "payments/shared/v1/shared.proto";
import "api/proto/payments/shared/v1/shared.proto";
message QuotePaymentRequest {
payments.shared.v1.RequestMeta meta = 1;
@@ -35,6 +36,8 @@ message QuotePaymentsResponse {
}
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);
}

View File

@@ -0,0 +1,59 @@
syntax = "proto3";
package payments.quotation.v2;
option go_package = "github.com/tech/sendico/pkg/proto/payments/quotation/v2;quotationv2";
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";
enum QuoteKind {
QUOTE_KIND_UNSPECIFIED = 0;
QUOTE_KIND_EXECUTABLE = 1; // can be executed now (subject to execution-time checks)
QUOTE_KIND_INDICATIVE = 2; // informational only
}
enum QuoteState {
QUOTE_STATE_UNSPECIFIED = 0;
QUOTE_STATE_ACTIVE = 1;
QUOTE_STATE_EXPIRED = 2;
}
enum QuoteBlockReason {
QUOTE_BLOCK_REASON_UNSPECIFIED = 0;
QUOTE_BLOCK_REASON_ROUTE_UNAVAILABLE = 1;
QUOTE_BLOCK_REASON_LIMIT_BLOCKED = 2;
QUOTE_BLOCK_REASON_RISK_BLOCKED = 3;
QUOTE_BLOCK_REASON_INSUFFICIENT_LIQUIDITY = 4;
QUOTE_BLOCK_REASON_PRICE_STALE = 5;
QUOTE_BLOCK_REASON_AMOUNT_TOO_SMALL = 6;
QUOTE_BLOCK_REASON_AMOUNT_TOO_LARGE = 7;
}
message PaymentQuote {
common.storable.v1.Storable storable = 1;
QuoteKind kind = 2;
QuoteState state = 3;
optional QuoteBlockReason block_reason = 4;
common.money.v1.Money debit_amount = 5;
common.money.v1.Money credit_amount = 6;
repeated fees.v1.DerivedPostingLine fee_lines = 7;
repeated fees.v1.AppliedRule fee_rules = 8;
oracle.v1.Quote fx_quote = 9;
string quote_ref = 10;
google.protobuf.Timestamp expires_at = 11;
google.protobuf.Timestamp priced_at = 12;
}

View File

@@ -0,0 +1,37 @@
syntax = "proto3";
package payments.quotation.v2;
option go_package = "github.com/tech/sendico/pkg/proto/payments/quotation/v2;quotationv2";
import "api/proto/payments/shared/v1/shared.proto";
import "api/proto/payments/transfer/v1/transfer.proto";
import "api/proto/payments/quotation/v2/interface.proto";
message QuotePaymentRequest {
payments.shared.v1.RequestMeta meta = 1;
string idempotency_key = 2;
payments.transfer.v1.TransferIntent intent = 3;
bool preview_only = 4;
string initiator_ref = 5;
}
message QuotePaymentResponse {
payments.quotation.v2.PaymentQuote quote = 1;
string idempotency_key = 2;
}
message QuotePaymentsRequest {
payments.shared.v1.RequestMeta meta = 1;
string idempotency_key = 2;
repeated payments.transfer.v1.TransferIntent intents = 3;
bool preview_only = 4;
string initiator_ref = 5;
}
message QuotePaymentsResponse {
string quote_ref = 1;
repeated payments.quotation.v2.PaymentQuote quotes = 3;
string idempotency_key = 4;
}

View File

@@ -5,13 +5,14 @@ package payments.shared.v1;
option go_package = "github.com/tech/sendico/pkg/proto/payments/shared/v1;sharedv1";
import "google/protobuf/timestamp.proto";
import "common/money/v1/money.proto";
import "common/fx/v1/fx.proto";
import "common/gateway/v1/gateway.proto";
import "common/trace/v1/trace.proto";
import "billing/fees/v1/fees.proto";
import "gateway/chain/v1/chain.proto";
import "oracle/v1/oracle.proto";
import "api/proto/common/money/v1/money.proto";
import "api/proto/common/fx/v1/fx.proto";
import "api/proto/common/gateway/v1/gateway.proto";
import "api/proto/common/payment/v1/settlement.proto";
import "api/proto/common/trace/v1/trace.proto";
import "api/proto/billing/fees/v1/fees.proto";
import "api/proto/gateway/chain/v1/chain.proto";
import "api/proto/oracle/v1/oracle.proto";
enum PaymentKind {
PAYMENT_KIND_UNSPECIFIED = 0;
@@ -20,13 +21,6 @@ enum PaymentKind {
PAYMENT_KIND_FX_CONVERSION = 3;
}
// SettlementMode defines how to treat fees/FX variance for payouts.
enum SettlementMode {
SETTLEMENT_UNSPECIFIED = 0;
SETTLEMENT_FIX_SOURCE = 1; // customer pays fees; sent amount fixed
SETTLEMENT_FIX_RECEIVED = 2; // receiver gets fixed amount; source flexes
}
enum PaymentState {
PAYMENT_STATE_UNSPECIFIED = 0;
PAYMENT_STATE_ACCEPTED = 1;
@@ -111,7 +105,7 @@ message PaymentIntent {
FXIntent fx = 6;
fees.v1.PolicyOverrides fee_policy = 7;
map<string, string> attributes = 8;
SettlementMode settlement_mode = 9;
common.payment.v1.SettlementMode settlement_mode = 9;
Customer customer = 10;
string settlement_currency = 11;
string ref = 12;

View File

@@ -0,0 +1,21 @@
syntax = "proto3";
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";
// -------------------------
// Base value movement
// -------------------------
message TransferIntent {
payments.endpoint.v1.PaymentEndpoint source = 1;
payments.endpoint.v1.PaymentEndpoint destination = 2;
common.money.v1.Money amount = 3;
string comment = 4;
}