praise_goodness

package
v1.0.215 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess = 1
	CodeError   = -1
)
View Source
const (
	LogTable = "praise_goodness"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddProductOrderResponse

type AddProductOrderResponse struct {
	Code int      `json:"code"` // 1:请求成功 -1:请求失败
	Msg  string   `json:"msg"`  // 返回说明
	Time string   `json:"time"` // 时间戳
	Data struct{} `json:"data"`
}

type AddProductOrderResult added in v1.0.197

type AddProductOrderResult struct {
	Result AddProductOrderResponse // 结果
	Body   []byte                  // 内容
	Http   gorequest.Response      // 请求
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client 实例

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

NewClient 创建实例化

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) ConfigClient

func (c *Client) ConfigClient(config *ClientConfig)

func (*Client) ConfigSLogClientFun

func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)

ConfigSLogClientFun 日志配置

func (*Client) DefaultHttp

func (c *Client) DefaultHttp()

DefaultHttp 默认请求

func (*Client) GetKey

func (c *Client) GetKey() string

func (*Client) GetMchID

func (c *Client) GetMchID() int64

func (*Client) QuerySupplierOrderInfo

func (c *Client) QuerySupplierOrderInfo(ctx context.Context, tradeID string, notMustParams ...gorequest.Params) (*QuerySupplierOrderInfoResult, error)

QuerySupplierOrderInfo 订单查询接口 trade_id = 商户订单号

func (*Client) SetApiURL

func (c *Client) SetApiURL(apiURL string)

func (*Client) SetAppKey

func (c *Client) SetAppKey(key string)

func (*Client) SetHttp

func (c *Client) SetHttp(app *gorequest.App)

SetHttp 配置请求

func (*Client) SetMchID

func (c *Client) SetMchID(mchID int64)

func (*Client) SupplierBalance

func (c *Client) SupplierBalance(ctx context.Context, notMustParams ...gorequest.Params) (*SupplierBalanceResult, error)

SupplierBalance 用户余额查询接口

type ClientConfig

type ClientConfig struct {
	ApiURL string // 接口地址
	MchID  int64
	Key    string
}

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 added in v1.0.197

type QuerySupplierOrderInfoResult struct {
	Result QuerySupplierOrderInfoResponse // 结果
	Body   []byte                         // 内容
	Http   gorequest.Response             // 请求
}

type SupplierBalanceResponse

type SupplierBalanceResponse struct {
	Code int    `json:"code"` // 1:请求成功 -1:请求失败
	Msg  string `json:"msg"`  // 返回说明
	Time string `json:"time"` // 时间戳
	Data struct {
		Balance string `json:"balance"` // 用户余额
	} `json:"data"`
}

type SupplierBalanceResult added in v1.0.197

type SupplierBalanceResult struct {
	Result SupplierBalanceResponse // 结果
	Body   []byte                  // 内容
	Http   gorequest.Response      // 请求
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL