Documentation ¶
Index ¶
- Constants
- func EncryptMD5(data []byte) []byte
- func H5WechatPay(cfg *Config) (string, error)
- func HttpSendGet(u string, param []byte) ([]byte, error)
- func HttpSendPost(url string, body []byte) ([]byte, error)
- func VerifySignNotify(appId string, transactionId string, transactionType string, channelType string, ...) string
- type BaseResponse
- type Config
- type H5WeChatNotifyRequest
- type H5WechatPayResponse
- type OrderQueryResponse
- type OrderQueryResponseBill
Constants ¶
View Source
const ( ConfigAnalysisSceneInfo = "scene_info" ConfigAnalysisIp = "ip" )
Variables ¶
This section is empty.
Functions ¶
func EncryptMD5 ¶
EncryptMD5 encrypt given []byte with MD5 algorithm
Types ¶
type BaseResponse ¶
type Config ¶
type Config struct { AppId string // beeCloud 平台应用唯一标识 AppSecret string // beeCloud 平台应用密钥 MasterSecret string // beeCloud平台密钥 Amount int64 // 金额,单位分 BillNo string // 商户订单号 length: [8-20] Title string // 订单标题 32 byte ReturnUrl string // 同步返回地址 NotifyUrl string // 异步通知地址 Analysis map[string]interface{} // 附加数据 NotifyBody io.ReadCloser // 异步通知数据 }
type H5WeChatNotifyRequest ¶
type H5WeChatNotifyRequest struct { Signature string `json:"signature"` // 签名 Timestamp int64 `json:"timestamp"` // 时间毫秒 ChannelType string `json:"channel_type"` // 取道类型 TransactionId string `json:"transaction_id"` // 交易单号 TransactionType string `json:"transaction_type"` // 交易类型 TransactionFee int64 `json:"transaction_fee"` // 实付金额 BillFee int64 `json:"bill_fee"` // 订单金额 TradeSuccess bool `json:"trade_success"` // 交易是否成功 }
func H5WeChatNotifyAnalysis ¶
func H5WeChatNotifyAnalysis(cfg *Config) (*H5WeChatNotifyRequest, error)
type H5WechatPayResponse ¶
type H5WechatPayResponse struct { BaseResponse Id string `json:"id"` Url string `json:"url"` // 确认支付页面url }
type OrderQueryResponse ¶
type OrderQueryResponse struct { BaseResponse Bills []*OrderQueryResponseBill `json:"bills"` }
type OrderQueryResponseBill ¶
type OrderQueryResponseBill struct { SpayResult bool `json:"spay_result"` // 订单是否成功 TradeNo string `json:"trade_no"` // 渠道交易号 TotalFee int64 `json:"total_fee"` // 金额 SuccessTime int64 `json:"success_time"` // 订单支付成功时间 }
func OrderQuery ¶
func OrderQuery(cfg *Config) (*OrderQueryResponseBill, error)
Click to show internal directories.
Click to hide internal directories.