pays_with_go-master.zip
大小:16.42KB
价格:10积分
下载量:0
评分:
5.0
上传者:weixin_42411512
更新日期:2025-09-22

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

资源文件列表(大概)

文件名
大小
pays_with_go-master/
-
pays_with_go-master/LICENSE
1.07KB
pays_with_go-master/README.md
3.56KB
pays_with_go-master/callback.go
3.7KB
pays_with_go-master/client/
-
pays_with_go-master/client/aliapp.go
2.27KB
pays_with_go-master/client/aliweb.go
3.43KB
pays_with_go-master/client/http.go
1.42KB
pays_with_go-master/client/wechatapp.go
3.19KB
pays_with_go-master/client/wechatweb.go
3.88KB
pays_with_go-master/common/
-
pays_with_go-master/common/alipay.go
2.19KB
pays_with_go-master/common/common.go
1.59KB
pays_with_go-master/common/wechat.go
2.07KB
pays_with_go-master/constant/
-
pays_with_go-master/constant/pay.go
151B
pays_with_go-master/pay.go
1.35KB
pays_with_go-master/pay_test.go
1010B
pays_with_go-master/util/
-
pays_with_go-master/util/util.go
668B
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```javascriptpackage mainimport ( "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.xxxreturn}//接下来处理自己的逻辑fmt.Println(aliResult)})}```关注公众号:源码大数据,获取海量精品教程和源码。![输入图片说明](https://images.gitee.com/uploads/images/2020/1219/150248_4e689de1_448435.jpeg "qrcode_for_gh_98b00c86c473_258.jpg")

用户评论 (0)

发表评论

captcha