OxL Reference

proto/payments.proto

proto
// Платёжный шлюз: внешняя система shop (V.5). Фейковый сервер: tests/shop/fakes. charge/refund идемпотентны.
syntax = "proto3";
package payments;
import "oxl/options.proto";
import "google/protobuf/empty.proto";

message ChargeReq { uint64 user = 1; int64 amount = 2; }
message ChargeResp { string receiptId = 1; string gateway = 2; }
message RefundReq { string receiptId = 1; }
message Declined { option (oxl.error) = true; string reason = 1; }

service Payments {
  rpc charge(ChargeReq) returns (ChargeResp) {
    option idempotency_level = IDEMPOTENT;
    option (oxl.raises) = "payments.Declined";
  }
  rpc refund(RefundReq) returns (google.protobuf.Empty) { option idempotency_level = IDEMPOTENT; }
}

Source: examples/shop/proto/payments.proto