|
@@ -327,11 +327,6 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
|
|
}
|
|
}
|
|
user_mail_status := util.ObjToString(p.GetSession("DataExportVerifyEmail_val")) != ""
|
|
user_mail_status := util.ObjToString(p.GetSession("DataExportVerifyEmail_val")) != ""
|
|
pay_way := p.GetString("pay_way")
|
|
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_mail, _ := p.GetSession("DataExportVerifyEmail_val").(string)
|
|
user_phone, _ := p.GetSession("DataExportVerifyPhone").(string)
|
|
user_phone, _ := p.GetSession("DataExportVerifyPhone").(string)
|
|
if user_phone != "" {
|
|
if user_phone != "" {
|
|
@@ -474,7 +469,7 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
|
|
}
|
|
}
|
|
if isPass {
|
|
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)
|
|
tradeno, ret := public.WxStruct.CreatePrepayOrder(config.Sysconfig["weixinrpc"].(string), "b", p.IP(), openId, "", order_money)
|
|
log.Println("支付交易单", openId, ret)
|
|
log.Println("支付交易单", openId, ret)
|
|
if ret != nil && (*ret)["status"] == "1" {
|
|
if ret != nil && (*ret)["status"] == "1" {
|
|
@@ -514,7 +509,7 @@ func (p *DataExportPayAction) SacnPay_CreateOrder() {
|
|
} else {
|
|
} else {
|
|
log.Println("生成微信预支付交易单失败", ret)
|
|
log.Println("生成微信预支付交易单失败", ret)
|
|
}
|
|
}
|
|
- } else if pay_way == "支付宝" {
|
|
|
|
|
|
+ } else if pay_way == "ali_pc" {
|
|
now := time.Now()
|
|
now := time.Now()
|
|
payOutTime := now.Add(time.Hour * 2)
|
|
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 {
|
|
if qr_url, tradeno, err := Alipay.GetPayUrl(util.Float64All(order_money), util.FormatDate(&payOutTime, util.Date_Full_Layout)); err == nil {
|
|
@@ -612,9 +607,9 @@ func (p *DataExportPayAction) GetOrderPayMsg() {
|
|
codeUrl := ""
|
|
codeUrl := ""
|
|
now := time.Now()
|
|
now := time.Now()
|
|
prepay_time = util.FormatDate(&now, util.Date_Full_Layout)
|
|
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)
|
|
tradeno, ret := public.WxStruct.CreatePrepayOrder(config.Sysconfig["weixinrpc"].(string), "b", p.IP(), openid, "", orderMoney)
|
|
- if ret != nil {
|
|
|
|
|
|
+ if ret != nil && (*ret)["status"] == "1" {
|
|
if public.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
if public.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
"id": orderid,
|
|
"id": orderid,
|
|
}, map[string]interface{}{
|
|
}, map[string]interface{}{
|
|
@@ -628,10 +623,12 @@ func (p *DataExportPayAction) GetOrderPayMsg() {
|
|
pngdat := r.PNG()
|
|
pngdat := r.PNG()
|
|
codeUrl = base64.StdEncoding.EncodeToString(pngdat)
|
|
codeUrl = base64.StdEncoding.EncodeToString(pngdat)
|
|
} else {
|
|
} else {
|
|
- return "", "创建微信订单出错", false
|
|
|
|
|
|
+ return "", pay_way + "更新数据库出错", false
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ return "", "创建微信订单出错", false
|
|
}
|
|
}
|
|
- } else if pay_way == "支付宝" {
|
|
|
|
|
|
+ } else if pay_way == "ali_pc" {
|
|
payOutTime := now.Add(time.Hour * 2)
|
|
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 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{}{
|
|
if public.Mysql.Update("dataexport_order", map[string]interface{}{
|
|
@@ -643,9 +640,11 @@ func (p *DataExportPayAction) GetOrderPayMsg() {
|
|
"out_trade_no": tradeno,
|
|
"out_trade_no": tradeno,
|
|
"pay_way": pay_way,
|
|
"pay_way": pay_way,
|
|
}) {
|
|
}) {
|
|
- //surplus_second = 7200
|
|
|
|
|
|
+ codeUrl = qr_url
|
|
|
|
+ } else {
|
|
|
|
+ return "", pay_way + "更新数据库出错", false
|
|
}
|
|
}
|
|
- codeUrl = qr_url
|
|
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
return "", "创建支付宝订单出错", false
|
|
return "", "创建支付宝订单出错", false
|
|
}
|
|
}
|
|
@@ -672,10 +671,10 @@ func CloseDataExportOrder(payWay, tradeno, prepayTime string) (status bool) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
log.Printf("%s取消订单,订单号%s\n", payWay, tradeno)
|
|
log.Printf("%s取消订单,订单号%s\n", payWay, tradeno)
|
|
- if payWay == "支付宝" {
|
|
|
|
|
|
+ if payWay == "ali_pc" {
|
|
status = Alipay.CloseOrder(tradeno)
|
|
status = Alipay.CloseOrder(tradeno)
|
|
}
|
|
}
|
|
- if payWay == "微信" {
|
|
|
|
|
|
+ if payWay == "wx_pc" {
|
|
status = public.WxStruct.CloseOrder(config.Sysconfig["weixinrpc"].(string), tradeno)
|
|
status = public.WxStruct.CloseOrder(config.Sysconfig["weixinrpc"].(string), tradeno)
|
|
}
|
|
}
|
|
if !status {
|
|
if !status {
|