1
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
package localjx
|
package localjx
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
@@ -13,7 +15,10 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGenOrderNo(t *testing.T) {
|
func TestGenOrderNo(t *testing.T) {
|
||||||
|
loc, _ := time.LoadLocation("Local")
|
||||||
|
|
||||||
|
t1, _ := time.ParseInLocation("20060102150405", time.Unix(1654510539,0).Format("20060102150405"), loc)
|
||||||
|
fmt.Println("t1",t1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetAvailableDeliverTime(t *testing.T) {
|
func TestGetAvailableDeliverTime(t *testing.T) {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"git.rosy.net.cn/baseapi/platformapi/tiktok"
|
"git.rosy.net.cn/baseapi/platformapi/tiktok"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/wxpayapi"
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
@@ -70,7 +69,9 @@ func onTTPayFinished(msg *tiktok.DetailCallBackMessage) (err error) {
|
|||||||
orderPay.DeletedAt = utils.DefaultTimeValue
|
orderPay.DeletedAt = utils.DefaultTimeValue
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
if err = dao.GetEntity(db, orderPay, "PayOrderID", "PayType", "DeletedAt"); err == nil {
|
if err = dao.GetEntity(db, orderPay, "PayOrderID", "PayType", "DeletedAt"); err == nil {
|
||||||
orderPay.PayFinishedAt = utils.Time2Pointer(wxpayapi.PayTime2Time(utils.Int64ToStr(msg.PaidAt)))
|
loc, _ := time.LoadLocation("Local")
|
||||||
|
t1, _ := time.ParseInLocation("20060102150405", time.Unix(msg.PaidAt,0).Format("20060102150405"), loc)
|
||||||
|
orderPay.PayFinishedAt = utils.Time2Pointer(t1)
|
||||||
orderPay.TransactionID = msg.ChannelNo
|
orderPay.TransactionID = msg.ChannelNo
|
||||||
orderPay.OriginalData = utils.Format4Output(msg, true)
|
orderPay.OriginalData = utils.Format4Output(msg, true)
|
||||||
if msg.Status == tiktok.ResponseCodeSuccess {
|
if msg.Status == tiktok.ResponseCodeSuccess {
|
||||||
@@ -110,7 +111,7 @@ func onTTPayRefund(msg *tiktok.DetailCallBackMessage2Refund) (err error) {
|
|||||||
orderPay := &model.OrderPay{
|
orderPay := &model.OrderPay{
|
||||||
VendorOrderID: orderPayRefund.VendorOrderID,
|
VendorOrderID: orderPayRefund.VendorOrderID,
|
||||||
VendorID: jxutils.GetPossibleVendorIDFromVendorOrderID(orderPayRefund.VendorOrderID),
|
VendorID: jxutils.GetPossibleVendorIDFromVendorOrderID(orderPayRefund.VendorOrderID),
|
||||||
PayType: model.PayTypeWX,
|
PayType: model.PayTypeTicTok,
|
||||||
Status: model.PayStatusYes,
|
Status: model.PayStatusYes,
|
||||||
}
|
}
|
||||||
orderPay.DeletedAt = utils.DefaultTimeValue
|
orderPay.DeletedAt = utils.DefaultTimeValue
|
||||||
|
|||||||
Reference in New Issue
Block a user