新增支付

fix/release
mofangmin 1 year ago
parent 19b4c3bc97
commit 2a55a42889
  1. 2
      cmd/build.sh
  2. 4
      modules/pay/eanipay/base.go
  3. 8
      modules/pay/values/values.go

@ -8,4 +8,4 @@ cd pb/proto
# go generate # go generate
cd ../.. cd ../..
#go build main.go #go build main.go
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o indiaprovider main.go CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gamserver main.go

@ -102,7 +102,7 @@ func (s *Sub) PackPayReq() interface{} {
MerchantTradeNo: r.OrderID, MerchantTradeNo: r.OrderID,
Amount: fmt.Sprintf("%d", r.Amount), Amount: fmt.Sprintf("%d", r.Amount),
Currency: "INR", Currency: "INR",
Description: "TeenPatti", Description: "BW",
Payer: Payer{UserID: fmt.Sprintf("%d", r.UID), Name: r.Name, Email: r.Email, Phone: r.Phone}, Payer: Payer{UserID: fmt.Sprintf("%d", r.UID), Name: r.Name, Email: r.Email, Phone: r.Phone},
PayMethod: struct { PayMethod: struct {
Type string `json:"type"` // UPI Type string `json:"type"` // UPI
@ -123,7 +123,7 @@ func (s *Sub) PackWithdrawReq() interface{} {
MerchantTradeNo: r.OrderID, MerchantTradeNo: r.OrderID,
Amount: fmt.Sprintf("%d", r.Amount), Amount: fmt.Sprintf("%d", r.Amount),
Currency: "INR", Currency: "INR",
Description: "TeenPatti", Description: "BW",
NotifyUrl: values.GetWithdrawCallback(values.EaniPay), NotifyUrl: values.GetWithdrawCallback(values.EaniPay),
} }
if r.PayType == common.WithdrawTypeBank { if r.PayType == common.WithdrawTypeBank {

@ -238,20 +238,20 @@ func PayCallback(w PayWay) {
// 获取支付回调路径 // 获取支付回调路径
func GetPayCallback(way PayWay) string { func GetPayCallback(way PayWay) string {
return config.GetConfig().Pay.CallbackURL + config.GetConfig().Pay.Addr + "/callback/pay/" + fmt.Sprintf("%d", way) return config.GetConfig().Pay.CallbackURL + "/callback/pay/" + fmt.Sprintf("%d", way)
} }
// 获取退出回调路径 // 获取退出回调路径
func GetWithdrawCallback(way PayWay) string { func GetWithdrawCallback(way PayWay) string {
return config.GetConfig().Pay.CallbackURL + config.GetConfig().Pay.Addr + "/callback/withdraw/" + fmt.Sprintf("%d", way) return config.GetConfig().Pay.CallbackURL + "/callback/withdraw/" + fmt.Sprintf("%d", way)
} }
func GetFrontCallback() string { func GetFrontCallback() string {
return config.GetConfig().Pay.CallbackURL + config.GetConfig().Pay.Addr + "/common/front/payCallback" return config.GetConfig().Pay.CallbackURL + "/common/front/payCallback"
} }
func GetFrontCallbackFail() string { func GetFrontCallbackFail() string {
return config.GetConfig().Pay.CallbackURL + config.GetConfig().Pay.Addr + "/common/front/payCallback/fail" return config.GetConfig().Pay.CallbackURL + "/common/front/payCallback/fail"
} }
// 根据body里的字段直接拼接出签名字符串 // 根据body里的字段直接拼接出签名字符串

Loading…
Cancel
Save