|
@@ -60,7 +60,7 @@ func (p *DataExportPayAction) SacnPay_WaitPay() error {
|
|
|
log.Println("二维码已失效,重新生成预订单!", openid)
|
|
|
surplus_second = 0
|
|
|
now := time.Now()
|
|
|
- if pay_way == "微信" {
|
|
|
+ if pay_way == "wx_pc" {
|
|
|
tradeno, ret := public.WxStruct.CreatePrepayOrder(config.Sysconfig["weixinrpc"].(string), "b", p.IP(), openid, "", orderMoney)
|
|
|
if ret != nil {
|
|
|
if public.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
@@ -75,7 +75,7 @@ func (p *DataExportPayAction) SacnPay_WaitPay() error {
|
|
|
codeUrl = util.ObjToString((*ret)["codeurl"])
|
|
|
}
|
|
|
}
|
|
|
- } else if pay_way == "支付宝" {
|
|
|
+ } else if pay_way == "ali_pc" {
|
|
|
payOutTime := now.Add(time.Hour * 2)
|
|
|
if qr_url, tradeno, err := Alipay.GetPayUrl(util.Float64All(orderMoney), util.FormatDate(&payOutTime, util.Date_Full_Layout)); err == nil {
|
|
|
if public.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
@@ -95,7 +95,7 @@ func (p *DataExportPayAction) SacnPay_WaitPay() error {
|
|
|
}
|
|
|
return surplus_second, orderMoney, codeUrl, pay_way
|
|
|
}()
|
|
|
- if pay_way == "微信" {
|
|
|
+ if pay_way == "wx_pc" {
|
|
|
r, _ := qr.Encode(qrcode, qr.M)
|
|
|
pngdat := r.PNG()
|
|
|
qrcode = base64.StdEncoding.EncodeToString(pngdat)
|
|
@@ -128,11 +128,6 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
|
|
|
}
|
|
|
user_mail_status := util.ObjToString(p.GetSession("DataExportVerifyEmail_val")) != ""
|
|
|
pay_way := p.GetString("pay_way")
|
|
|
- if pay_way == "weixin" {
|
|
|
- pay_way = "微信"
|
|
|
- } else if pay_way == "alipay" {
|
|
|
- pay_way = "支付宝"
|
|
|
- }
|
|
|
user_mail, _ := p.GetSession("DataExportVerifyEmail_val").(string)
|
|
|
user_phone, _ := p.GetSession("DataExportVerifyPhone").(string)
|
|
|
if user_phone != "" {
|
|
@@ -275,7 +270,7 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
|
|
|
}
|
|
|
if isPass {
|
|
|
//创建微信预支付订单
|
|
|
- if pay_way == "微信" {
|
|
|
+ if pay_way == "wx_pc" {
|
|
|
tradeno, ret := public.WxStruct.CreatePrepayOrder(config.Sysconfig["weixinrpc"].(string), "b", p.IP(), openId, "", order_money)
|
|
|
log.Println("支付交易单", openId, ret)
|
|
|
if ret != nil && (*ret)["status"] == "1" {
|
|
@@ -315,7 +310,7 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
|
|
|
} else {
|
|
|
log.Println("生成微信预支付交易单失败", ret)
|
|
|
}
|
|
|
- } else if pay_way == "支付宝" {
|
|
|
+ } else if pay_way == "ali_pc" {
|
|
|
now := time.Now()
|
|
|
payOutTime := now.Add(time.Hour * 2)
|
|
|
if qr_url, tradeno, err := Alipay.GetPayUrl(util.Float64All(order_money), util.FormatDate(&payOutTime, util.Date_Full_Layout)); err == nil {
|
|
@@ -412,7 +407,7 @@ func (p *DataExportPayAction) GetOrderPayMsg() {
|
|
|
codeUrl := ""
|
|
|
now := time.Now()
|
|
|
prepay_time = util.FormatDate(&now, util.Date_Full_Layout)
|
|
|
- if pay_way == "微信" {
|
|
|
+ if pay_way == "wx_pc" {
|
|
|
tradeno, ret := public.WxStruct.CreatePrepayOrder(config.Sysconfig["weixinrpc"].(string), "b", p.IP(), openid, "", orderMoney)
|
|
|
if ret != nil {
|
|
|
if public.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
@@ -431,7 +426,7 @@ func (p *DataExportPayAction) GetOrderPayMsg() {
|
|
|
return "", "创建微信订单出错", false
|
|
|
}
|
|
|
}
|
|
|
- } else if pay_way == "支付宝" {
|
|
|
+ } else if pay_way == "ali_pc" {
|
|
|
payOutTime := now.Add(time.Hour * 2)
|
|
|
if qr_url, tradeno, err := Alipay.GetPayUrl(util.Float64All(orderMoney), util.FormatDate(&payOutTime, util.Date_Full_Layout)); err == nil {
|
|
|
if public.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
@@ -472,10 +467,10 @@ func CloseDataExportOrder(payWay, tradeno, prepayTime string) (status bool) {
|
|
|
}
|
|
|
}
|
|
|
log.Printf("%s取消订单,订单号%s\n", payWay, tradeno)
|
|
|
- if payWay == "支付宝" {
|
|
|
+ if payWay == "ali_pc" {
|
|
|
status = Alipay.CloseOrder(tradeno)
|
|
|
}
|
|
|
- if payWay == "微信" {
|
|
|
+ if payWay == "wx_pc" {
|
|
|
status = public.WxStruct.CloseOrder(config.Sysconfig["weixinrpc"].(string), tradeno)
|
|
|
}
|
|
|
if !status {
|