首页下载资源移动开发golang支付合集(包括微信支付,支付宝,后期会加入聚合支付).zip

ZIPgolang支付合集(包括微信支付,支付宝,后期会加入聚合支付).zip

weixin_4241151216.42KB需要积分:1

资源文件列表:

pays_with_go-master.zip 大约有21个文件
  1. pays_with_go-master/
  2. pays_with_go-master/LICENSE 1.07KB
  3. pays_with_go-master/README.md 3.56KB
  4. pays_with_go-master/callback.go 3.7KB
  5. pays_with_go-master/client/
  6. pays_with_go-master/client/aliapp.go 2.27KB
  7. pays_with_go-master/client/aliweb.go 3.43KB
  8. pays_with_go-master/client/http.go 1.42KB
  9. pays_with_go-master/client/wechatapp.go 3.19KB
  10. pays_with_go-master/client/wechatweb.go 3.88KB
  11. pays_with_go-master/common/
  12. pays_with_go-master/common/alipay.go 2.19KB
  13. pays_with_go-master/common/common.go 1.59KB
  14. pays_with_go-master/common/wechat.go 2.07KB
  15. pays_with_go-master/constant/
  16. pays_with_go-master/constant/pay.go 151B
  17. pays_with_go-master/pay.go 1.35KB
  18. pays_with_go-master/pay_test.go 1010B
  19. pays_with_go-master/util/
  20. pays_with_go-master/util/util.go 668B
  21. pays_with_go-master/util/xml.go 639B

资源介绍:

golang支付库 想必gopher们都会抱怨go成熟的包太少,特别是go语言支付这块,网上的代码基本没有能用的,要么不全,要么有硬伤,所以结合网上和自己经验,抽出时间写的一部分代码,封装下分享出来,希望能给大家一点借鉴意义。原创不易,喜欢的朋友star一下吧~
# golang支付合集(包括微信支付,支付宝,后期会加入聚合支付)喜欢的朋友star一下吧~ ## tips:作者新书《零基础Go语言算法实战》出版了,欢迎京东当当购买! #### 免费开源代码库:https://gitee.com/shirdonl/goAlgorithms #### (当当(🔥🔥🔥🔥🔥🔥 活动抢购中):https://product.dangdang.com/11726270217.html #### (京东(🔥🔥🔥🔥🔥🔥 活动抢购中):https://item.jd.com/14101229.html ## tips:作者《Go Web编程实战派》出版了,欢迎京东当当购买! #### (京东(🔥🔥🔥🔥🔥🔥活动抢购中......):https://item.jd.com/13200972.html #### (当当(🔥🔥🔥🔥🔥🔥活动抢购中......):http://product.dangdang.com/29225055.html ## tips:作者《Go语言高级开发与实战》出版了,欢迎京东当当购买! #### (当当(🔥🔥🔥🔥🔥🔥 活动抢购中......):http://product.dangdang.com/29359572.html #### (京东(🔥🔥🔥🔥🔥🔥 活动抢购中......):https://item.jd.com/13594166.html * golang支付库 想必gopher们都会抱怨go成熟的包太少,特别是go语言支付这块,网上的代码基本没有能用的,要么不全,要么有硬伤,所以结合网上和自己经验,抽出时间写的一部分代码,封装下分享出来,希望能给大家一点借鉴意义。原创不易,喜欢的朋友star一下吧~ * 支持的支付方式 目前支持微信app,支付宝网页版,支付宝app。要是谁有新的支付方式也可以合并。 * 项目开源协议:[MIT](https://gitee.com/shirdonl/pays_with_go/blob/master/LICENSE) * github地址:https://github.com/shirdonliao/pays_with_go * 使用方法 * ##### 1.git clone https://gitee.com/shirdonl/pays_with_go.git 或者 go get gitee.com/shirdonl/pays_with_go * ##### 2.在自己的项目里调用,示例代码如下,确保填入自己的配置参数,开发中有问题欢迎留言或者关注公众号:codebigdata ```javascript package main import ( "fmt" "gitee.com/shirdonl/pays_with_go" "gitee.com/shirdonl/pays_with_go/client" "gitee.com/shirdonl/pays_with_go/common" "gitee.com/shirdonl/pays_with_go/constant" "net/http" ) func main() { //设置支付宝账号信息 initClient() //设置回调函数 initHandle() //支付 charge := new(common.Charge) charge.PayMethod = constant.ALI_APP //支付方式 charge.MoneyFee = 1 // 支付钱单位分 charge.Describe = "测试订单" //支付描述 charge.TradeNum = "88888888" //交易号 charge.CallbackURL = "http://127.0.0.1/callback/aliappcallback" //回调地址必须跟下面一样 //导入包 fdata, err := pays_with_go.Pay(charge) if err != nil { fmt.Println(err) return } fmt.Println(fdata) } // func initClient() { client.InitAliAppClient(&client.AliAppClient{ PartnerID: "xxx", SellerID: "xxxx", AppID: "xxx", PrivateKey: nil, PublicKey: nil, }) } func initHandle() { http.HandleFunc("callback/aliappcallback", func(w http.ResponseWriter, r *http.Request) { //返回支付结果 aliResult, err := pays_with_go.AliAppCallback(w, r) if err != nil { fmt.Println(err) //log.xxx return } //接下来处理自己的逻辑 fmt.Println(aliResult) }) } ``` 关注公众号:源码大数据,获取海量精品教程和源码。 ![输入图片说明](https://images.gitee.com/uploads/images/2020/1219/150248_4e689de1_448435.jpeg "qrcode_for_gh_98b00c86c473_258.jpg")
100+评论
captcha