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

@@ -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.