Fully separated payment quotation and orchestration flows
This commit is contained in:
120
api/proto/payments/orchestration/v1/orchestration.proto
Normal file
120
api/proto/payments/orchestration/v1/orchestration.proto
Normal file
@@ -0,0 +1,120 @@
|
||||
syntax = "proto3";
|
||||
|
||||
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";
|
||||
|
||||
message InitiatePaymentsRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
string quote_ref = 3;
|
||||
map<string, string> metadata = 4;
|
||||
}
|
||||
|
||||
message InitiatePaymentsResponse {
|
||||
repeated payments.shared.v1.Payment payments = 1;
|
||||
}
|
||||
|
||||
message InitiatePaymentRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
payments.shared.v1.PaymentIntent intent = 3;
|
||||
map<string, string> metadata = 4;
|
||||
string quote_ref = 5;
|
||||
}
|
||||
|
||||
message InitiatePaymentResponse {
|
||||
payments.shared.v1.Payment payment = 1;
|
||||
}
|
||||
|
||||
message GetPaymentRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
string payment_ref = 2;
|
||||
}
|
||||
|
||||
message GetPaymentResponse {
|
||||
payments.shared.v1.Payment payment = 1;
|
||||
}
|
||||
|
||||
message ListPaymentsRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
repeated payments.shared.v1.PaymentState filter_states = 2;
|
||||
string source_ref = 3;
|
||||
string destination_ref = 4;
|
||||
common.pagination.v1.CursorPageRequest page = 5;
|
||||
string organization_ref = 6;
|
||||
}
|
||||
|
||||
message ListPaymentsResponse {
|
||||
repeated payments.shared.v1.Payment payments = 1;
|
||||
common.pagination.v1.CursorPageResponse page = 2;
|
||||
}
|
||||
|
||||
message CancelPaymentRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
string payment_ref = 2;
|
||||
string reason = 3;
|
||||
}
|
||||
|
||||
message CancelPaymentResponse {
|
||||
payments.shared.v1.Payment payment = 1;
|
||||
}
|
||||
|
||||
message ProcessTransferUpdateRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
chain.gateway.v1.TransferStatusChangedEvent event = 2;
|
||||
}
|
||||
|
||||
message ProcessTransferUpdateResponse {
|
||||
payments.shared.v1.Payment payment = 1;
|
||||
}
|
||||
|
||||
message ProcessDepositObservedRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
chain.gateway.v1.WalletDepositObservedEvent event = 2;
|
||||
}
|
||||
|
||||
message ProcessDepositObservedResponse {
|
||||
payments.shared.v1.Payment payment = 1;
|
||||
}
|
||||
|
||||
message ProcessCardPayoutUpdateRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
mntx.gateway.v1.CardPayoutStatusChangedEvent event = 2;
|
||||
}
|
||||
|
||||
message ProcessCardPayoutUpdateResponse {
|
||||
payments.shared.v1.Payment payment = 1;
|
||||
}
|
||||
|
||||
message InitiateConversionRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
payments.shared.v1.PaymentEndpoint source = 3;
|
||||
payments.shared.v1.PaymentEndpoint destination = 4;
|
||||
payments.shared.v1.FXIntent fx = 5;
|
||||
fees.v1.PolicyOverrides fee_policy = 6;
|
||||
map<string, string> metadata = 7;
|
||||
}
|
||||
|
||||
message InitiateConversionResponse {
|
||||
payments.shared.v1.Payment conversion = 1;
|
||||
}
|
||||
|
||||
service PaymentExecutionService {
|
||||
rpc InitiatePayments(InitiatePaymentsRequest) returns (InitiatePaymentsResponse);
|
||||
rpc InitiatePayment(InitiatePaymentRequest) returns (InitiatePaymentResponse);
|
||||
rpc CancelPayment(CancelPaymentRequest) returns (CancelPaymentResponse);
|
||||
rpc GetPayment(GetPaymentRequest) returns (GetPaymentResponse);
|
||||
rpc ListPayments(ListPaymentsRequest) returns (ListPaymentsResponse);
|
||||
rpc InitiateConversion(InitiateConversionRequest) returns (InitiateConversionResponse);
|
||||
rpc ProcessTransferUpdate(ProcessTransferUpdateRequest) returns (ProcessTransferUpdateResponse);
|
||||
rpc ProcessDepositObserved(ProcessDepositObservedRequest) returns (ProcessDepositObservedResponse);
|
||||
rpc ProcessCardPayoutUpdate(ProcessCardPayoutUpdateRequest) returns (ProcessCardPayoutUpdateResponse);
|
||||
}
|
||||
38
api/proto/payments/quotation/v1/quotation.proto
Normal file
38
api/proto/payments/quotation/v1/quotation.proto
Normal file
@@ -0,0 +1,38 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package payments.quotation.v1;
|
||||
|
||||
option go_package = "github.com/tech/sendico/pkg/proto/payments/quotation/v1;quotationv1";
|
||||
|
||||
import "payments/shared/v1/shared.proto";
|
||||
|
||||
message QuotePaymentRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
payments.shared.v1.PaymentIntent intent = 3;
|
||||
bool preview_only = 4;
|
||||
}
|
||||
|
||||
message QuotePaymentResponse {
|
||||
payments.shared.v1.PaymentQuote quote = 1;
|
||||
string idempotency_key = 2;
|
||||
}
|
||||
|
||||
message QuotePaymentsRequest {
|
||||
payments.shared.v1.RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
repeated payments.shared.v1.PaymentIntent intents = 3;
|
||||
bool preview_only = 4;
|
||||
}
|
||||
|
||||
message QuotePaymentsResponse {
|
||||
string quote_ref = 1;
|
||||
payments.shared.v1.PaymentQuoteAggregate aggregate = 2;
|
||||
repeated payments.shared.v1.PaymentQuote quotes = 3;
|
||||
string idempotency_key = 4;
|
||||
}
|
||||
|
||||
service QuotationService {
|
||||
rpc QuotePayment(QuotePaymentRequest) returns (QuotePaymentResponse);
|
||||
rpc QuotePayments(QuotePaymentsRequest) returns (QuotePaymentsResponse);
|
||||
}
|
||||
@@ -1,18 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package payments.orchestrator.v1;
|
||||
package payments.shared.v1;
|
||||
|
||||
option go_package = "github.com/tech/sendico/pkg/proto/payments/orchestrator/v1;orchestratorv1";
|
||||
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 "common/pagination/v1/cursor.proto";
|
||||
import "billing/fees/v1/fees.proto";
|
||||
import "gateway/chain/v1/chain.proto";
|
||||
import "gateway/mntx/v1/mntx.proto";
|
||||
import "oracle/v1/oracle.proto";
|
||||
|
||||
enum PaymentKind {
|
||||
@@ -226,143 +224,3 @@ message Payment {
|
||||
ExecutionPlan execution_plan = 13;
|
||||
PaymentPlan payment_plan = 14;
|
||||
}
|
||||
|
||||
message QuotePaymentRequest {
|
||||
RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
PaymentIntent intent = 3;
|
||||
bool preview_only = 4;
|
||||
}
|
||||
|
||||
message QuotePaymentResponse {
|
||||
PaymentQuote quote = 1;
|
||||
string idempotency_key = 2;
|
||||
}
|
||||
|
||||
message QuotePaymentsRequest {
|
||||
RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
repeated PaymentIntent intents = 3;
|
||||
bool preview_only = 4;
|
||||
}
|
||||
|
||||
message QuotePaymentsResponse {
|
||||
string quote_ref = 1;
|
||||
PaymentQuoteAggregate aggregate = 2;
|
||||
repeated PaymentQuote quotes = 3;
|
||||
string idempotency_key = 4;
|
||||
}
|
||||
|
||||
message InitiatePaymentsRequest {
|
||||
RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
string quote_ref = 3;
|
||||
map<string, string> metadata = 4;
|
||||
}
|
||||
|
||||
message InitiatePaymentsResponse {
|
||||
repeated Payment payments = 1;
|
||||
}
|
||||
|
||||
message InitiatePaymentRequest {
|
||||
RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
PaymentIntent intent = 3;
|
||||
map<string, string> metadata = 4;
|
||||
string quote_ref = 5;
|
||||
}
|
||||
|
||||
message InitiatePaymentResponse {
|
||||
Payment payment = 1;
|
||||
}
|
||||
|
||||
message GetPaymentRequest {
|
||||
RequestMeta meta = 1;
|
||||
string payment_ref = 2;
|
||||
}
|
||||
|
||||
message GetPaymentResponse {
|
||||
Payment payment = 1;
|
||||
}
|
||||
|
||||
message ListPaymentsRequest {
|
||||
RequestMeta meta = 1;
|
||||
repeated PaymentState filter_states = 2;
|
||||
string source_ref = 3;
|
||||
string destination_ref = 4;
|
||||
common.pagination.v1.CursorPageRequest page = 5;
|
||||
string organization_ref = 6;
|
||||
}
|
||||
|
||||
message ListPaymentsResponse {
|
||||
repeated Payment payments = 1;
|
||||
common.pagination.v1.CursorPageResponse page = 2;
|
||||
}
|
||||
|
||||
message CancelPaymentRequest {
|
||||
RequestMeta meta = 1;
|
||||
string payment_ref = 2;
|
||||
string reason = 3;
|
||||
}
|
||||
|
||||
message CancelPaymentResponse {
|
||||
Payment payment = 1;
|
||||
}
|
||||
|
||||
message ProcessTransferUpdateRequest {
|
||||
RequestMeta meta = 1;
|
||||
chain.gateway.v1.TransferStatusChangedEvent event = 2;
|
||||
}
|
||||
|
||||
message ProcessTransferUpdateResponse {
|
||||
Payment payment = 1;
|
||||
}
|
||||
|
||||
message ProcessDepositObservedRequest {
|
||||
RequestMeta meta = 1;
|
||||
chain.gateway.v1.WalletDepositObservedEvent event = 2;
|
||||
}
|
||||
|
||||
message ProcessDepositObservedResponse {
|
||||
Payment payment = 1;
|
||||
}
|
||||
|
||||
message ProcessCardPayoutUpdateRequest {
|
||||
RequestMeta meta = 1;
|
||||
mntx.gateway.v1.CardPayoutStatusChangedEvent event = 2;
|
||||
}
|
||||
|
||||
message ProcessCardPayoutUpdateResponse {
|
||||
Payment payment = 1;
|
||||
}
|
||||
|
||||
message InitiateConversionRequest {
|
||||
RequestMeta meta = 1;
|
||||
string idempotency_key = 2;
|
||||
PaymentEndpoint source = 3;
|
||||
PaymentEndpoint destination = 4;
|
||||
FXIntent fx = 5;
|
||||
fees.v1.PolicyOverrides fee_policy = 6;
|
||||
map<string, string> metadata = 7;
|
||||
}
|
||||
|
||||
message InitiateConversionResponse {
|
||||
Payment conversion = 1;
|
||||
}
|
||||
|
||||
service PaymentOrchestrator {
|
||||
rpc InitiatePayments(InitiatePaymentsRequest) returns (InitiatePaymentsResponse);
|
||||
rpc InitiatePayment(InitiatePaymentRequest) returns (InitiatePaymentResponse);
|
||||
rpc CancelPayment(CancelPaymentRequest) returns (CancelPaymentResponse);
|
||||
rpc GetPayment(GetPaymentRequest) returns (GetPaymentResponse);
|
||||
rpc ListPayments(ListPaymentsRequest) returns (ListPaymentsResponse);
|
||||
rpc InitiateConversion(InitiateConversionRequest) returns (InitiateConversionResponse);
|
||||
rpc ProcessTransferUpdate(ProcessTransferUpdateRequest) returns (ProcessTransferUpdateResponse);
|
||||
rpc ProcessDepositObserved(ProcessDepositObservedRequest) returns (ProcessDepositObservedResponse);
|
||||
rpc ProcessCardPayoutUpdate(ProcessCardPayoutUpdateRequest) returns (ProcessCardPayoutUpdateResponse);
|
||||
}
|
||||
|
||||
service PaymentQuotation {
|
||||
rpc QuotePayment(QuotePaymentRequest) returns (QuotePaymentResponse);
|
||||
rpc QuotePayments(QuotePaymentsRequest) returns (QuotePaymentsResponse);
|
||||
}
|
||||
Reference in New Issue
Block a user