beecloudsdk

package module
v0.0.0-...-30310b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

README

beecloudsdk

beecloud pay sdk

Documentation

Index

Constants

View Source
const (
	ConfigAnalysisSceneInfo = "scene_info"
	ConfigAnalysisIp        = "ip"
)

Variables

This section is empty.

Functions

func EncryptMD5

func EncryptMD5(data []byte) []byte

EncryptMD5 encrypt given []byte with MD5 algorithm

func H5WechatPay

func H5WechatPay(cfg *Config) (string, error)

微信H5支付

func HttpSendGet

func HttpSendGet(u string, param []byte) ([]byte, error)

func HttpSendPost

func HttpSendPost(url string, body []byte) ([]byte, error)

func VerifySignNotify

func VerifySignNotify(appId string, transactionId string, transactionType string, channelType string, transactionFee int64, masterSecret string) string

Types

type BaseResponse

type BaseResponse struct {
	ResultCode int    `json:"result_code"`
	ResultMsg  string `json:"result_msg"`
	ErrDetail  string `json:"err_detail"`
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL