Files
jnc-server/app/main/api/desc/front/pay.api

95 lines
2.4 KiB
Plaintext
Raw Normal View History

2025-12-27 18:12:05 +08:00
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
2025-12-31 16:54:17 +08:00
// 易支付回调
@handler EasyPayCallback
get /pay/easypay/callback
2026-01-16 17:01:36 +08:00
// 云印签支付回调
@handler YunYinSignPayCallback
post /pay/yunyinsign/callback
2025-12-27 18:12:05 +08:00
}
@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)
2026-01-16 17:01:36 +08:00
// 云印签退款
@handler YunYinSignPayRefund
post /pay/yunyinsign/refund (YunYinSignPayRefundReq) returns (YunYinSignPayRefundResp)
2025-12-27 18:12:05 +08:00
}
type (
PaymentReq {
Id string `json:"id"`
2026-01-16 03:33:02 +08:00
PayMethod string `json:"pay_method"` // 支付方式: wechat, alipay, easypay_alipay, appleiap, yunyinSignPay, yunyinSignPay_wechat, yunyinSignPay_alipay, test(仅开发环境), test_empty(仅开发环境-空报告模式)
2025-12-27 18:12:05 +08:00
// 系统简化:移除 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"`
}
2026-01-16 17:01:36 +08:00
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"`
}
2025-12-27 18:12:05 +08:00
)