| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- syntax = "proto3";
- package cdk_payment_processor;
- service CdkPaymentProcessor {
- rpc GetSettings(EmptyRequest) returns (SettingsResponse) {}
- rpc CreatePayment(CreatePaymentRequest) returns (CreatePaymentResponse) {}
- rpc GetPaymentQuote(PaymentQuoteRequest) returns (PaymentQuoteResponse) {}
- rpc MakePayment(MakePaymentRequest) returns (MakePaymentResponse) {}
- rpc CheckIncomingPayment(CheckIncomingPaymentRequest) returns (CheckIncomingPaymentResponse) {}
- rpc CheckOutgoingPayment(CheckOutgoingPaymentRequest) returns (MakePaymentResponse) {}
- rpc WaitIncomingPayment(EmptyRequest) returns (stream WaitIncomingPaymentResponse) {}
- }
- message EmptyRequest {}
- message SettingsResponse {
- string inner = 1;
- }
- message Bolt11IncomingPaymentOptions {
- optional string description = 1;
- uint64 amount = 2;
- optional uint64 unix_expiry = 3;
- }
- message Bolt12IncomingPaymentOptions {
- optional string description = 1;
- optional uint64 amount = 2;
- optional uint64 unix_expiry = 3;
- }
- enum PaymentMethodType {
- BOLT11 = 0;
- BOLT12 = 1;
- }
- enum OutgoingPaymentRequestType {
- BOLT11_INVOICE = 0;
- BOLT12_OFFER = 1;
- }
- enum PaymentIdentifierType {
- PAYMENT_HASH = 0;
- OFFER_ID = 1;
- LABEL = 2;
- BOLT12_PAYMENT_HASH = 3;
- CUSTOM_ID = 4;
- PAYMENT_ID = 5;
- }
- message PaymentIdentifier {
- PaymentIdentifierType type = 1;
- oneof value {
- string hash = 2; // Used for PAYMENT_HASH and BOLT12_PAYMENT_HASH
- string id = 3; // Used for OFFER_ID, LABEL, and CUSTOM_ID
- }
- }
- message IncomingPaymentOptions {
- oneof options {
- Bolt11IncomingPaymentOptions bolt11 = 1;
- Bolt12IncomingPaymentOptions bolt12 = 2;
- }
- }
- message CreatePaymentRequest {
- string unit = 1;
- IncomingPaymentOptions options = 2;
- }
- message CreatePaymentResponse {
- PaymentIdentifier request_identifier = 1;
- string request = 2;
- optional uint64 expiry = 3;
- }
- message Mpp {
- uint64 amount = 1;
- }
- message Amountless {
- uint64 amount_msat = 1;
- }
- message MeltOptions {
- oneof options {
- Mpp mpp = 1;
- Amountless amountless = 2;
- }
- }
- message PaymentQuoteRequest {
- string request = 1;
- string unit = 2;
- optional MeltOptions options = 3;
- OutgoingPaymentRequestType request_type = 4;
- }
- enum QuoteState {
- UNPAID = 0;
- PAID = 1;
- PENDING = 2;
- UNKNOWN = 3;
- FAILED = 4;
- ISSUED = 5;
- }
- message PaymentQuoteResponse {
- PaymentIdentifier request_identifier = 1;
- uint64 amount = 2;
- uint64 fee = 3;
- QuoteState state = 4;
- string unit = 5;
- }
- message Bolt11OutgoingPaymentOptions {
- string bolt11 = 1;
- optional uint64 max_fee_amount = 2;
- optional uint64 timeout_secs = 3;
- optional MeltOptions melt_options = 4;
- }
- message Bolt12OutgoingPaymentOptions {
- string offer = 1;
- optional uint64 max_fee_amount = 2;
- optional uint64 timeout_secs = 3;
- optional MeltOptions melt_options = 5;
- }
- enum OutgoingPaymentOptionsType {
- OUTGOING_BOLT11 = 0;
- OUTGOING_BOLT12 = 1;
- }
- message OutgoingPaymentVariant {
- oneof options {
- Bolt11OutgoingPaymentOptions bolt11 = 1;
- Bolt12OutgoingPaymentOptions bolt12 = 2;
- }
- }
- message MakePaymentRequest {
- OutgoingPaymentVariant payment_options = 1;
- optional uint64 partial_amount = 2;
- optional uint64 max_fee_amount = 3;
- }
- message MakePaymentResponse {
- PaymentIdentifier payment_identifier = 1;
- optional string payment_proof = 2;
- QuoteState status = 3;
- uint64 total_spent = 4;
- string unit = 5;
- }
- message CheckIncomingPaymentRequest {
- PaymentIdentifier request_identifier = 1;
- }
- message CheckIncomingPaymentResponse {
- repeated WaitIncomingPaymentResponse payments = 1;
- }
- message CheckOutgoingPaymentRequest {
- PaymentIdentifier request_identifier = 1;
- }
- message WaitIncomingPaymentResponse {
- PaymentIdentifier payment_identifier = 1;
- uint64 payment_amount = 2;
- string unit = 3;
- string payment_id = 4;
- }
|