1
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package ebaiapi
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"testing"
|
||||
@@ -24,30 +23,45 @@ func TestOrderGet(t *testing.T) {
|
||||
|
||||
func TestOrderAgreePartRefund(t *testing.T) {
|
||||
param := &RefundOrderExamine{
|
||||
ReverseOrderId: "2308258682813174525",
|
||||
OrderId: "4045250124015619672",
|
||||
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
|
||||
ActionType: RefundTypeAgree,
|
||||
ReasonCode: "",
|
||||
ReasonRemarks: "同意了",
|
||||
RefundProductList: "",
|
||||
ReverseOrderId: "2308279044977730245",
|
||||
OrderId: "4002450124418844395",
|
||||
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
|
||||
ActionType: RefundTypeAgree,
|
||||
ReasonCode: "",
|
||||
ReasonRemarks: "",
|
||||
}
|
||||
refundProductList := make([]*RefundProductList, 0, 0)
|
||||
date, _ := api.GetReverseOrder("4045250124015619672")
|
||||
date, _ := api.GetReverseOrder("4002450124418844395")
|
||||
for _, v := range date {
|
||||
v2 := v.(map[string]interface{})
|
||||
refundProduct := &RefundProductList{
|
||||
SubBizOrderId: v.(map[string]interface{})["sub_biz_order_id"].(string),
|
||||
PlatformSkuId: utils.Int64ToStr(utils.Interface2Int64WithDefault(v.(map[string]interface{})["platform_sku_id"], 0)),
|
||||
SubBizOrderId: v2["sub_biz_order_id"].(string),
|
||||
PlatformSkuId: utils.Int64ToStr(utils.Interface2Int64WithDefault(v2["platform_sku_id"], 0)),
|
||||
}
|
||||
switch utils.MustInterface2Int64(v2["fund_calculate_type"]) {
|
||||
case 0:
|
||||
refundProduct.Number = utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_quantity"]))
|
||||
case 1:
|
||||
refundProduct.RefundAmount = utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_user_amount"]))
|
||||
}
|
||||
|
||||
refundProductList = append(refundProductList, refundProduct)
|
||||
}
|
||||
refundProductListStr, _ := json.Marshal(refundProductList)
|
||||
param.RefundProductList = string(refundProductListStr)
|
||||
param.RefundProductList = refundProductList
|
||||
err := api.EbaiRefundOrder(param)
|
||||
globals.SugarLogger.Debugf("err := %s", utils.Format4Output(err, false))
|
||||
}
|
||||
|
||||
func TestOrderAgreeRefund(t *testing.T) {
|
||||
err := api.OrderAgreeRefund(&RefundOrderExamine{
|
||||
ReverseOrderId: "2308279044977730245",
|
||||
OrderId: "4002450124418844395",
|
||||
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
|
||||
ActionType: "1",
|
||||
ReasonRemarks: "",
|
||||
})
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
func TestGetReverseOrder(t *testing.T) {
|
||||
date, _ := api.GetReverseOrder("4099660048407490187")
|
||||
for _, v := range date {
|
||||
|
||||
Reference in New Issue
Block a user