Ver código fonte

修改微信支付

abiao 3 semanas atrás
pai
commit
03226525a0

+ 36 - 0
.gitignore

@@ -0,0 +1,36 @@
+# IDE and editor files
+.idea/
+.vscode/
+.claude/
+*.iml
+.DS_Store
+
+# Go environment files
+.envrc
+gopls.mod
+go.work
+go.work.sum
+
+# Log files
+*.log
+logs/
+
+# Build output
+/build
+/pkg
+/bin
+/dist
+
+# Configuration files (local)
+conf/app.conf
+
+# Other
+*.dat
+*.out
+*.pyc
+*.pyo
+.cache/
+
+# Project specific
+pullcoding.sh
+clearlog.sh

+ 4 - 1
go/gopath/src/fohow.com/.gitignore

@@ -1,7 +1,10 @@
 .idea
 .cache
 .DS_Store
-
+/.claude
+/.vscode
+/.envrc
+gopls.mod
 *.iml
 *.log
 *.dat

+ 18 - 13
go/gopath/src/fohow.com/libs/wx_mp/pay.go

@@ -4,6 +4,7 @@ import (
 	// "encoding/json"
 	"encoding/xml"
 	"fmt"
+
 	"fohow.com/apps/models/order_model"
 
 	// "io/ioutil"
@@ -14,6 +15,7 @@ import (
 
 	"github.com/astaxie/beego"
 	"github.com/uuid"
+
 	// "github.com/astaxie/beego/context"
 	"github.com/chanxuehong/wechat/mch"
 	// "github.com/chanxuehong/wechat/mch/mmpaymkttransfers"
@@ -113,24 +115,27 @@ type PayResult struct {
 	FeeType            string   `xml:"fee_type"`             //货币种类
 	CashFee            string   `xml:"cash_fee"`             //cash_fee
 	CashFeeType        string   `xml:"cash_fee_type"`        //现金支付货币类型
-	CouponFee          string   `xml:"coupon_fee"`           //提货券或立减优惠金额
-	CouponCount        string   `xml:"coupon_count"`         //提货券或立减优惠使用数量
+	CouponFee          string   `xml:"coupon_fee"`           //代金券或立减优惠金额
+	CouponCount        string   `xml:"coupon_count"`         //代金券或立减优惠使用数量
 
 	TransactionId string `xml:"transaction_id"` //微信支付订单号
 	OutTradeNO    string `xml:"out_trade_no"`   //商户订单号
 	Attach        string `xml:"attach"`         // 商家数据包
 	TimeEnd       string `xml:"time_end"`       // 支付完成时间 yyyyMMddHHmmss
-	//coupon_id_$n
-	//coupon_fee_$na
-	//新增 coupon_fee
-	CouponFee0 string `xml:"coupon_fee_0"` //单个提货券支付金额,$n为下标,从0开始编号
-	CouponId0  string `xml:"coupon_id_0"`  //提货券ID,$n为下标,从0开始编号
-	CouponFee1 string `xml:"coupon_fee_1"` //单个提货券支付金额,$n为下标,从0开始编号
-	CouponId1  string `xml:"coupon_id_1"`  //提货券ID,$n为下标,从0开始编号
-	CouponFee2 string `xml:"coupon_fee_2"` //单个提货券支付金额,$n为下标,从0开始编号
-	CouponId2  string `xml:"coupon_id_2"`  //提货券ID,$n为下标,从0开始编号
-	CouponFee3 string `xml:"coupon_fee_3"` //单个提货券支付金额,$n为下标,从0开始编号
-	CouponId3  string `xml:"coupon_id_3"`  //提货券ID,$n为下标,从0开始编号
+
+	// 代金券相关字段
+	CouponFee0 string `xml:"coupon_fee_0"` //单个代金券支付金额,$n为下标,从0开始编号
+	CouponId0  string `xml:"coupon_id_0"`  //代金券ID,$n为下标,从0开始编号
+	CouponFee1 string `xml:"coupon_fee_1"` //单个代金券支付金额,$n为下标,从0开始编号
+	CouponId1  string `xml:"coupon_id_1"`  //代金券ID,$n为下标,从0开始编号
+	CouponFee2 string `xml:"coupon_fee_2"` //单个代金券支付金额,$n为下标,从0开始编号
+	CouponId2  string `xml:"coupon_id_2"`  //代金券ID,$n为下标,从0开始编号
+	CouponFee3 string `xml:"coupon_fee_3"` //单个代金券支付金额,$n为下标,从0开始编号
+	CouponId3  string `xml:"coupon_id_3"`  //代金券ID,$n为下标,从0开始编号
+	CouponFee4 string `xml:"coupon_fee_4"` //单个代金券支付金额,$n为下标,从0开始编号
+	CouponId4  string `xml:"coupon_id_4"`  //代金券ID,$n为下标,从0开始编号
+	CouponFee5 string `xml:"coupon_fee_5"` //单个代金券支付金额,$n为下标,从0开始编号
+	CouponId5  string `xml:"coupon_id_5"`  //代金券ID,$n为下标,从0开始编号
 }
 
 // 获取jsSDK微信支付需要的数据