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

@@ -5,7 +5,7 @@ package mntx.gateway.v1;
option go_package = "github.com/tech/sendico/pkg/proto/gateway/mntx/v1;mntxv1";
import "google/protobuf/timestamp.proto";
import "common/money/v1/money.proto";
import "common/gateway/v1/gateway.proto";
// Status of a payout request handled by Monetix.
enum PayoutStatus {
@@ -15,75 +15,6 @@ enum PayoutStatus {
PAYOUT_STATUS_FAILED = 3;
}
// Basic destination data for the payout.
message BankAccount {
string iban = 1;
string bic = 2;
string account_holder = 3;
string country = 4;
}
// Card destination for payouts (PAN-based or tokenized).
message CardDestination {
oneof card {
string pan = 1; // raw primary account number
string token = 2; // network or gateway-issued token
}
string cardholder_name = 3;
string exp_month = 4;
string exp_year = 5;
string country = 6;
}
// Wrapper allowing multiple payout destination types.
message PayoutDestination {
oneof destination {
BankAccount bank_account = 1;
CardDestination card = 2;
}
}
message Payout {
string payout_ref = 1;
string idempotency_key = 2;
string organization_ref = 3;
PayoutDestination destination = 4;
common.money.v1.Money amount = 5;
string description = 6;
map<string, string> metadata = 7;
PayoutStatus status = 8;
string failure_reason = 9;
google.protobuf.Timestamp created_at = 10;
google.protobuf.Timestamp updated_at = 11;
}
message SubmitPayoutRequest {
string idempotency_key = 1;
string organization_ref = 2;
PayoutDestination destination = 3;
common.money.v1.Money amount = 4;
string description = 5;
map<string, string> metadata = 6;
string simulated_failure_reason = 7; // optional trigger to force a failed payout for testing
}
message SubmitPayoutResponse {
Payout payout = 1;
}
message GetPayoutRequest {
string payout_ref = 1;
}
message GetPayoutResponse {
Payout payout = 1;
}
// Event emitted over messaging when payout status changes.
message PayoutStatusChangedEvent {
Payout payout = 1;
}
// Request to initiate a Monetix card payout.
message CardPayoutRequest {
string payout_id = 1; // internal payout id, mapped to Monetix payment_id
@@ -144,6 +75,12 @@ message CardPayoutStatusChangedEvent {
CardPayoutState payout = 1;
}
message ListGatewayInstancesRequest {}
message ListGatewayInstancesResponse {
repeated common.gateway.v1.GatewayInstanceDescriptor items = 1;
}
// Request to initiate a token-based card payout.
message CardTokenPayoutRequest {
string payout_id = 1;
@@ -229,10 +166,9 @@ message CardTokenizeResponse {
}
service MntxGatewayService {
rpc SubmitPayout(SubmitPayoutRequest) returns (SubmitPayoutResponse);
rpc GetPayout(GetPayoutRequest) returns (GetPayoutResponse);
rpc CreateCardPayout(CardPayoutRequest) returns (CardPayoutResponse);
rpc GetCardPayoutStatus(GetCardPayoutStatusRequest) returns (GetCardPayoutStatusResponse);
rpc CreateCardTokenPayout(CardTokenPayoutRequest) returns (CardTokenPayoutResponse);
rpc CreateCardToken(CardTokenizeRequest) returns (CardTokenizeResponse);
rpc ListGatewayInstances(ListGatewayInstancesRequest) returns (ListGatewayInstancesResponse);
}