refactored payment orchestration

This commit is contained in:
Stephan D
2026-02-03 00:40:46 +01:00
parent 05d998e0f7
commit 5e87e2f2f9
184 changed files with 3920 additions and 2219 deletions

View File

@@ -36,14 +36,17 @@ enum DepositStatus {
enum TransferStatus {
TRANSFER_STATUS_UNSPECIFIED = 0;
TRANSFER_PENDING = 1;
TRANSFER_SIGNING = 2;
TRANSFER_SUBMITTED = 3;
TRANSFER_CONFIRMED = 4;
TRANSFER_FAILED = 5;
TRANSFER_CANCELLED = 6;
TRANSFER_CREATED = 1; // record exists, not started
TRANSFER_PROCESSING = 2; // we are working on it (signing, building tx, etc)
TRANSFER_WAITING = 3; // waiting external world (network/provider)
TRANSFER_SUCCESS = 4; // final success
TRANSFER_FAILED = 5; // final failure
TRANSFER_CANCELLED = 6; // final cancelled
}
// Asset captures the chain/token pair so downstream systems can route correctly.
message Asset {
ChainNetwork chain = 1;
@@ -148,6 +151,8 @@ message Transfer {
string failure_reason = 12;
google.protobuf.Timestamp created_at = 13;
google.protobuf.Timestamp updated_at = 14;
string intent_ref = 15;
string payment_ref = 16;
}
message SubmitTransferRequest {
@@ -158,7 +163,9 @@ message SubmitTransferRequest {
common.money.v1.Money amount = 5;
repeated ServiceFeeBreakdown fees = 6;
map<string, string> metadata = 7;
string client_reference = 8;
string operation_ref = 8;
string intent_ref = 9;
string payment_ref = 10;
}
message SubmitTransferResponse {
@@ -214,7 +221,9 @@ message EnsureGasTopUpRequest {
string target_wallet_ref = 4;
common.money.v1.Money estimated_total_fee = 5;
map<string, string> metadata = 6;
string client_reference = 7;
string payment_ref = 7;
string intent_ref = 8;
string operation_ref = 9;
}
message EnsureGasTopUpResponse {

View File

@@ -7,18 +7,22 @@ option go_package = "github.com/tech/sendico/pkg/proto/gateway/mntx/v1;mntxv1";
import "google/protobuf/timestamp.proto";
import "common/gateway/v1/gateway.proto";
// Status of a payout request handled by Monetix.
// Lifecycle status of a payout handled by Monetix.
enum PayoutStatus {
PAYOUT_STATUS_UNSPECIFIED = 0;
PAYOUT_STATUS_PENDING = 1;
PAYOUT_STATUS_PROCESSED = 2;
PAYOUT_STATUS_FAILED = 3;
PAYOUT_STATUS_CREATED = 1; // request created, not sent
PAYOUT_STATUS_WAITING = 2; // waiting provider processing
PAYOUT_STATUS_SUCCESS = 3; // final success
PAYOUT_STATUS_FAILED = 4; // final failure
PAYOUT_STATUS_CANCELLED = 5; // final cancelled
}
// Request to initiate a Monetix card payout.
message CardPayoutRequest {
string payout_id = 1; // internal payout id, mapped to Monetix payment_id
int64 project_id = 2; // optional override; defaults to configured project id
string payout_id = 1; // internal payout id, mapped to Monetix payment_id
int64 project_id = 2; // optional override; defaults to configured project id
string customer_id = 3;
string customer_first_name = 4;
string customer_middle_name = 5;
@@ -29,13 +33,16 @@ message CardPayoutRequest {
string customer_state = 10;
string customer_city = 11;
string customer_address = 12;
int64 amount_minor = 13; // amount in minor units
string currency = 14; // ISO-4217 alpha-3
int64 amount_minor = 13; // amount in minor units
string currency = 14; // ISO-4217 alpha-3
string card_pan = 15;
uint32 card_exp_year = 16;
uint32 card_exp_month = 17;
string card_holder = 18;
map<string, string> metadata = 30;
string operation_ref = 31;
string idempotency_key = 32;
string intent_ref = 33;
}
// Persisted payout state for retrieval and status updates.
@@ -51,6 +58,9 @@ message CardPayoutState {
string provider_payment_id = 9;
google.protobuf.Timestamp created_at = 10;
google.protobuf.Timestamp updated_at = 11;
string operation_ref = 12;
string idempotency_key = 13;
string intent_ref = 14;
}
// Response returned immediately after submitting a payout to Monetix.
@@ -105,6 +115,9 @@ message CardTokenPayoutRequest {
string card_holder = 16;
string masked_pan = 17;
map<string, string> metadata = 30;
string operation_ref = 31;
string idempotency_key = 32;
string intent_ref = 33;
}
// Response returned immediately after submitting a token payout to Monetix.