Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) ConfigApp(storeId, appKey int64, appSecret string) *Client
- func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)
- func (c *Client) GetAppKey() int64
- func (c *Client) GetAppSecret() string
- func (c *Client) GetClientIp() string
- func (c *Client) GetStoreId() int64
- func (c *Client) Post(ctx context.Context, _method string, notMustParams ...gorequest.Params) ([]byte, error)
- func (c *Client) PowerCardInfo(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
- func (c *Client) RestOilCardAdd(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
- func (c *Client) RestOilCardDel(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
- func (c *Client) RestOilCardEdit(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
- func (c *Client) RestOilCardInfo(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
- func (c *Client) RestOilOrderPush(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
- func (c *Client) RestOilOrderQuery(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
- func (c *Client) RestPowerAddCard(ctx context.Context, notMustParams ...gorequest.Params) *RestPowerAddCardResult
- func (c *Client) RestPowerCancel(ctx context.Context, orderNumber string) *RestPowerCancelResult
- func (c *Client) RestPowerDelCard(ctx context.Context, cardId string) *RestPowerDelCardResult
- func (c *Client) RestPowerEditCard(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
- func (c *Client) RestPowerPushOrder(ctx context.Context, notMustParams ...gorequest.Params) *RestPowerPushOrderResult
- func (c *Client) RestPowerPushOrderNotifyGin(ctx context.Context, ginCtx *gin.Context) (ResponseRestPowerPushOrderNotifyGin, error)
- func (c *Client) RestPowerQuery(ctx context.Context, orderNumber string) (*RestPowerQueryResult, error)
- func (c *Client) RestRechargeCancel(ctx context.Context, orderNumber string) *RestRechargeCancelResult
- func (c *Client) RestRechargeMobileInfo(ctx context.Context, orderNumber string) *RestRechargeMobileInfoResult
- func (c *Client) RestRechargePushOrder(ctx context.Context, notMustParams ...gorequest.Params) *RestRechargePushOrderResult
- func (c *Client) RestRechargePushOrderNotifyGin(ctx context.Context, ginCtx *gin.Context) (ResponseRestRechargePushOrderNotifyGin, error)
- func (c *Client) RestRechargeQuery(ctx context.Context, orderNumber string) (*RestRechargeQueryResult, error)
- func (c *Client) RestRechargeVerify(ctx context.Context, mobile string, amount int64, rechargeType int) *RestRechargeVerifyResult
- func (c *Client) RestUserQuery(ctx context.Context) *RestUserQueryResult
- type ClientConfig
- type ResponseRestPowerPushOrderNotifyGin
- type ResponseRestRechargePushOrderNotifyGin
- type RestPowerAddCardResponse
- type RestPowerAddCardResult
- type RestPowerCancelResponse
- type RestPowerCancelResult
- type RestPowerDelCardResponse
- type RestPowerDelCardResult
- type RestPowerPushOrderResponse
- type RestPowerPushOrderResult
- type RestPowerQueryResponse
- type RestPowerQueryResult
- type RestRechargeCancelResponse
- type RestRechargeCancelResult
- type RestRechargeMobileInfoResponse
- type RestRechargeMobileInfoResult
- type RestRechargePushOrderResponse
- type RestRechargePushOrderResult
- type RestRechargeQueryResponse
- type RestRechargeQueryResult
- type RestRechargeVerifyResponse
- type RestRechargeVerifyResult
- type RestUserQueryResponse
- type RestUserQueryResult
Constants ¶
const (
CodeSuccess = "0000"
)
const (
LogTable = "wikeyun"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v1.0.47
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func NewClient ¶ added in v1.0.47
func NewClient(config *ClientConfig) (*Client, error)
NewClient 创建实例化
func (*Client) ConfigSLogClientFun ¶ added in v1.0.162
func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)
ConfigSLogClientFun 日志配置
func (*Client) GetAppSecret ¶ added in v1.0.52
func (*Client) GetClientIp ¶ added in v1.0.52
func (*Client) GetStoreId ¶ added in v1.0.52
func (*Client) PowerCardInfo ¶ added in v1.0.47
func (c *Client) PowerCardInfo(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
PowerCardInfo 电费充值卡详情 https://open.wikeyun.cn/#/apiDocument/9/document/333
func (*Client) RestOilCardAdd ¶ added in v1.0.47
func (c *Client) RestOilCardAdd(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
RestOilCardAdd 添加充值卡
func (*Client) RestOilCardDel ¶ added in v1.0.47
func (c *Client) RestOilCardDel(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
RestOilCardDel 油卡删除
func (*Client) RestOilCardEdit ¶ added in v1.0.47
func (c *Client) RestOilCardEdit(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
RestOilCardEdit 编辑充值卡
func (*Client) RestOilCardInfo ¶ added in v1.0.47
func (c *Client) RestOilCardInfo(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
RestOilCardInfo 油卡详情
func (*Client) RestOilOrderPush ¶ added in v1.0.47
func (c *Client) RestOilOrderPush(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
RestOilOrderPush 充值下单
func (*Client) RestOilOrderQuery ¶ added in v1.0.47
func (c *Client) RestOilOrderQuery(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
RestOilOrderQuery 订单查询
func (*Client) RestPowerAddCard ¶ added in v1.0.47
func (c *Client) RestPowerAddCard(ctx context.Context, notMustParams ...gorequest.Params) *RestPowerAddCardResult
RestPowerAddCard 添加电费充值卡 https://open.wikeyun.cn/#/apiDocument/9/document/326
func (*Client) RestPowerCancel ¶ added in v1.0.47
func (c *Client) RestPowerCancel(ctx context.Context, orderNumber string) *RestPowerCancelResult
RestPowerCancel 电费订单取消 https://open.wikeyun.cn/#/apiDocument/9/document/323
func (*Client) RestPowerDelCard ¶ added in v1.0.47
func (c *Client) RestPowerDelCard(ctx context.Context, cardId string) *RestPowerDelCardResult
RestPowerDelCard 删除电费充值卡 https://open.wikeyun.cn/#/apiDocument/9/document/330
func (*Client) RestPowerEditCard ¶ added in v1.0.47
func (c *Client) RestPowerEditCard(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)
RestPowerEditCard 编辑电费充值卡 https://open.wikeyun.cn/#/apiDocument/9/document/329
func (*Client) RestPowerPushOrder ¶ added in v1.0.47
func (c *Client) RestPowerPushOrder(ctx context.Context, notMustParams ...gorequest.Params) *RestPowerPushOrderResult
RestPowerPushOrder 电费充值API https://open.wikeyun.cn/#/apiDocument/9/document/311
func (*Client) RestPowerPushOrderNotifyGin ¶ added in v1.0.52
func (c *Client) RestPowerPushOrderNotifyGin(ctx context.Context, ginCtx *gin.Context) (ResponseRestPowerPushOrderNotifyGin, error)
RestPowerPushOrderNotifyGin 电费充值API - 回调通知 https://open.wikeyun.cn/#/document/1/article/303
func (*Client) RestPowerQuery ¶ added in v1.0.47
func (c *Client) RestPowerQuery(ctx context.Context, orderNumber string) (*RestPowerQueryResult, error)
RestPowerQuery 电费订单查询 https://open.wikeyun.cn/#/apiDocument/9/document/313
func (*Client) RestRechargeCancel ¶ added in v1.0.47
func (c *Client) RestRechargeCancel(ctx context.Context, orderNumber string) *RestRechargeCancelResult
RestRechargeCancel 话费订单取消 https://open.wikeyun.cn/#/apiDocument/9/document/300
func (*Client) RestRechargeMobileInfo ¶ added in v1.0.47
func (c *Client) RestRechargeMobileInfo(ctx context.Context, orderNumber string) *RestRechargeMobileInfoResult
RestRechargeMobileInfo 查询手机归属地信息以及是否携号转网 https://open.wikeyun.cn/#/apiDocument/9/document/374
func (*Client) RestRechargePushOrder ¶ added in v1.0.47
func (c *Client) RestRechargePushOrder(ctx context.Context, notMustParams ...gorequest.Params) *RestRechargePushOrderResult
RestRechargePushOrder 话费充值推送 https://open.wikeyun.cn/#/apiDocument/9/document/298
func (*Client) RestRechargePushOrderNotifyGin ¶ added in v1.0.52
func (c *Client) RestRechargePushOrderNotifyGin(ctx context.Context, ginCtx *gin.Context) (ResponseRestRechargePushOrderNotifyGin, error)
RestRechargePushOrderNotifyGin 话费充值推送 - 回调通知 https://open.wikeyun.cn/#/document/1/article/302
func (*Client) RestRechargeQuery ¶ added in v1.0.47
func (c *Client) RestRechargeQuery(ctx context.Context, orderNumber string) (*RestRechargeQueryResult, error)
RestRechargeQuery 话费订单查询 https://open.wikeyun.cn/#/apiDocument/9/document/299
func (*Client) RestRechargeVerify ¶ added in v1.0.51
func (c *Client) RestRechargeVerify(ctx context.Context, mobile string, amount int64, rechargeType int) *RestRechargeVerifyResult
RestRechargeVerify 话费充值验证 https://open.wikeyun.cn/#/apiDocument/9/document/405
func (*Client) RestUserQuery ¶ added in v1.0.47
func (c *Client) RestUserQuery(ctx context.Context) *RestUserQueryResult
RestUserQuery 用户信息 https://open.wikeyun.cn/#/apiDocument/10/document/336
type ClientConfig ¶ added in v1.0.52
type ClientConfig struct { StoreId int64 // 店铺ID AppKey int64 // key AppSecret string // secret CurrentIp string // 当前ip }
ClientConfig 实例配置
type ResponseRestPowerPushOrderNotifyGin ¶ added in v1.0.52
type ResponseRestPowerPushOrderNotifyGin struct { Status int `form:"status" json:"status" xml:"status" uri:"status" binding:"omitempty"` // 状态 订单状态 0 待支付 1 已付 充值中 2充值成功 3充值失败 需要退款 4退款成功 5已超时 6待充值 7 已匹配 8 已存单 9 已取消 10返销 11部分到账 ArrivedAmount string `form:"arrived_amount" json:"arrived_amount" xml:"arrived_amount" uri:"arrived_amount" binding:"required"` // 到账金额 OrderNo string `form:"order_no" json:"order_no" xml:"order_no" uri:"order_no" binding:"required"` // 第三方单号 OrderNumber string `form:"order_number" json:"order_number" xml:"order_number" uri:"order_number" binding:"required"` // 微客云平台单号 Amount string `form:"amount" json:"amount" xml:"amount" uri:"amount" binding:"required"` // 充值金额,如50,100,200可选 Fanli float64 `form:"fanli" json:"fanli" xml:"fanli" uri:"fanli" binding:"required"` // 返利金额 CostPrice float64 `form:"cost_price" json:"cost_price" xml:"cost_price" uri:"cost_price" binding:"required"` // 成本价格 Sign string `form:"sign" json:"sign" xml:"sign" uri:"sign" binding:"omitempty"` // 加密内容 FailReason string `form:"failReason" json:"failReason" xml:"failReason" uri:"failReason" binding:"omitempty"` // 失败原因,有些渠道没有返回,不是很准确,但电费失败大部分原因都是户号不对或者地区不对或者缴费金额小于欠费金额 }
type ResponseRestRechargePushOrderNotifyGin ¶ added in v1.0.52
type ResponseRestRechargePushOrderNotifyGin struct { Status int `form:"status" json:"status" xml:"status" uri:"status" binding:"omitempty"` // 状态 订单状态 0 待支付 1 已付 充值中 2充值成功 3充值失败 需要退款 4退款成功 5已超时 6待充值 7 已匹配 8 已存单 9 已取消 10返销 11部分到账 Mobile string `form:"mobile" json:"mobile" xml:"mobile" uri:"mobile" binding:"required"` // 充值手机号 OrderNo string `form:"order_no" json:"order_no" xml:"order_no" uri:"order_no" binding:"required"` // 第三方单号 OrderNumber string `form:"order_number" json:"order_number" xml:"order_number" uri:"order_number" binding:"required"` // 微客云平台单号 Amount string `form:"amount" json:"amount" xml:"amount" uri:"amount" binding:"required"` // 充值金额,如50,100,200可选 Fanli float64 `form:"fanli" json:"fanli" xml:"fanli" uri:"fanli" binding:"required"` // 返利金额 CostPrice float64 `form:"cost_price" json:"cost_price" xml:"cost_price" uri:"cost_price" binding:"required"` // 成本价格 Sign string `form:"sign" json:"sign" xml:"sign" uri:"sign" binding:"omitempty"` // 加密内容 }
type RestPowerAddCardResponse ¶ added in v1.0.44
type RestPowerAddCardResponse struct { Code string `json:"code"` Msg string `json:"msg"` Time string `json:"time"` Data struct { CardNum string `json:"card_num"` StoreId string `json:"store_id"` CreateTime int `json:"create_time"` Type int `json:"type"` // 缴费单位 CmsUid int `json:"cms_uid"` Province string `json:"province"` // 缴费省份 City string `json:"city"` // 缴费城市 Id string `json:"id"` // 缴费卡编号 } `json:"data"` }
type RestPowerAddCardResult ¶ added in v1.0.44
type RestPowerAddCardResult struct { Result RestPowerAddCardResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
type RestPowerCancelResponse ¶ added in v1.0.47
type RestPowerCancelResult ¶ added in v1.0.47
type RestPowerCancelResult struct { Result RestPowerCancelResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
type RestPowerDelCardResponse ¶ added in v1.0.47
type RestPowerDelCardResult ¶ added in v1.0.47
type RestPowerDelCardResult struct { Result RestPowerDelCardResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
type RestPowerPushOrderResponse ¶ added in v1.0.44
type RestPowerPushOrderResult ¶ added in v1.0.44
type RestPowerPushOrderResult struct { Result RestPowerPushOrderResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
type RestPowerQueryResponse ¶ added in v1.0.44
type RestPowerQueryResponse struct { Code string `json:"code"` Msg string `json:"msg"` Time string `json:"time"` Data struct { Id uint `json:"id,omitempty"` Fanli string `json:"fanli"` // 平台返利金额 Amount int64 `json:"amount"` // 充值金额 CostPrice string `json:"cost_price"` // 成本价格 Status int `json:"status"` // 订单状态 0 待支付 1 已付 充值中 2充值成功 3充值失败 需要退款 4退款成功 5已超时 6待充值 7 已匹配 8已存单 9 已取消 10返销 11部分到账 12取消中 OrderNumber string `json:"order_number"` // 平台单号 OrderNo string `json:"order_no"` // 第三方单号 OrgOrderNumber string `json:"org_order_number"` // 组织订单号 CardId string `json:"card_id"` // 充值卡ID ArrivedAmount int64 `json:"arrived_amount"` // 到账金额 Reason string `json:"reason,omitempty"` // 失败原因 } `json:"data"` }
func (RestPowerQueryResponse) GetStatusDesc ¶ added in v1.0.85
func (resp RestPowerQueryResponse) GetStatusDesc(status int) string
type RestPowerQueryResult ¶ added in v1.0.44
type RestPowerQueryResult struct { Result RestPowerQueryResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type RestRechargeCancelResponse ¶ added in v1.0.47
type RestRechargeCancelResult ¶ added in v1.0.47
type RestRechargeCancelResult struct { Result RestRechargeCancelResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
type RestRechargeMobileInfoResponse ¶ added in v1.0.47
type RestRechargeMobileInfoResponse struct { Code string `json:"code"` Msg string `json:"msg"` Time string `json:"time"` Data struct { Status string `json:"status"` Oisp string `json:"oisp"` Nisp string `json:"nisp"` Number string `json:"number"` Extend struct { AreaNum string `json:"area_num"` Isp string `json:"isp"` Prov string `json:"prov"` City string `json:"city"` PostCode string `json:"post_code"` AreaCode string `json:"area_code"` CardProvCode string `json:"card_prov_code"` CardCityCode string `json:"card_city_code"` Lng string `json:"lng"` Lat string `json:"lat"` CityCode string `json:"city_code"` CityShortCode string `json:"city_short_code"` } `json:"extend"` } `json:"data"` }
type RestRechargeMobileInfoResult ¶ added in v1.0.47
type RestRechargeMobileInfoResult struct { Result RestRechargeMobileInfoResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
type RestRechargePushOrderResponse ¶ added in v1.0.44
type RestRechargePushOrderResult ¶ added in v1.0.44
type RestRechargePushOrderResult struct { Result RestRechargePushOrderResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
type RestRechargeQueryResponse ¶ added in v1.0.44
type RestRechargeQueryResponse struct { Code string `json:"code"` Data struct { Id int `json:"id,omitempty"` Fanli string `json:"fanli"` // 平台返利金额 Amount int64 `json:"amount"` // 充值金额 CostPrice string `json:"cost_price"` // 充值成本价格 Status int `json:"status"` // 订单状态 0 待支付 1 已付 充值中 2充值成功 3充值失败 需要退款 4退款成功 5已超时 6待充值 7 已匹配 8已存单 9 已取消 10返销 11部分到账 12取消中 OrderNumber string `json:"order_number"` // 平台订单号 OrderNo string `json:"order_no"` // 第三方单号 OrgOrderNumber string `json:"org_order_number"` // 组织订单号 StoreId int `json:"store_id"` // 店铺ID Mobile string `json:"mobile"` // 充值手机号 ArrivedAmount string `json:"arrived_amount"` // 到账金额 Reason string `json:"reason,omitempty"` // 失败原因 } `json:"data"` Msg string `json:"msg"` Time string `json:"time"` }
func (RestRechargeQueryResponse) GetStatusDesc ¶ added in v1.0.85
func (resp RestRechargeQueryResponse) GetStatusDesc(status int) string
type RestRechargeQueryResult ¶ added in v1.0.44
type RestRechargeQueryResult struct { Result RestRechargeQueryResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type RestRechargeVerifyResponse ¶ added in v1.0.51
type RestRechargeVerifyResult ¶ added in v1.0.51
type RestRechargeVerifyResult struct { Result RestRechargeVerifyResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
type RestUserQueryResponse ¶ added in v1.0.44
type RestUserQueryResult ¶ added in v1.0.44
type RestUserQueryResult struct { Result RestUserQueryResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 Err error // 错误 }
Source Files ¶
- api.go
- client.go
- config.go
- const.go
- get.go
- request.go
- rest.oil.add_card.go
- rest.oil.card_info.go
- rest.oil.del_card.go
- rest.oil.push_order.go
- rest.oil.query.go
- rest.oiledit_card.go
- rest.power.add_card.go
- rest.power.cancel.go
- rest.power.card_info.go
- rest.power.del_card.go
- rest.power.edit_card.go
- rest.power.push_order.go
- rest.power.push_order.notify.gin.go
- rest.power.query.go
- rest.recharge.cancel.go
- rest.recharge.mobileInfo.go
- rest.recharge.push_order.go
- rest.recharge.push_order.notify.gin.go
- rest.recharge.query.go
- rest.recharge.verify.go
- rest.user.query.go
- sign.go