ysepay

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

ysepay-go

银盛支付 Go SDK

Documentation

Index

Constants

View Source
const (
	SysOK        = "SYS000" // 网关受理成功响应码
	SysAccepting = "SYS001" // 网关受理中响应码

	ComOK         = "COM000" // 业务受理成功
	ComProcessing = "COM004" // 业务处理中
)

Variables

View Source
var ErrSysAccepting = errors.New("SYS001 | 网关受理中")

ErrSysAccepting 网关受理中

Functions

This section is empty.

Types

type Client

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

Client 银盛支付客户端

func NewClient

func NewClient(mchNO, desKey string, options ...Option) *Client

NewClient 生成银盛支付客户端

func (*Client) Decrypt

func (c *Client) Decrypt(cipher string) (string, error)

Decrypt 敏感数据DES解密

func (*Client) Encrypt

func (c *Client) Encrypt(plain string) (string, error)

Encrypt 敏感数据DES加密

func (*Client) MchNO

func (c *Client) MchNO() string

MchNO 返回商户号

func (*Client) MustEncrypt

func (c *Client) MustEncrypt(plain string) string

MustEncrypt 敏感数据DES加密;若发生错误,则Panic

func (*Client) PostForm

func (c *Client) PostForm(ctx context.Context, api, serviceNO string, bizData value.V) (gjson.Result, error)

PostForm 发送POST表单请求

func (*Client) VerifyNotify

func (c *Client) VerifyNotify(form url.Values) (gjson.Result, error)

VerifyNotify 解析并验证异步回调通知,返回BizJSON数据

type Option

type Option func(c *Client)

Option 自定义设置项

func WithHttpCli

func WithHttpCli(cli *http.Client) Option

WithHttpCli 设置自定义 HTTP Client

func WithLogger

func WithLogger(fn func(ctx context.Context, data map[string]string)) Option

WithLogger 设置日志记录

func WithPrivateKey

func WithPrivateKey(key *lib_crypto.PrivateKey) Option

WithPrivateKey 设置商户RSA私钥

func WithPublicKey

func WithPublicKey(key *lib_crypto.PublicKey) Option

WithPublicKey 设置平台RSA公钥

Jump to

Keyboard shortcuts

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