You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-library/service/wikeyun/recharge.push_order.go

44 lines
1.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package wikeyun
import (
"encoding/json"
"errors"
)
// RechargePpushOrderRequest 请求参数
type RechargePpushOrderRequest struct {
StoreId string `json:"store_id"` // 铺ID
Mobile string `json:"mobile"` // 充值号码
OrderNo string `json:"order_no"` // 充值订单号
Money int `json:"money"` // 充值金额100200
RechargeTyp int `json:"recharge_typ"` // 是 1快充 0慢充
NotifyUrl string `json:"notify_url"` // 异步回调地址POST
Change int `json:"change,omitempty"` // 失败更换渠道充值 0 否 1是
Source int `json:"source,omitempty"` // 是否强制渠道 传source字段则可以强制某渠道强制快充走94折则source传6
}
// RechargePpushOrderResponse 返回参数
type RechargePpushOrderResponse struct {
Code string `json:"code"`
Msg string `json:"msg"`
Data struct {
OrderNumber string `json:"order_number"`
} `json:"data"`
}
// RechargePushOrder 充值请求业务参数
func (app *App) RechargePushOrder(notMustParams ...Params) (result RechargePpushOrderResponse, err error) {
// 参数
params := app.NewParamsWith(notMustParams...)
// 请求
body, err := app.request("https://router.wikeyun.cn/rest/Recharge/pushOrder", params)
if err != nil {
return result, errors.New(err.Error())
}
err = json.Unmarshal(body, &result)
if err != nil {
return result, errors.New(err.Error())
}
return result, nil
}