diff --git a/src/main/proto/com/kodypay/grpc/ecom/v1/ecom.proto b/src/main/proto/com/kodypay/grpc/ecom/v1/ecom.proto index 863076a..6a7e78b 100644 --- a/src/main/proto/com/kodypay/grpc/ecom/v1/ecom.proto +++ b/src/main/proto/com/kodypay/grpc/ecom/v1/ecom.proto @@ -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 @@ -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; + } +} diff --git a/src/main/proto/com/kodypay/grpc/pay/v1/pay.proto b/src/main/proto/com/kodypay/grpc/pay/v1/pay.proto index a4ce459..cb3a5f9 100644 --- a/src/main/proto/com/kodypay/grpc/pay/v1/pay.proto +++ b/src/main/proto/com/kodypay/grpc/pay/v1/pay.proto @@ -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 {