优化卡商网服务

master
李光春 3 years ago
parent 199fca58e3
commit c0311aae8e

@ -1,6 +1,7 @@
## v2.0.1 / 2021-07-21
## v2.0.2 / 2021-07-21
- 增加卡商网服务
- 优化卡商网服务
## v2.0.0 / 2021-07-20

@ -18,8 +18,8 @@ const api = "http://www.kashangwl.com/api/"
// KaShangWl 每次请求需传入以下参数
type KaShangWl struct {
customerId int // 商家编号
customerKey string // 商家密钥
CustomerId int // 商家编号
CustomerKey string // 商家密钥
}
// Send 发送 http://cha.kashangwl.com/api-doc/
@ -29,9 +29,9 @@ func (w *KaShangWl) Send(msg interface{}, url string) (*simplejson.Json, error)
// 处理数据
marshal, _ := json.Marshal(msg)
newJson, _ := simplejson.NewJson(marshal)
newJson.Set("customer_id", w.customerId)
newJson.Set("customer_id", w.CustomerId)
newJson.Set("timestamp", timestamp)
signStr := sign(newJson, w.customerKey)
signStr := sign(newJson, w.CustomerKey)
newJson.Set("sign", signStr)
j, e := newJson.MarshalJSON()
if e != nil {

@ -9,8 +9,8 @@ import (
func TestName(t *testing.T) {
wl := KaShangWl{
customerId: 0000000,
customerKey: "xxx",
CustomerId: 0000000,
CustomerKey: "xxx",
}
msg := message.Order{
OrderId: 827669582783,

@ -1,5 +1,5 @@
package library
func Version() string {
return "2.0.1"
return "2.0.2"
}

Loading…
Cancel
Save