A fast wxpay(v2) development sdk written in Golang
go get github.com/fastwego/wxpay
// 微信支付 实例
pay = wxpay . New (wxpay. Config {
Appid : "APPID" ,
Mchid : "MCHID" ,
ApiKey : "APIKEY" ,
//IsSandBoxMode: true,
Cert : "CERT" ,
})
// 统一下单
params := map [ string ] string {
"appid" : pay . Config . Appid ,
"mch_id" : pay . Config . Mchid ,
"nonce_str" : util . GetRandString ( 32 ),
"body" : "BODY" ,
"out_trade_no" : "NO.10086" ,
"total_fee" : c . Request . URL . Query (). Get ( "fee" ), // 201
"spbill_create_ip" : "12.123.14.223" ,
"notify_url" : viper . GetString ( "NOTIFYURL" ),
"trade_type" : types . TradeTypeAPP ,
}
result , err := order . UnifiedOrder ( pay , params )
fmt . Println ( result , err )
if err != nil {
return
}
// 返回客户端预下单信息
//result["prepay_id"]
Complete demo project:
https://github.com/fastwego/wxpay-demo
See a list of all supported APIs
"Quick", as the core concept of framework design, is reflected in all aspects:
As a third-party development framework, it is as close to official documents and designs as possible, without introducing new concepts or adding learning burden to developers.
The comments of each interface are accompanied by links to official documents, allowing you to read them at any time, saving time and worry.
100% coverage of every interface, allowing you to be confident every time you call
FastWeGo is a complete WeChat development framework, including official accounts, open platforms, WeChat payment, corporate WeChat, mini programs, mini games and other WeChat services, and has a large developer user base
Almost all the problems you encounter can be solved in the community
Welcome to submit pull requests/issues/documents, and let’s make WeChat development faster and better together!
Faster we go together!
Join the developer communication group