miniapp

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MiniApp

type MiniApp struct {
	*context.Context
}

MiniApp struct

func NewMiniApp

func NewMiniApp(context *context.Context) *MiniApp

NewMiniApp init

func (*MiniApp) GetOrderInfo

func (miniApp *MiniApp) GetOrderInfo(totalFeeReq int64, bodyReq, outTradeNoReq, attachReq string) (orderInfo OrderInfo, err error)

GetOrderInfo 获取小程序跳转所需的参数

type OrderInfo

type OrderInfo struct {
	MchID      string `json:"mch_id"`       //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 异步通知地址
	Nonce      string `json:"nonce"`        //Y 随机字符串
	Sign       string `json:"sign"`         //Y 数据签名 详见签名算法
}

OrderInfo 后端按照下面参数构造订单参数,返回给前端

Jump to

Keyboard shortcuts

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