qpay

package
v0.0.0-...-89bd553 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Config     *Config
	GatewayUrl string
}

func NewBase

func NewBase(config *Config) *Base

func (*Base) GetFullGatewayUrl

func (b *Base) GetFullGatewayUrl(method string) string

func (*Base) Request

func (b *Base) Request(uri string, params map[string]string) (*BaseResponse, error)

type BaseResponse

type BaseResponse struct {
	Resp string
}

func NewBaseResponse

func NewBaseResponse(resp string) *BaseResponse

func (*BaseResponse) ToJson

func (w *BaseResponse) ToJson() (string, error)

func (*BaseResponse) ToMap

func (w *BaseResponse) ToMap() (map[string]interface{}, error)

func (*BaseResponse) ToXml

func (w *BaseResponse) ToXml() (string, error)

type Config

type Config struct {
	UseSandbox      bool   `json:"use_sandbox" yaml:"use_sandbox"`
	ReturnRaw       bool   `json:"return_raw" yaml:"return_raw"`
	AppId           string `json:"app_id" yaml:"app_id"`
	AppKey          string `json:"app_key" yaml:"app_key"`
	MchId           string `json:"mch_id" yaml:"mch_id"`
	Md5Key          string `json:"md5_key" yaml:"md5_key"`
	FeeType         string `json:"fee_type" yaml:"fee_type"`
	NotifyUrl       string `json:"notify_url" yaml:"notify_url"`
	RefundNotifyUrl string `json:"refund_notify_url" yaml:"refund_notify_url"`
	RedirectUrl     string `json:"redirect_url" yaml:"redirect_url"`
}

func NewConfigWithJson

func NewConfigWithJson(content []byte) (*Config, error)

func NewConfigWithYaml

func NewConfigWithYaml(content []byte) (*Config, error)

func (Config) CheckConfig

func (c Config) CheckConfig() error

func (Config) ParseConfig

func (c Config) ParseConfig() interface{}

type Gateway

type Gateway struct {
	Base *Base
}

func (*Gateway) Request

type PayApp

type PayApp struct {
	Base *Base
}

func (PayApp) BuildParams

func (q PayApp) BuildParams(params map[string]string) map[string]string

func (PayApp) Request

func (q PayApp) Request(params map[string]string) *payloads.UnionPaymentResult

type PayBar

type PayBar struct {
	Base *Base
}

func (PayBar) BuildParams

func (q PayBar) BuildParams(params map[string]string) map[string]string

func (PayBar) Request

func (q PayBar) Request(params map[string]string) *payloads.UnionPaymentResult

type PayPub

type PayPub struct {
	Base *Base
}

func (PayPub) BuildParams

func (q PayPub) BuildParams(params map[string]string) map[string]string

func (PayPub) Request

func (q PayPub) Request(params map[string]string) *payloads.UnionPaymentResult

type PayQr

type PayQr struct {
	Base *Base
}

func (PayQr) BuildParams

func (q PayQr) BuildParams(params map[string]string) map[string]string

func (PayQr) Request

func (q PayQr) Request(params map[string]string) *payloads.UnionPaymentResult

type QueryRefund

type QueryRefund struct {
	Base *Base
}

func (QueryRefund) BuildParams

func (q QueryRefund) BuildParams(params map[string]string) map[string]string

func (QueryRefund) Request

func (q QueryRefund) Request(params map[string]string) *payloads.UnionPaymentResult

type QueryTrade

type QueryTrade struct {
	Base *Base
}

func (QueryTrade) BuildParams

func (q QueryTrade) BuildParams(params map[string]string) map[string]string

func (QueryTrade) Request

func (q QueryTrade) Request(params map[string]string) *payloads.UnionPaymentResult

type Refund

type Refund struct {
	Base *Base
}

func (Refund) BuildParams

func (q Refund) BuildParams(params map[string]string) map[string]string

func (Refund) Request

func (q Refund) Request(params map[string]string) *payloads.UnionPaymentResult

Jump to

Keyboard shortcuts

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