Documentation ¶
Index ¶
- Constants
- func CodeInfo[...](code codeT) string
- func StateInfo[...](state codeT) string
- type Client
- func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)
- func (c *Client) DefaultHttp()
- func (c *Client) GetAesIv() string
- func (c *Client) GetAesKey() string
- func (c *Client) GetAppID() string
- func (c *Client) GetAppKey() string
- func (c *Client) OrderGet(ctx context.Context, orderNo string, notMustParams ...gorequest.Params) (*OrderGetResult, error)
- func (c *Client) OrderTelPay(ctx context.Context, orderNo string, rechargeNumber string, ...) (*OrderTelPayResult, error)
- func (c *Client) SetAesIv(aesIv string)
- func (c *Client) SetAesKey(aesKey string)
- func (c *Client) SetApiURL(apiURL string)
- func (c *Client) SetAppID(appID string)
- func (c *Client) SetAppKey(appKey string)
- func (c *Client) SetHttp(app *gorequest.App)
- type ClientConfig
- type OrderGetResponse
- type OrderGetResult
- type OrderTelPayResponse
- type OrderTelPayResult
Constants ¶
View Source
const ( ApiUrl = "https://api.chengquan.cn" ApiTestUrl = "http://test.api.chengquan.vip:11140" )
View Source
const (
CodeSuccess = 7000
)
View Source
const (
LogTable = "chengquan"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) ConfigSLogClientFun ¶
func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)
ConfigSLogClientFun 日志配置
func (*Client) OrderGet ¶
func (c *Client) OrderGet(ctx context.Context, orderNo string, notMustParams ...gorequest.Params) (*OrderGetResult, error)
OrderGet 订单查询接口 https://www.chengquan.cn/rechargeInterface/queryOrder.html
func (*Client) OrderTelPay ¶
func (c *Client) OrderTelPay(ctx context.Context, orderNo string, rechargeNumber string, notMustParams ...gorequest.Params) (*OrderTelPayResult, error)
OrderTelPay 话费下单接口 https://www.chengquan.cn/rechargeInterface/tel.html
type ClientConfig ¶
ClientConfig 实例配置
type OrderGetResponse ¶
type OrderGetResponse struct { Code int `json:"code"` // 错误代码 Message string `json:"message"` // 错误信息 Data struct { AppID string `json:"app_id"` // 商户账号 OrderNo string `json:"order_no"` // 商户订单号 RechargeNumber string `json:"recharge_number"` // 充值账号 StartTime string `json:"start_time"` // 订单创建时间 EndTime string `json:"end_time"` // 订单完成时间,如果订单为充值中该时间和创建时间相同,如果成功或者失败该时间为订单完成时间。 State string `json:"state"` // 订单状态 ConsumeAmount float64 `json:"consume_amount"` // 扣款金额(单位:元),保留小数点后四位 } `json:"data"` }
type OrderGetResult ¶
type OrderGetResult struct { Result OrderGetResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type OrderTelPayResponse ¶
type OrderTelPayResponse struct { Code int `json:"code"` // 错误代码 Message string `json:"message"` // 错误信息 Data struct { AppID string `json:"app_id"` // 商户账号 OrderNo string `json:"order_no"` // 商户订单号 RechargeNumber string `json:"recharge_number"` // 充值账号 StartTime string `json:"start_time"` // 订单创建时间 EndTime string `json:"end_time"` // 订单完成时间,如果订单为充值中该时间和创建时间相同,如果成功或者失败该时间为订单完成时间。 State string `json:"state"` // 订单状态 ConsumeAmount float64 `json:"consume_amount"` // 扣款金额(单位:元),保留小数点后四位 } `json:"data"` }
type OrderTelPayResult ¶
type OrderTelPayResult struct { Result OrderTelPayResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
Click to show internal directories.
Click to hide internal directories.