更新小费
This commit is contained in:
@@ -2,6 +2,7 @@ package mtpsapi
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
@@ -10,6 +11,7 @@ import (
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -487,6 +489,23 @@ func (a *API) CheckOrder(shopID, receiver_address string, receiver_lng, receiver
|
||||
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 {
|
||||
if err == nil {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user