config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// App 在App支付
	App = iota + 1
	// Web 在网页上支付
	Web
)

Variables

View Source
var (
	ErrUnknowDevice  = errors.New("Unknow device type")
	ErrSignature     = errors.New("Signature error")
	ErrPaymentFailed = errors.New("Payment failed")
)

Functions

func IsOK

func IsOK(err error) bool

Types

type Account

type Account struct {
	Debug      bool    `json:"debug"`
	AppID      string  `json:"appID"`      //即AppID
	AppSecret  string  `json:"appSecret"`  //即AppKey
	MerchantID string  `json:"merchantID"` //商家ID
	PublicKey  string  `json:"publicKey"`  //公钥
	PrivateKey string  `json:"privateKey"` //私钥
	CertPath   string  `json:"certPath"`   //证书路径
	Options    Options `json:"options"`    //其它选项
}

func NewAccount

func NewAccount() *Account

func (*Account) FromStore

func (c *Account) FromStore(v echo.Store) *Account

type Device

type Device int

Device 设备类型

type GoodsType

type GoodsType int

GoodsType 商品类型

const (
	// VirtualGoods 虚拟商品
	VirtualGoods GoodsType = iota
	// PhysicalGoods 实物类商品
	PhysicalGoods
)

func (GoodsType) String

func (a GoodsType) String() string

type OK

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

func NewOK

func NewOK(msg error) *OK

func NewOKString

func NewOKString(msg string) *OK

func (*OK) OK

func (s *OK) OK()

type OKer

type OKer interface {
	OK()
}

type Options

type Options struct {
	IconClass string `json:"iconClass"`
	IconImage string `json:"iconImage"`
	Title     string `json:"title"`
	Name      string `json:"name"`
}

type Pay

type Pay struct {
	Platform       string
	Device         Device
	NotifyURL      string
	ReturnURL      string
	Subject        string
	TradeNo        string
	Amount         float64
	GoodsType      GoodsType
	PassbackParams string // 回传参数
	Options        echo.H //其它选项
}

func (*Pay) DeviceType

func (pay *Pay) DeviceType() string

func (*Pay) GoodsTypeName

func (pay *Pay) GoodsTypeName() string

type Refund

type Refund struct {
	Platform     string
	TradeNo      string  //商户订单号
	RefundNo     string  //商户退单号(aliapy可不传)
	TotalAmount  float64 //订单总金额(alipay可不传)
	RefundAmount float64 //退款金额
	RefundReason string  //退款原因(选填)
	Options      echo.H  //其它选项
}

Jump to

Keyboard shortcuts

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