更新小费
This commit is contained in:
@@ -2,6 +2,7 @@ package mtpsapi
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/platformapi"
|
"git.rosy.net.cn/baseapi/platformapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
@@ -10,6 +11,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -487,6 +489,23 @@ func (a *API) CheckOrder(shopID, receiver_address string, receiver_lng, receiver
|
|||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加小费
|
||||||
|
func (a *API) AddTip(orderId, deliveryId string, tip int64) error {
|
||||||
|
result, err := a.AccessAPI("order/addTip", map[string]interface{}{
|
||||||
|
"delivery_id": orderId,
|
||||||
|
"mt_peisong_id": deliveryId,
|
||||||
|
"tip_amount": tip,
|
||||||
|
"serial_number": utils.Int64ToStr(time.Now().Unix()),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if result.Code != 0 {
|
||||||
|
return errors.New(result.Message)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func IsOpen(err error) bool {
|
func IsOpen(err error) bool {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user