|
@@ -5,6 +5,7 @@ import ( |
|
|
local_wxpay "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/lib/local_wechat" |
|
|
local_wxpay "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/lib/local_wechat" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/md" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/md" |
|
|
zhios_pay_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/utils" |
|
|
zhios_pay_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/utils" |
|
|
|
|
|
"encoding/json" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"github.com/iGoogle-ink/gopay" |
|
|
"github.com/iGoogle-ink/gopay" |
|
|
"github.com/iGoogle-ink/gopay/wechat" |
|
|
"github.com/iGoogle-ink/gopay/wechat" |
|
@@ -82,6 +83,17 @@ func AlipayWap(args map[string]string) (string, error) { |
|
|
return zhios_pay_utils.AnyToString(param), nil |
|
|
return zhios_pay_utils.AnyToString(param), nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type AlipayAppletData struct { |
|
|
|
|
|
Code int `json:"code"` |
|
|
|
|
|
Msg string `json:"msg"` |
|
|
|
|
|
Data struct { |
|
|
|
|
|
Code string `json:"code"` |
|
|
|
|
|
Msg string `json:"msg"` |
|
|
|
|
|
OutTradeNo string `json:"out_trade_no"` |
|
|
|
|
|
TradeNo string `json:"trade_no"` |
|
|
|
|
|
} `json:"data"` |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func AlipayApplet(args map[string]string, isPrd bool) (string, error) { |
|
|
func AlipayApplet(args map[string]string, isPrd bool) (string, error) { |
|
|
var url string |
|
|
var url string |
|
|
if isPrd == true { |
|
|
if isPrd == true { |
|
@@ -109,7 +121,12 @@ func AlipayApplet(args map[string]string, isPrd bool) (string, error) { |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return "", err |
|
|
return "", err |
|
|
} |
|
|
} |
|
|
return string(bytes), nil |
|
|
|
|
|
|
|
|
var data AlipayAppletData |
|
|
|
|
|
err = json.Unmarshal(bytes, &data) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return "", errors.New("支付失败") |
|
|
|
|
|
} |
|
|
|
|
|
return zhios_pay_utils.SerializeStr(data), nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 微信app支付v2 |
|
|
// 微信app支付v2 |
|
|