31 lines
593 B
Go
31 lines
593 B
Go
package ebai
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
|
|
"git.rosy.net.cn/baseapi/platformapi/ebaiapi"
|
|
)
|
|
|
|
func TestOnFinancialMsg(t *testing.T) {
|
|
msg := &ebaiapi.CallbackMsg{
|
|
Timestamp: time.Now().Unix(),
|
|
Body: make(map[string]interface{}),
|
|
}
|
|
msg.Body["order_id"] = "1554939646172038357"
|
|
|
|
// 部分退款
|
|
msg.Cmd = "order.partrefund.push"
|
|
msg.Body["status"] = json.Number("20")
|
|
|
|
// 全单退款
|
|
// msg.Cmd = "order.user.cancel"
|
|
// msg.Body["type"] = json.Number("40")
|
|
// msg.Body["cancel_type"] = json.Number("2")
|
|
|
|
res := OnFinancialMsg(msg)
|
|
fmt.Println(res)
|
|
}
|