unified gateway interface

This commit is contained in:
Stephan D
2025-12-31 17:47:32 +01:00
parent 19b7b69bd8
commit 97ba7500dc
104 changed files with 8228 additions and 1742 deletions

View File

@@ -7,6 +7,7 @@ option go_package = "github.com/tech/sendico/pkg/proto/payments/orchestrator/v1;
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 "common/pagination/v1/cursor.proto";
import "billing/fees/v1/fees.proto";
@@ -23,9 +24,9 @@ enum PaymentKind {
// SettlementMode defines how to treat fees/FX variance for payouts.
enum SettlementMode {
SETTLEMENT_MODE_UNSPECIFIED = 0;
SETTLEMENT_MODE_FIX_SOURCE = 1; // customer pays fees; sent amount fixed
SETTLEMENT_MODE_FIX_RECEIVED = 2; // receiver gets fixed amount; source flexes
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 {
@@ -39,13 +40,13 @@ enum PaymentState {
}
enum PaymentFailureCode {
PAYMENT_FAILURE_CODE_UNSPECIFIED = 0;
PAYMENT_FAILURE_CODE_BALANCE = 1;
PAYMENT_FAILURE_CODE_LEDGER = 2;
PAYMENT_FAILURE_CODE_FX = 3;
PAYMENT_FAILURE_CODE_CHAIN = 4;
PAYMENT_FAILURE_CODE_FEES = 5;
PAYMENT_FAILURE_CODE_POLICY = 6;
FAILURE_UNSPECIFIED = 0;
FAILURE_BALANCE = 1;
FAILURE_LEDGER = 2;
FAILURE_FX = 3;
FAILURE_CHAIN = 4;
FAILURE_FEES = 5;
FAILURE_POLICY = 6;
}
message RequestMeta {
@@ -171,6 +172,21 @@ message ExecutionPlan {
common.money.v1.Money total_network_fee = 2;
}
message PaymentStep {
common.gateway.v1.Rail rail = 1;
string gateway_id = 2; // required for external rails
common.gateway.v1.RailOperation action = 3;
common.money.v1.Money amount = 4;
string ref = 5;
}
message PaymentPlan {
string id = 1;
repeated PaymentStep steps = 2;
string idempotency_key = 3;
google.protobuf.Timestamp created_at = 4;
}
// Card payout gateway tracking info.
message CardPayout {
string payout_ref = 1;
@@ -197,6 +213,7 @@ message Payment {
google.protobuf.Timestamp updated_at = 11;
CardPayout card_payout = 12;
ExecutionPlan execution_plan = 13;
PaymentPlan payment_plan = 14;
}
message QuotePaymentRequest {