Files
jnc-server/app/main/api/desc/front/pay.api
2026-01-16 17:01:36 +08:00

95 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "v1"
info (
title: "支付服务"
desc: "支付服务"
version: "v1"
)
@server (
prefix: api/v1
group: pay
)
service main {
// 微信支付回调
@handler WechatPayCallback
post /pay/wechat/callback
// 支付宝支付回调
@handler AlipayCallback
post /pay/alipay/callback
// 微信退款回调
@handler WechatPayRefundCallback
post /pay/wechat/refund_callback
// 易支付回调
@handler EasyPayCallback
get /pay/easypay/callback
// 云印签支付回调
@handler YunYinSignPayCallback
post /pay/yunyinsign/callback
}
@server (
prefix: api/v1
group: pay
jwt: JwtAuth
middleware: AuthInterceptor
)
service main {
// 支付
@handler Payment
post /pay/payment (PaymentReq) returns (PaymentResp)
@handler IapCallback
post /pay/iap_callback (IapCallbackReq)
@handler PaymentCheck
post /pay/check (PaymentCheckReq) returns (PaymentCheckResp)
// 云印签退款
@handler YunYinSignPayRefund
post /pay/yunyinsign/refund (YunYinSignPayRefundReq) returns (YunYinSignPayRefundResp)
}
type (
PaymentReq {
Id string `json:"id"`
PayMethod string `json:"pay_method"` // 支付方式: wechat, alipay, easypay_alipay, appleiap, yunyinSignPay, yunyinSignPay_wechat, yunyinSignPay_alipay, test(仅开发环境), test_empty(仅开发环境-空报告模式)
// 系统简化:移除 agent_vip, agent_upgrade 支付类型
PayType string `json:"pay_type" validate:"required,oneof=query"`
}
PaymentResp {
PrepayData interface{} `json:"prepay_data"`
PrepayId string `json:"prepay_id"`
OrderNo string `json:"order_no"`
}
PaymentCheckReq {
OrderNo string `json:"order_no" validate:"required"`
}
PaymentCheckResp {
Type string `json:"type"`
Status string `json:"status"`
}
)
type (
IapCallbackReq {
OrderID string `json:"order_id" validate:"required"`
TransactionReceipt string `json:"transaction_receipt" validate:"required"`
}
YunYinSignPayRefundReq {
OrderNo string `json:"order_no"` // 订单号sourceOrderCode与 participate_id 二选一
ParticipateId int64 `json:"participate_id,omitempty"` // 参与方ID与 order_no 二选一
RefundAmount float64 `json:"refund_amount" validate:"required,gt=0"` // 退款金额必须大于0
RefundReason string `json:"refund_reason,omitempty"` // 退款原因
}
YunYinSignPayRefundResp {
Success bool `json:"success"`
Message string `json:"message"`
}
)