Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate the refund request and response to their respective streams #42

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/main/proto/com/kodypay/grpc/ecom/v1/ecom.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ service KodyEcomPaymentsService {
rpc PaymentDetails(PaymentDetailsRequest) returns (PaymentDetailsResponse);
rpc GetPayments(GetPaymentsRequest) returns (GetPaymentsResponse);
rpc GetCardToken(GetCardTokenRequest) returns (GetCardTokenResponse);
rpc Refund(RefundRequest) returns (stream RefundResponse);
}

// Payment Initiation Request
Expand Down Expand Up @@ -179,3 +180,25 @@ message GetPaymentsResponse {
}
}
}

message RefundRequest {
string store_id = 1; // UUID of store
string payment_id = 2; // Payment id created by wombat
string amount = 3; // amount in BigDecimal/2.dp (0.00)
}
message RefundResponse {
RefundStatus status = 1;
optional string failure_reason = 2; // only populated on failure
string payment_id = 3;
google.protobuf.Timestamp date_created = 4;
string total_paid_amount = 5;
string total_amount_refunded = 6;
string remaining_amount = 7;
string total_amount_requested = 8;
string paymentTransactionId = 9;
enum RefundStatus {
PENDING = 0;
REQUESTED = 1;
FAILED = 2;
}
}
5 changes: 1 addition & 4 deletions src/main/proto/com/kodypay/grpc/pay/v1/pay.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ message PaymentDetailsRequest {
// requires X-API-Key header with 'API Key' value
message RefundRequest {
string store_id = 1; // UUID of store
oneof id {
string order_id = 2;
string payment_id = 4; //Payment id created by wombat
}
string order_id = 2;
string amount = 3; // amount in BigDecimal/2.dp (0.00)
}
message RefundResponse {
Expand Down