x7s

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 10 Imported by: 0

README

Golang

📦 Golang x7s

godoc goproxy.cn goreportcard.com deps.dev

安装

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

Documentation

Index

Constants

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

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

func (c *Client) ConfigApiGormFun(apiClientFun golog.ApiGormFun)

ConfigApiGormFun 接口日志配置

func (*Client) ConfigClient

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

ConfigClient 配置

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(apiKey string)

func (*Client) SetApiURL

func (c *Client) SetApiURL(apiURL string)

func (*Client) SetPartnerID

func (c *Client) SetPartnerID(partnerID int64)

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