This commit is contained in:
邹宗楠
2026-03-25 09:13:07 +08:00
parent 93bd28290d
commit c740630ce6
31 changed files with 2077 additions and 556 deletions

View File

@@ -1,6 +1,10 @@
package weixinapi
import "testing"
import (
"fmt"
"testing"
"time"
)
func TestSNSRetrieveToken(t *testing.T) {
result, err := api.SNSRetrieveToken("021UGn0006ICgQ13UC1005f2kD4UGn0r")
@@ -37,3 +41,51 @@ func TestSNSGetUserInfo(t *testing.T) {
}
sugarLogger.Debug(result)
}
func TestSNSSendGoodsOrder(t *testing.T) {
param := &SNSSendOrderParameter{
OrderKey: struct {
OrderNumberType int `json:"order_number_type"`
TransactionId string `json:"transaction_id"`
Mchid string `json:"mchid"`
OutTradeNo string `json:"out_trade_no"`
}{
OrderNumberType: 2,
TransactionId: "4200003055202603242074503838",
},
LogisticsType: 1,
DeliveryMode: 1,
IsAllDelivered: false,
ShippingList: append([]ShippingList{}, ShippingList{
TrackingNo: "88512032279168",
ExpressCompany: "YD",
ItemDesc: "背心袋测试",
Contact: struct {
ConsignorContact string `json:"consignor_contact"`
ReceiverContact string `json:"receiver_contact"`
}{},
}),
UploadTime: time.Now().Format(time.RFC3339),
Payer: struct {
Openid string `json:"openid"`
}{
Openid: "ojWb10P-E520p3WZSClXclSBR_20",
},
}
api.SNSSendGoodsOrder(param)
}
func TestSNSDeliveryGoodsOrder(t *testing.T) {
api.SNSDeliveryGoodsOrder(&DeliveryOrder{
TransactionId: "4200003007202603198574473654",
MerchantId: "",
MerchantTradeNo: "",
SubMerchantId: "",
ReceivedTime: time.Now().Unix(),
})
}
func TestName(t *testing.T) {
fmt.Println(411 / 50)
}