Documentation ¶
Index ¶
- Constants
- func CodeInfo[...](code codeT) string
- func StateInfo[...](state codeT) string
- type Client
- func (c *Client) ConfigClient(config *ClientConfig)
- 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) OrderDirectCharge(ctx context.Context, orderNo string, rechargeNumber string, productID int64, ...) (*OrderDirectChargeResult, error)
- 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, price int64, ...) (*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)
- func (c *Client) UserBalanceGet(ctx context.Context, notMustParams ...gorequest.Params) (*UserBalanceGetResult, error)
- type ClientConfig
- type OrderDirectChargeResponse
- type OrderDirectChargeResult
- type OrderGetResponse
- type OrderGetResult
- type OrderTelPayResponse
- type OrderTelPayResult
- type UserBalanceGetResponse
- type UserBalanceGetResult
Constants ¶
const (
CodeSuccess = 7000
)
const (
LogTable = "chengquan"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) ConfigClient ¶ added in v1.0.194
func (c *Client) ConfigClient(config *ClientConfig)
func (*Client) ConfigSLogClientFun ¶
func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)
ConfigSLogClientFun 日志配置
func (*Client) OrderDirectCharge ¶ added in v1.0.197
func (c *Client) OrderDirectCharge(ctx context.Context, orderNo string, rechargeNumber string, productID int64, amount int64, notMustParams ...gorequest.Params) (*OrderDirectChargeResult, error)
OrderDirectCharge 直充下单接口 order_no = 商户提交的订单号,最长32位(商户保证其唯一性) recharge_number = 充值账号 product_id = 充值产品编号 amount = 充值数量(加油卡,视频业务默认为1,其它业务按照实际情况传递)。数量范围1-99999 ip = 充值ip(仅腾讯业务需要,根据实际情况进行传递) oil_phone_account = 加油卡充值时用户的手机号 notify_url = 橙券主动通知订单结果地址 https://chengquan.cn/rechargeInterface/directCharge.html
func (*Client) OrderGet ¶
func (c *Client) OrderGet(ctx context.Context, orderNo string, notMustParams ...gorequest.Params) (*OrderGetResult, error)
OrderGet 订单查询接口 order_no = 商户提交的订单号,最长32位(商户保证其唯一性) https://www.chengquan.cn/rechargeInterface/queryOrder.html
func (*Client) OrderTelPay ¶
func (c *Client) OrderTelPay(ctx context.Context, orderNo string, rechargeNumber string, price int64, notMustParams ...gorequest.Params) (*OrderTelPayResult, error)
OrderTelPay 话费下单接口 order_no = 商户提交的订单号,最长32位(商户保证其唯一性) recharge_number = 充值手机号码 price = 充值面值(单位:分) notify_url = 橙券主动通知订单结果地址 https://www.chengquan.cn/rechargeInterface/tel.html
func (*Client) UserBalanceGet ¶ added in v1.0.197
func (c *Client) UserBalanceGet(ctx context.Context, notMustParams ...gorequest.Params) (*UserBalanceGetResult, error)
UserBalanceGet 账号余额查询接口 https://chengquan.cn/basicData/queryBalance.html
type ClientConfig ¶
ClientConfig 实例配置
type OrderDirectChargeResponse ¶ added in v1.0.197
type OrderDirectChargeResponse 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 OrderDirectChargeResult ¶ added in v1.0.197
type OrderDirectChargeResult struct { Result OrderDirectChargeResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
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 // 请求 }
type UserBalanceGetResponse ¶ added in v1.0.197
type UserBalanceGetResult ¶ added in v1.0.197
type UserBalanceGetResult struct { Result UserBalanceGetResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }