alipay

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: 23 Imported by: 0

Documentation

Index

Constants

View Source
const SignTypeRsa = "RSA"
View Source
const SignTypeRsa2 = "RSA2"

Variables

This section is empty.

Functions

This section is empty.

Types

type AliNotifyPayResponse

type AliNotifyPayResponse struct {
	NotifyType             string `json:"notify_type"`
	NotifyId               string `json:"notify_id"`
	NotifyTime             string `json:"notify_time"`
	SignType               string `json:"sign_type"`
	Sign                   string `json:"sign"`
	TransCurrency          string `json:"trans_currency"`
	SettleCurrency         string `json:"settle_currency"`
	PayCurrency            string `json:"pay_currency"`
	PayAmount              string `json:"pay_amount"`
	SettleTransRate        string `json:"settle_trans_rate"`
	TransPayRate           string `json:"trans_pay_rate"`
	RefundResetPaytoolList string `json:"refund_reset_paytool_list"`
	ChargeAmount           string `json:"charge_amount"`
	ChargeFlags            string `json:"charge_flags"`
	SettlementId           string `json:"settlement_id"`
	AdvanceAmount          string `json:"advance_amount"`
	NotifyActionType       string `json:"notify_action_type"`
	DiscountAmount         string `json:"discount_amount"`
	MdiscountAmount        string `json:"mdiscount_amount"`
	UnfreezeAmount         string `json:"unfreeze_amount"`
	AuthTradePayMode       string `json:"auth_trade_pay_mode"`
}

type Base

type Base struct {
	Config *Config
	Http   http.Client
	// Common Properties
	GatewayUrl string
	PublicKey  *rsa.PublicKey
	PrivateKey *rsa.PrivateKey
}

func NewBase

func NewBase(config *Config) *Base

func (*Base) BuildSign

func (b *Base) BuildSign(signData map[string]string) string

func (*Base) BuildUrlEncode

func (b *Base) BuildUrlEncode(kvPairs map[string]string) string

func (*Base) GetFullGatewayUrl

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

func (*Base) MakeSign

func (b *Base) MakeSign(signStr string) string

func (*Base) Request

func (b *Base) Request(uri string, bizContentParams 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"`
	AppId         string   `json:"app_id" yaml:"app_id"`
	Charset       string   `json:"charset" yaml:"charset"`
	Format        string   `json:"format" yaml:"format"`
	Version       string   `json:"version" yaml:"version"`
	SignType      string   `json:"sign_type" yaml:"sign_type"`
	AliPublicKey  string   `json:"ali_public_key" yaml:"ali_public_key"`
	RsaPrivateKey string   `json:"rsa_private_key" yaml:"rsa_private_key"`
	LimitPay      []string `json:"limit_pay" yaml:"limit_pay"`
	NotifyUrl     string   `json:"notify_url" yaml:"notify_url"`
	ReturnUrl     string   `json:"return_url" yaml:"return_url"`
	FeeType       string   `json:"fee_type" yaml:"fee_type"`
}

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 (a PayApp) BuildParams(params map[string]string) map[string]string

func (PayApp) Request

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

type PayBar

type PayBar struct {
	Base *Base
}

func (PayBar) BuildParams

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

func (PayBar) CheckParams

func (a PayBar) CheckParams(params map[string]string) error

func (PayBar) Request

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

type PayQr

type PayQr struct {
	Base *Base
}

func (PayQr) BuildParams

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

func (PayQr) Request

func (a 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 (a PayWap) Request(params map[string]string) *payloads.UnionPaymentResult

type PayWeb

type PayWeb struct {
	Base *Base
}

func (PayWeb) BuildParams

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

func (PayWeb) Request

func (a 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