js

package
v0.0.0-...-c53dbe1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Js

type Js struct {
	*context.Context
}

Js struct

func NewJs

func NewJs(context *context.Context) *Js

NewJs init

func (*Js) Create

func (js *Js) Create(totalFeeReq int64, bodyReq, outTradeNoReq, attachReq, openid string) (jsApiResponse JsApiResponse, err error)

Create 获取发起支付所需要的参数

type JsApi

type JsApi struct {
	AppID     string `json:"appId"`
	TimeStamp string `json:"timeStamp"`
	NonceStr  string `json:"nonceStr"`
	Package   string `json:"package"`
	SignType  string `json:"signType"`
	PaySign   string `json:"paySign"`
}

JsApi

type JsApiRequest

type JsApiRequest struct {
	MchID      string `json:"mchid"`        //Y	商户号
	TotalFee   int64  `json:"total_fee"`    //Y	金额。单位:分
	OutTradeNo string `json:"out_trade_no"` //Y	用户端自主生成的订单号,在用户端要保证唯一性
	Body       string `json:"body"`         //N	订单标题
	Attach     string `json:"attach"`       //N	用户自定义数据,在notify的时候会原样返回
	NotifyUrl  string `json:"notify_url"`   //N	接收微信支付异步通知的回调地址。必须为可直接访问的URL,不能带参数、session验证、csrf验证。留空则不通知
	Openid     string `json:"openid"`       //Y	用户openid
	Sign       string `json:"sign"`         //Y	数据签名 详见签名算法
}

JsApiRequest

type JsApiResponse

type JsApiResponse struct {
	ReturnCode   int    `json:"return_code"`    //Y	0:失败 1:成功
	ReturnMsg    string `json:"return_msg"`     //Y	失败原因
	PayJSOrderID string `json:"payjs_order_id"` //Y	PAYJS 侧订单号
	JsApi        JsApi  `json:"jsapi"`          //N	用于发起支付的支付参数
	Sign         string `json:"sign"`           //Y	数据签名
}

JsApiResponse

Jump to

Keyboard shortcuts

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