Documentation
¶
Index ¶
- Constants
- func ParseDate(timeStr string) time.Time
- type Client
- type ClientConfig
- type OrderResp
- func CloseOf(channelErrorCode, channelErrorMsg, outTradeNo string, rawData any) *OrderResp
- func Of(status uint8, channelOrderNo string, channelUserId *string, ...) *OrderResp
- func SuccessOf(channelOrderNo string, channelUserId string, successTime time.Time, ...) *OrderResp
- func WaitingOf(displayMode, displayContent *string, outTradeNo string, rawData any) *OrderResp
- type OrderUnifiedReq
- type Properties
- type RefundResp
- type RefundUnifiedReq
Constants ¶
View Source
const ( Url = "url" Iframe = "iframe" From = "from" QrCode = "qr_code" QrCodeUrl = "qr_code_url" BarCode = "bar_code" App = "app" )
支付方式
View Source
const ( WAITING uint8 = (iota + 1) * 10 SUCCESS REFUND CLOSED ERROR )
支付状态
View Source
const ( Wx = "Wx" WxPub = "WxPub" WxLite = "WxLite" WxApp = "WxApp" WxNative = "WxNative" Ali = "Ali" AlipayPc = "AlipayPc" AlipayWap = "AlipayWap" AlipayApp = "AlipayApp" AlipayQr = "AlipayQr" AlipayBar = "AlipayBar" Mock = "mock" Wallet = "wallet" )
支付渠道
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { // Init 初始化 Init() error // UnifiedOrder 统一下单 UnifiedOrder(context.Context, OrderUnifiedReq) (*OrderResp, error) // GetId 获取渠道id GetId() uint64 // GetOrder 获得支付订单 GetOrder(context.Context, string) (*OrderResp, error) // Refresh 刷新配置 Refresh(config ClientConfig) error // UnifiedRefund 退款 返回 WAIT 状态. 后续 job 会轮询 UnifiedRefund(context.Context, RefundUnifiedReq) (*RefundResp, error) // ParseOrderNotify 解析支付回调 ParseOrderNotify(r *http.Request) (*OrderResp, error) }
Client 支付客户端
type OrderResp ¶
type OrderResp struct { Status uint8 OutTradeNo string ChannelOrderNo string ChannelUserId *string SuccessTime time.Time RawData any DisplayMode *string DisplayContent *string ChannelErrorCode *string ChannelErrorMsg *string }
func Of ¶
func Of(status uint8, channelOrderNo string, channelUserId *string, successTime time.Time, outTradeNo string, rawData any) *OrderResp
Of 创建支付订单
type OrderUnifiedReq ¶
type Properties ¶
type Properties struct { OrderNotifyUrl string RefundNotifyUrl string OrderNoPrefix string RefundNoPrefix string }
Properties 支付配置
type RefundResp ¶
Click to show internal directories.
Click to hide internal directories.