Go 的微信支付商户平台 SDK wxpay

码农软件 · 软件分类 · 微信/微信小程序 · 2019-03-14 06:57:32

软件介绍

wxpay 是一个使用Go语言编写的微信支付商户平台SDK。

举个栗子

以查询企业付款API为栗:

package main

import (
    "log"

    "github.com/go-with/wxpay"
)

const (
    appId  = "" // 微信公众平台应用ID
    mchId  = "" // 微信支付商户平台商户号
    apiKey = "" // 微信支付商户平台API密钥

    // 微信支付商户平台证书路径
    certFile   = "cert/apiclient_cert.pem"
    keyFile    = "cert/apiclient_key.pem"
    rootcaFile = "cert/rootca.pem"
)

func main() {
    c := wxpay.NewClient(appId, mchId, apiKey)

    // 附着商户证书
    err := c.WithCert(certFile, keyFile, rootcaFile)
    if err != nil {
        log.Fatal(err)
    }

    params := make(wxpay.Params)
    // 查询企业付款接口请求参数
    params.SetString("appid", c.AppId)
    params.SetString("mch_id", c.MchId)
    params.SetString("nonce_str", "5K8264ILTKCH16CQ2502SI8ZNMTM67VS")  // 随机字符串
    params.SetString("partner_trade_no", "10000098201411111234567890") // 商户订单号
    params.SetString("sign", c.Sign(params))                           // 签名

    // 查询企业付款接口请求URL
    url := "https://api.mch.weixin.qq.com/mmpaymkttransfers/gettransferinfo"

    // 发送查询企业付款请求
    ret, err := c.Post(url, params, true)
    if err != nil {
        log.Fatal(err)
    }

    log.Print(ret)
}

本文地址:https://codercto.com/soft/d/1302.html

无界面交互

无界面交互

[美]Golden Krishna / 杨名 / 人民邮电出版社 / 2017-1 / 49.00元

“真希望在硅谷工作的人们已经读过这本书了。”——Doug LeMoine,Cooper总经理 “这本书的写作看似随意,字里行间却透着一种辛辣、幽默的反叛精神,这种精神可以帮助我们走出当今交互设计的界面泥潭。当你心情低落时,不妨翻开这本书,读上几页,你会开始微笑,大笑,并从中学到很多东西。书中的文字有一股振奋人心的力量。”——Don Norman,加州大学圣迭戈分校设计实验室主任,《设计心理学......一起来看看 《无界面交互》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具