This commit is contained in:
邹宗楠
2022-06-06 15:54:37 +08:00
parent 0de07e5972
commit 50f2a5fcff
3 changed files with 16 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
package tiktok
import (
"encoding/json"
"fmt"
"git.rosy.net.cn/baseapi"
"go.uber.org/zap"
@@ -56,3 +57,16 @@ func TestFMT(t *testing.T) {
fmt.Println(3&2 != 0)
fmt.Println(3&1 != 0)
}
func TestJieXi(t *testing.T) {
aa := "{\"msg\":\"{\\\"appid\\\":\\\"tta6a1d01c399f264201\\\",\\\"cp_orderno\\\":\\\"88392225672205\\\",\\\"cp_extra\\\":\\\"msg\\\",\\\"way\\\":\\\"1\\\",\\\"channel_no\\\":\\\"4307101087202206060852144781\\\",\\\"channel_gateway_no\\\":\\\"\\\",\\\"payment_order_no\\\":\\\"PCP2022060615343025356252572215\\\",\\\"out_channel_order_no\\\":\\\"4307101087202206060852144781\\\",\\\"total_amount\\\":2,\\\"status\\\":\\\"SUCCESS\\\",\\\"seller_uid\\\":\\\"70915459488196877170\\\",\\\"extra\\\":\\\"\\\",\\\"item_id\\\":\\\"\\\",\\\"paid_at\\\":1654500885,\\\"message\\\":\\\"\\\",\\\"order_id\\\":\\\"7106026546158143752\\\",\\\"trade_item_list\\\":null}\",\"msg_signature\":\"85d4b28842be7294f8440363735476f225fce095\",\"nonce\":\"1670\",\"timestamp\":\"1654500886\",\"type\":\"payment\"}"
payInfo := &CallBackResult{}
err := json.Unmarshal([]byte(aa), payInfo)
fmt.Println("err==========", err)
fmt.Println("payInfo===", payInfo.Msg)
callback := &DetailCallBackMessage{}
err2 := json.Unmarshal([]byte(payInfo.Msg), callback)
fmt.Println("err==========", err2)
fmt.Println("payInfo===", callback.PaymentOrderNo)
}