Documentation ¶
Index ¶
- Constants
- type AddProductOrderResponse
- type AddProductOrderResult
- type Client
- func (c *Client) AddProductOrder(ctx context.Context, Type int64, mobile string, tradeID string, amount int64, ...) (*AddProductOrderResult, error)
- func (c *Client) GetApiURL() string
- func (c *Client) GetKey() string
- func (c *Client) GetMchID() int64
- func (c *Client) QuerySupplierOrderInfo(ctx context.Context, tradeID string, notMustParams ...gorequest.Params) (*QuerySupplierOrderInfoResult, error)
- func (c *Client) SetApiURL(v string) *Client
- func (c *Client) SetClientIP(clientIP string) *Client
- func (c *Client) SetKey(v string) *Client
- func (c *Client) SetLogFun(logFun gorequest.LogFunc)
- func (c *Client) SetMchID(v int64) *Client
- func (c *Client) SetTrace(trace bool)
- func (c *Client) SupplierBalance(ctx context.Context, notMustParams ...gorequest.Params) (*SupplierBalanceResult, error)
- func (c *Client) TraceEndSpan()
- func (c *Client) TraceGetSpanID() (spanID string)
- func (c *Client) TraceGetTraceID() (traceID string)
- func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
- func (c *Client) TraceSetAttributes(kv ...attribute.KeyValue)
- func (c *Client) TraceSetStatus(code codes.Code, description string)
- func (c *Client) TraceStartSpan(ctx context.Context, spanName string) context.Context
- type ClientConfig
- type QuerySupplierOrderInfoResponse
- type QuerySupplierOrderInfoResult
- type SupplierBalanceResponse
- type SupplierBalanceResult
Constants ¶
View Source
const ( CodeSuccess = 1 CodeError = -1 )
View Source
const (
LogTable = "praise_goodness"
)
View Source
const (
Version = "1.0.4"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddProductOrderResponse ¶
type AddProductOrderResult ¶
type AddProductOrderResult struct { Result AddProductOrderResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) AddProductOrder ¶
func (c *Client) AddProductOrder(ctx context.Context, Type int64, mobile string, tradeID string, amount int64, official int64, area string, notifyurl string, notMustParams ...gorequest.Params) (*AddProductOrderResult, error)
AddProductOrder 下单接口 type = 固定值:1 mobile = 充值账号 trade_id = 商户订单号,10-32位 amount = 充值金额,单位 (元) ,只传整 数不带小数点,例如:100 official = 运营商 1 :中国移动 2 :中国联通 3 :中国电信 area = 归属地,填省份,如:山东,北京 ,内蒙古,黑龙江,重庆 填:auto,系统自动识别归属地 notifyurl = 回调通知地址
func (*Client) QuerySupplierOrderInfo ¶
func (c *Client) QuerySupplierOrderInfo(ctx context.Context, tradeID string, notMustParams ...gorequest.Params) (*QuerySupplierOrderInfoResult, error)
QuerySupplierOrderInfo 订单查询接口 trade_id = 商户订单号
func (*Client) SetClientIP ¶ added in v1.0.3
SetClientIP 配置
func (*Client) SupplierBalance ¶
func (c *Client) SupplierBalance(ctx context.Context, notMustParams ...gorequest.Params) (*SupplierBalanceResult, error)
SupplierBalance 用户余额查询接口
func (*Client) TraceEndSpan ¶ added in v1.0.3
func (c *Client) TraceEndSpan()
TraceEndSpan 结束OpenTelemetry链路追踪状态
func (*Client) TraceGetSpanID ¶ added in v1.0.3
TraceGetSpanID 获取OpenTelemetry链路追踪SpanID
func (*Client) TraceGetTraceID ¶ added in v1.0.3
TraceGetTraceID 获取OpenTelemetry链路追踪TraceID
func (*Client) TraceRecordError ¶ added in v1.0.3
func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
TraceRecordError 记录OpenTelemetry链路追踪错误
func (*Client) TraceSetAttributes ¶ added in v1.0.3
TraceSetAttributes 设置OpenTelemetry链路追踪属性
func (*Client) TraceSetStatus ¶ added in v1.0.3
TraceSetStatus 设置OpenTelemetry链路追踪状态
type ClientConfig ¶
ClientConfig 实例配置
type QuerySupplierOrderInfoResponse ¶
type QuerySupplierOrderInfoResponse struct { Code int `json:"code"` // 1:请求成功 -1:请求失败 Msg string `json:"msg"` // 返回说明 Time string `json:"time"` // 时间戳 Data struct { OrderID string `json:"order_id"` // 我方订单号 TradeID string `json:"trade_id"` // 商户订单号 Status int `json:"status"` // 88:充值成功 22:充值失败 66:充值中 55:订单不存在 Voucher string `json:"voucher"` // 充值凭证 (有可能为空值,不一定返回) Createtime int `json:"createtime"` // 订单创建时间 Proof string `json:"proof"` // 请求token } `json:"data"` }
func (QuerySupplierOrderInfoResponse) GetStatusDesc ¶
func (QuerySupplierOrderInfoResponse) GetStatusDesc(status int) string
type QuerySupplierOrderInfoResult ¶
type QuerySupplierOrderInfoResult struct { Result QuerySupplierOrderInfoResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
type SupplierBalanceResponse ¶
type SupplierBalanceResult ¶
type SupplierBalanceResult struct { Result SupplierBalanceResponse // 结果 Body []byte // 内容 Http gorequest.Response // 请求 }
Click to show internal directories.
Click to hide internal directories.