cmb

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"`
	BranchNo      string `json:"branch_no" yaml:"branch_no"`
	MchId         string `json:"mch_id" yaml:"mch_id"`
	MerKey        string `json:"mer_key" yaml:"mer_key"`
	CmbPubKey     string `json:"cmb_pub_key" yaml:"cmb_pub_key"`
	OpPwd         string `json:"op_pwd" yaml:"op_pwd"`
	SignType      string `json:"sign_type" yaml:"sign_type"`
	LimitPay      string `json:"limit_pay" yaml:"limit_pay"`
	NotifyUrl     string `json:"notify_url" yaml:"notify_url"`
	ReturnUrl     string `json:"return_url" yaml:"return_url"`
	SignNotifyUrl string `json:"sign_notify_url" yaml:"sign_notify_url"`
	SignReturnUrl string `json:"sign_return_url" yaml:"sign_return_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 (c PayApp) BuildParams(params map[string]string) map[string]string

func (PayApp) Request

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

type PayLite

type PayLite struct {
	Base *Base
}

func (PayLite) BuildParams

func (p PayLite) BuildParams(params map[string]string) map[string]string

func (PayLite) Request

func (p PayLite) Request(params map[string]string) *payloads.UnionPaymentResult

type PayQr

type PayQr struct {
	Base *Base
}

func (PayQr) BuildParams

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

func (PayQr) Request

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

type PayWap

type PayWap struct {
	Base *Base
}

func (PayWap) BuildParams

func (p PayWap) BuildParams(params map[string]string) map[string]string

func (PayWap) Request

func (p PayWap) Request(params map[string]string) *payloads.UnionPaymentResult

type PayWeb

type PayWeb struct {
	Base *Base
}

func (PayWeb) BuildParams

func (p PayWeb) BuildParams(params map[string]string) map[string]string

func (PayWeb) Request

func (p PayWeb) 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