Skip to content

Commit

Permalink
add describe wechat
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Nov 10, 2023
1 parent e0288cd commit 0fa9812
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
32 changes: 17 additions & 15 deletions service/pay/helper/dto.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package helper

type Request struct {
AppID int64 `json:"appID"`
Sign string `json:"sign"`
PayMethod string `json:"payMethod"`
Amount string `json:"amount"`
User string `json:"user"`
PayAppName string `json:"payAppName,omitempty"`
Currency string `json:"currency,omitempty"`
AmountOptions []string `json:"amountOptions,omitempty"`
ExchangeRate float64 `json:"exchangeRate,omitempty"`
TaxRate float64 `json:"taxRate,omitempty"`
TradeNO string `json:"tradeNO,omitempty"`
StripeSuccessURL string `json:"stripeSuccessUrl,omitempty"`
StripeCancelURL string `json:"stripeCancelUrl,omitempty"`
SessionID string `json:"sessionID,omitempty"`
OrderID string `json:"orderID,omitempty"`
AppID int64 `json:"appID"`
Sign string `json:"sign"`
PayMethod string `json:"payMethod"`
Amount string `json:"amount"`
User string `json:"user"`
PayAppName string `json:"payAppName,omitempty"`
Currency string `json:"currency,omitempty"`
AmountOptions []string `json:"amountOptions,omitempty"`
ExchangeRate float64 `json:"exchangeRate,omitempty"`
TaxRate float64 `json:"taxRate,omitempty"`
TradeNO string `json:"tradeNO,omitempty"`
StripeSuccessURL string `json:"stripeSuccessUrl,omitempty"`
StripeCancelURL string `json:"stripeCancelUrl,omitempty"`
SessionID string `json:"sessionID,omitempty"`
OrderID string `json:"orderID,omitempty"`
Describe string `json:"describe,omitempty"`
WechatCallbackURL string `json:"wechatCallbackUrl,omitempty"`
}
2 changes: 1 addition & 1 deletion service/pay/method/wechat.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func GetWechatURL(c *gin.Context, request *helper.Request, client *mongo.Client)

user := request.User
tradeNO := pay.GetRandomString(32)
codeURL, err := pay.WechatPay(amount, user, tradeNO, "", "")
codeURL, err := pay.WechatPay(amount, user, tradeNO, request.Describe, request.WechatCallbackURL)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": fmt.Sprintf("error codeURL : %s, %v", codeURL, err)})
return
Expand Down

0 comments on commit 0fa9812

Please sign in to comment.