mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-20 06:05:09 +01:00
feat: payment processor
This commit is contained in:
113
crates/cdk-payment-processor/src/proto/payment_processor.proto
Normal file
113
crates/cdk-payment-processor/src/proto/payment_processor.proto
Normal file
@@ -0,0 +1,113 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cdk_payment_processor;
|
||||
|
||||
service CdkPaymentProcessor {
|
||||
rpc GetSettings(SettingsRequest) 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(WaitIncomingPaymentRequest) returns (stream WaitIncomingPaymentResponse) {}
|
||||
}
|
||||
|
||||
message SettingsRequest {}
|
||||
|
||||
message SettingsResponse {
|
||||
string inner = 1;
|
||||
}
|
||||
|
||||
message CreatePaymentRequest {
|
||||
uint64 amount = 1;
|
||||
string unit = 2;
|
||||
string description = 3;
|
||||
optional uint64 unix_expiry = 4;
|
||||
}
|
||||
|
||||
message CreatePaymentResponse {
|
||||
string request_lookup_id = 1;
|
||||
string request = 2;
|
||||
optional uint64 expiry = 3;
|
||||
}
|
||||
|
||||
message Mpp {
|
||||
uint64 amount = 1;
|
||||
}
|
||||
|
||||
message MeltOptions {
|
||||
oneof options {
|
||||
Mpp mpp = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message PaymentQuoteRequest {
|
||||
string request = 1;
|
||||
string unit = 2;
|
||||
optional MeltOptions options = 3;
|
||||
}
|
||||
|
||||
enum QuoteState {
|
||||
UNPAID = 0;
|
||||
PAID = 1;
|
||||
PENDING = 2;
|
||||
UNKNOWN = 3;
|
||||
FAILED = 4;
|
||||
ISSUED = 5;
|
||||
}
|
||||
|
||||
|
||||
message PaymentQuoteResponse {
|
||||
string request_lookup_id = 1;
|
||||
uint64 amount = 2;
|
||||
uint64 fee = 3;
|
||||
QuoteState state = 4;
|
||||
}
|
||||
|
||||
message MeltQuote {
|
||||
string id = 1;
|
||||
string unit = 2;
|
||||
uint64 amount = 3;
|
||||
string request = 4;
|
||||
uint64 fee_reserve = 5;
|
||||
QuoteState state = 6;
|
||||
uint64 expiry = 7;
|
||||
optional string payment_preimage = 8;
|
||||
string request_lookup_id = 9;
|
||||
optional uint64 msat_to_pay = 10;
|
||||
}
|
||||
|
||||
message MakePaymentRequest {
|
||||
MeltQuote melt_quote = 1;
|
||||
optional uint64 partial_amount = 2;
|
||||
optional uint64 max_fee_amount = 3;
|
||||
}
|
||||
|
||||
message MakePaymentResponse {
|
||||
string payment_lookup_id = 1;
|
||||
optional string payment_proof = 2;
|
||||
QuoteState status = 3;
|
||||
uint64 total_spent = 4;
|
||||
string unit = 5;
|
||||
}
|
||||
|
||||
message CheckIncomingPaymentRequest {
|
||||
string request_lookup_id = 1;
|
||||
}
|
||||
|
||||
message CheckIncomingPaymentResponse {
|
||||
QuoteState status = 1;
|
||||
}
|
||||
|
||||
message CheckOutgoingPaymentRequest {
|
||||
string request_lookup_id = 1;
|
||||
}
|
||||
|
||||
|
||||
message WaitIncomingPaymentRequest {
|
||||
}
|
||||
|
||||
|
||||
message WaitIncomingPaymentResponse {
|
||||
string lookup_id = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user