1
This commit is contained in:
47
platformapi/tiktok/tiktok_pay_model.go
Normal file
47
platformapi/tiktok/tiktok_pay_model.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package tiktok
|
||||
|
||||
const (
|
||||
PayUrl = "https://developer.toutiao.com/api/apps/ecpay/v1/create_order"
|
||||
)
|
||||
|
||||
// 预下单
|
||||
type TickTokCreateOrder struct {
|
||||
AppID string `json:"app_id"` // 小程序APPID
|
||||
OutOrderNo string `json:"out_order_no"` // 开发者侧的订单号
|
||||
TotalAmount int `json:"total_amount"` // 支付价格。
|
||||
Subject string `json:"subject"` // 商品描述。
|
||||
Body string `json:"body"` // 商品详情
|
||||
ValidTime int `json:"valid_time"` // 订单过期时间(秒)。
|
||||
Sign string `json:"sign"` // 签名,详见请求加签算法
|
||||
CpExtra string `json:"cp_extra"` // 开发者自定义字段,回调原样回传
|
||||
NotifyURL string `json:"notify_url"` // 商户自定义回调地址
|
||||
}
|
||||
|
||||
// 预发单返回值
|
||||
type PreOrderResult struct {
|
||||
ErrNo int64 `json:"err_no"` // 错误码
|
||||
ErrTips string `json:"err_tips"` // 错误信息
|
||||
Data *struct {
|
||||
OrderId string `json:"order_id"` // 抖音侧唯一订单号
|
||||
OrderToken string `json:"order_token"` //签名后的订单信息
|
||||
}
|
||||
}
|
||||
|
||||
type AccessToken struct {
|
||||
AccessToken string `json:"access_token"` //token
|
||||
ExpiresIn int64 `json:"expires_in"` // 过期时间
|
||||
ErrNo int64 `json:"err_no"` // 错误码
|
||||
ErrTips string `json:"err_tips"` // 错误信息
|
||||
}
|
||||
|
||||
// 退款
|
||||
type ReturnMoneyReq struct {
|
||||
AppID string `json:"app_id"` // 小程序APPID
|
||||
OutOrderNo string `json:"out_order_no"` //商户分配支付单号,标识进行退款的订单
|
||||
OutRefundNo string `json:"out_refund_no"` // 商户分配退款号,保证在商户中唯一
|
||||
Reason string `json:"reason"` // 退款原因
|
||||
RefundAmount int `json:"refund_amount"`
|
||||
Sign string `json:"sign"`
|
||||
CpExtra string `json:"cp_extra"`
|
||||
NotifyURL string `json:"notify_url"`
|
||||
}
|
||||
Reference in New Issue
Block a user