2025-01-10 00:09:25 +08:00
|
|
|
syntax = "v1"
|
|
|
|
|
|
|
|
info (
|
|
|
|
title: "支付服务"
|
|
|
|
desc: "支付服务"
|
|
|
|
author: "Liangzai"
|
|
|
|
email: "2440983361@qq.com"
|
|
|
|
version: "v1"
|
|
|
|
)
|
2025-03-17 15:59:09 +08:00
|
|
|
|
2025-01-10 00:09:25 +08:00
|
|
|
@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
|
|
|
|
}
|
|
|
|
|
|
|
|
@server (
|
|
|
|
prefix: api/v1
|
|
|
|
group: pay
|
|
|
|
jwt: JwtAuth
|
|
|
|
middleware: SourceInterceptor
|
|
|
|
)
|
|
|
|
service main {
|
|
|
|
// 支付
|
|
|
|
@handler Payment
|
|
|
|
post /pay/payment (PaymentReq) returns (PaymentResp)
|
|
|
|
|
|
|
|
@handler IapCallback
|
|
|
|
post /pay/iap_callback (IapCallbackReq)
|
2025-04-15 22:52:02 +08:00
|
|
|
|
|
|
|
@handler PaymentCheck
|
|
|
|
post /pay/check (PaymentCheckReq) returns (PaymentCheckResp)
|
2025-05-24 14:26:20 +08:00
|
|
|
|
|
|
|
@handler QueryPaymentCheck
|
|
|
|
post /pay/query_check (QueryPaymentCheckReq) returns (QueryPaymentCheckResp)
|
2025-03-17 15:59:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type (
|
|
|
|
PaymentReq {
|
|
|
|
Id string `json:"id"`
|
|
|
|
PayMethod string `json:"pay_method"`
|
2025-04-15 22:52:02 +08:00
|
|
|
PayType string `json:"pay_type" validate:"required,oneof=query agent_vip"`
|
2025-03-17 15:59:09 +08:00
|
|
|
}
|
|
|
|
PaymentResp {
|
|
|
|
PrepayData interface{} `json:"prepay_data"`
|
|
|
|
PrepayId string `json:"prepay_id"`
|
2025-04-15 22:52:02 +08:00
|
|
|
OrderNo string `json:"order_no"`
|
|
|
|
}
|
|
|
|
PaymentCheckReq {
|
|
|
|
OrderNo string `json:"order_no" validate:"required"`
|
|
|
|
}
|
|
|
|
PaymentCheckResp {
|
|
|
|
Type string `json:"type"`
|
|
|
|
Status string `json:"status"`
|
2025-03-17 15:59:09 +08:00
|
|
|
}
|
2025-05-24 14:26:20 +08:00
|
|
|
QueryPaymentCheckReq {
|
|
|
|
OrderNo string `json:"order_no" validate:"required"`
|
|
|
|
}
|
|
|
|
QueryPaymentCheckResp {
|
|
|
|
OrderStatus string `json:"order_status"`
|
|
|
|
AuthorizationStatus string `json:"authorization_status"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
IdCard string `json:"id_card"`
|
|
|
|
ProductName string `json:"product_name"`
|
|
|
|
}
|
2025-03-17 15:59:09 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
IapCallbackReq {
|
|
|
|
OrderID int64 `json:"order_id" validate:"required"`
|
|
|
|
TransactionReceipt string `json:"transaction_receipt" validate:"required"`
|
|
|
|
}
|
|
|
|
)
|