x7s

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 13 Imported by: 0

README

Golang

📦 Golang x7s

godoc goproxy.cn goreportcard.com deps.dev

安装

go get -v -u go.dtapp.net/x7s@v1.0.5

Documentation

Index

Constants

View Source
const (
	CodeSuccess = 1 // 成功
)
View Source
const (
	LogTable = "x7s"
)
View Source
const (
	Version = "1.0.5"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client 实例

func NewClient

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

NewClient 创建实例化

func (*Client) GetApiKey

func (c *Client) GetApiKey() string

func (*Client) GetApiURL

func (c *Client) GetApiURL() string

func (*Client) GetPartnerID

func (c *Client) GetPartnerID() int64

func (*Client) PaymentDfpayAddorder

func (c *Client) PaymentDfpayAddorder(ctx context.Context, partnerOrderNo string, Type int, account string, amount float64, notifyUrl string, notMustParams ...gorequest.Params) (*PaymentDfpayAddorderResult, error)

PaymentDfpayAddorder 统一下单接口 https://gys.x7s.com/Home_Index_documenta.html#doc6

func (*Client) PaymentDfpayClose

func (c *Client) PaymentDfpayClose(ctx context.Context, partnerOrderNo string, notMustParams ...gorequest.Params) (*PaymentDfpayCloseResult, error)

PaymentDfpayClose 取消订单 https://gys.x7s.com/Home_Index_documenta.html#doc9

func (*Client) PaymentDfpayQuery

func (c *Client) PaymentDfpayQuery(ctx context.Context, partnerOrderNo string, notMustParams ...gorequest.Params) (*PaymentDfpayQueryResult, error)

PaymentDfpayQuery 核销查询接口 https://gys.x7s.com/Home_Index_documenta.html#doc8

func (*Client) SetApiKey

func (c *Client) SetApiKey(v string) *Client

func (*Client) SetApiURL

func (c *Client) SetApiURL(v string) *Client

func (*Client) SetClientIP added in v1.0.3

func (c *Client) SetClientIP(clientIP string) *Client

SetClientIP 配置

func (*Client) SetLogFun added in v1.0.3

func (c *Client) SetLogFun(logFun gorequest.LogFunc)

SetLogFun 设置日志记录函数

func (*Client) SetPartnerID

func (c *Client) SetPartnerID(v int64) *Client

func (*Client) SetTrace added in v1.0.3

func (c *Client) SetTrace(trace bool)

SetTrace 设置OpenTelemetry链路追踪

func (*Client) TraceEndSpan added in v1.0.3

func (c *Client) TraceEndSpan()

TraceEndSpan 结束OpenTelemetry链路追踪状态

func (*Client) TraceGetSpanID added in v1.0.3

func (c *Client) TraceGetSpanID() (spanID string)

TraceGetSpanID 获取OpenTelemetry链路追踪SpanID

func (*Client) TraceGetTraceID added in v1.0.3

func (c *Client) TraceGetTraceID() (traceID string)

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

func (c *Client) TraceSetAttributes(kv ...attribute.KeyValue)

TraceSetAttributes 设置OpenTelemetry链路追踪属性

func (*Client) TraceSetStatus added in v1.0.3

func (c *Client) TraceSetStatus(code codes.Code, description string)

TraceSetStatus 设置OpenTelemetry链路追踪状态

func (*Client) TraceStartSpan added in v1.0.3

func (c *Client) TraceStartSpan(ctx context.Context, spanName string) context.Context

TraceStartSpan 开始OpenTelemetry链路追踪状态

type ClientConfig

type ClientConfig struct {
	ApiURL    string `json:"api_url"`    // 接口地址
	PartnerID int64  `json:"partner_id"` // 平台分配商户号
	ApiKey    string `json:"api_key"`    // 渠道分配的密钥
}

ClientConfig 实例配置

type PaymentDfpayAddorderResponse

type PaymentDfpayAddorderResponse struct {
	Code int    `json:"code"` // 0=错误 1=成功
	Msg  string `json:"msg"`  // 描述
	Data struct {
		Status         string `json:"status"`           // 状态 -1=删除 0=可用 90=关闭
		PartnerId      string `json:"partner_id"`       // 供应商ID
		PartnerOrderNo string `json:"partner_order_no"` // 供应商订单号
		Account        string `json:"account"`          // 账号
		Amount         string `json:"amount"`           // 金额
		ChargeAmount   string `json:"charge_amount"`    // 收费金额
	} `json:"data,omitempty"`
}

type PaymentDfpayAddorderResult

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

type PaymentDfpayCloseResponse

type PaymentDfpayCloseResponse struct {
	Code   int    `json:"code"`             // 0=错误 1=成功
	Msg    string `json:"msg"`              // 描述
	Status int    `json:"status,omitempty"` // 状态 -1=删除 0=可用 90=关闭
}

type PaymentDfpayCloseResult

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

type PaymentDfpayQueryResponse

type PaymentDfpayQueryResponse struct {
	Code int    `json:"code"` // 0=错误 1=成功
	Msg  string `json:"msg"`  // 描述
	Data struct {
		Status         string `json:"status"`           // 状态 -1=删除 0=可用 90=关闭
		PartnerId      string `json:"partner_id"`       // 供应商ID
		PartnerOrderNo string `json:"partner_order_no"` // 供应商订单号
		Account        string `json:"account"`          // 账号
		Amount         string `json:"amount"`           // 金额
		ChargeAmount   string `json:"charge_amount"`    // 收费金额
	} `json:"data,omitempty"`
}

type PaymentDfpayQueryResult

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

Jump to

Keyboard shortcuts

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