gopay

package module
v1.5.107 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 98

README

Logo was Loading Faild!

GoPay

微信、支付宝、QQ、通联支付、拉卡拉、PayPal 的 Golang 版本SDK

Github Github

Golang GoDoc Go GitHub Release License Go Report Card


一、安装

go get github.com/go-pay/gopay
查看 GoPay 版本

版本更新记录

import (
    "github.com/go-pay/gopay"
    "github.com/go-pay/xlog"
)

func main() {
    xlog.Info("GoPay Version: ", gopay.Version)
}


二、文档目录

点击查看不同支付方式的使用文档。方便的话,请留下您认可的小星星,十分感谢!


三、其他说明

  • 如需自定义Log输出,New Client 后,调用 client.SetLogger() 方法设置自定义Logger,自定义Logger实现 xlog.XLogger interface即可。

  • 各支付方式接入,请仔细查看 xxx_test.go 使用方式

    • gopay/wechat/v3/client_test.go
    • gopay/alipay/v3/client_test.go
    • gopay/alipay/client_test.go
    • gopay/qq/client_test.go
    • gopay/allinpay/client_test.go
    • gopay/lakala/client_test.go
    • gopay/paypal/client_test.go
    • gopay/apple/verify_test.go
    • 或 examples
  • 接入gopay示例项目(可参考接入使用方式):gopay-platform

  • 有问题请加微信群 或 关注抖音账号,加入首页粉丝群拉微信群。在此,非常感谢提出宝贵意见和反馈问题的同志们!

  • 开发过程中,请尽量使用正式环境,1分钱测试法!

  • 有偿承接技术咨询、开发,如需要加微信联系。



赞赏多少是您的心意,感谢支持!

微信赞赏码:      支付宝赞助码:


讨论群

微信群过期加个人微信: 85411418 邀请加群(加个人微信备注 gopay 并关注抖音账号,谢谢)。

关注抖音:     微信群:



鸣谢

GoLand A Go IDE with extended support for JavaScript, TypeScript, and Databases。

特别感谢 JetBrains 为开源项目提供免费的 GoLand 等 IDE 的授权

Copyright © 2000-2024 JetBrains s.r.o. JetBrains and the JetBrains logo are registered trademarks of JetBrains s.r.o.

Documentation

Index

Constants

View Source
const (
	NULL     = ""
	SUCCESS  = "SUCCESS"
	FAIL     = "FAIL"
	OK       = "OK"
	DebugOff = 0
	DebugOn  = 1
	Version  = "v1.5.107"
)

Variables

View Source
var (
	MissWechatInitParamErr = errors.New("missing wechat init parameter")
	MissAlipayInitParamErr = errors.New("missing alipay init parameter")
	MissPayPalInitParamErr = errors.New("missing paypal init parameter")
	MissAppleInitParamErr  = errors.New("missing apple init parameter")
	MissLakalaInitParamErr = errors.New("missing lakala init parameter")
	MissParamErr           = errors.New("missing required parameter")
	MarshalErr             = errors.New("marshal error")
	UnmarshalErr           = errors.New("unmarshal error")
	SignatureErr           = errors.New("signature error")
	VerifySignatureErr     = errors.New("verify signature error")
	CertNotMatchErr        = errors.New("cert not match error")
	GetSignDataErr         = errors.New("get signature data error")
	BodyMapNilErr          = errors.New("body map is nil")
)

Functions

This section is empty.

Types

type BodyMap

type BodyMap map[string]any

func (BodyMap) CheckEmptyError added in v1.5.42

func (bm BodyMap) CheckEmptyError(keys ...string) error

func (BodyMap) CheckNotAllEmptyError added in v1.5.97

func (bm BodyMap) CheckNotAllEmptyError(keys ...string) error

func (BodyMap) EncodeAliPaySignParams added in v1.5.42

func (bm BodyMap) EncodeAliPaySignParams() string

("bar=baz&foo=quux") sorted by key.

func (BodyMap) EncodeURLParams added in v1.5.56

func (bm BodyMap) EncodeURLParams() string

("bar=baz&foo=quux") sorted by key.

func (BodyMap) EncodeWeChatSignParams added in v1.5.42

func (bm BodyMap) EncodeWeChatSignParams(apiKey string) string

("bar=baz&foo=quux") sorted by key.

func (BodyMap) Get

func (bm BodyMap) Get(key string) string

获取参数,同 GetString()

func (BodyMap) GetAny added in v1.5.106

func (bm BodyMap) GetAny(key string) any

获取原始参数

func (BodyMap) GetInterface added in v1.5.42

func (bm BodyMap) GetInterface(key string) any

Deprecated 推荐使用 GetAny()

func (BodyMap) GetString added in v1.5.42

func (bm BodyMap) GetString(key string) string

获取参数转换string

func (BodyMap) JsonBody added in v1.5.42

func (bm BodyMap) JsonBody() (jb string)

func (BodyMap) MarshalXML added in v1.5.42

func (bm BodyMap) MarshalXML(e *xml.Encoder, start xml.StartElement) (err error)

func (BodyMap) Remove

func (bm BodyMap) Remove(key string)

删除参数

func (BodyMap) Reset added in v1.5.42

func (bm BodyMap) Reset()

置空BodyMap

func (BodyMap) Set

func (bm BodyMap) Set(key string, value any) BodyMap

设置参数

func (BodyMap) SetBodyMap added in v1.5.42

func (bm BodyMap) SetBodyMap(key string, value func(b BodyMap)) BodyMap

func (BodyMap) SetFormFile added in v1.5.42

func (bm BodyMap) SetFormFile(key string, file *File) BodyMap

设置 FormFile

func (BodyMap) Unmarshal added in v1.5.69

func (bm BodyMap) Unmarshal(ptr any) (err error)

Unmarshal to struct or slice point

func (*BodyMap) UnmarshalXML added in v1.5.42

func (bm *BodyMap) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

type DebugSwitch added in v1.5.42

type DebugSwitch int8

type File added in v1.5.100

type File struct {
	Name    string `json:"name"`
	Content []byte `json:"content"`
}

Directories

Path Synopsis
v3
apple 苹果应用内支付SDK(目前仅支持一个校验逻辑--服务端模式)。
apple 苹果应用内支付SDK(目前仅支持一个校验逻辑--服务端模式)。
@Author: wzy @Time: 2022/6/7
@Author: wzy @Time: 2022/6/7
pkg
js
jwt
v3

Jump to

Keyboard shortcuts

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