Skip to content
go sdk , payjs.cn
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore 扫码支付 Dec 26, 2017
README.md Update README.md Dec 26, 2017
payjs.go 扫码支付 Dec 26, 2017

README.md

payjs

payjs.cn Go版 SDK by trysh

func main() {
    prikey := ``//通信密钥
    mchid := ``商户号
    pj := payjs.New(mchid, prikey)//新建一个引擎
    res, err := pj.CreateTrade(payjs.TradeParam{    //创建一个扫码支付
        Total_fee:    1,    //1分钱
        Out_trade_no: time.Now().Format("test20060102_150405.999999999"),
        Body:         `测试的标题`,
        Notify_url:   `https://xxx.com/callback`,
    })
    if err != nil {
        log.Println(`payjs CreateTrade err`, err)
        return
    }
    /*返回示例:
    {"code_url":"weixin://wxpay/bizpayurl?pr=xxxxx",
    "out_trade_no":"xxx",
    "payjs_order_id":"2017xxx",
    "return_code":1,
    "return_msg":"SUCCESS",
    "total_fee":"1",
    "sign":"xxx"}
    */
}
You can’t perform that action at this time.