validators

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package validators 微信支付 API v3 Go SDK 应答报文签名验证器

Package validators 微信支付 API v3 Go SDK 应答报文验证器

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NullValidator

type NullValidator struct {
}

NullValidator 空验证器,不对报文进行验证,对任意报文均不会返回错误, 在不需要对报文签名进行验证的情况(如微信支付账单文件下载)下使用

func (*NullValidator) Validate

func (validator *NullValidator) Validate(context.Context, *http.Response) error

Validate 跳过报文签名验证

type WechatPayNotifyValidator

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

WechatPayNotifyValidator 微信支付 API v3 通知请求报文验证器

func NewWechatPayNotifyValidator

func NewWechatPayNotifyValidator(verifier auth.Verifier) *WechatPayNotifyValidator

NewWechatPayNotifyValidator 使用 auth.Verifier 初始化一个 WechatPayNotifyValidator

func (*WechatPayNotifyValidator) Validate

func (v *WechatPayNotifyValidator) Validate(ctx context.Context, request *http.Request) error

Validate 对接收到的微信支付 API v3 通知请求报文进行验证

type WechatPayResponseValidator

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

WechatPayResponseValidator 微信支付 API v3 默认应答报文验证器

func NewWechatPayResponseValidator

func NewWechatPayResponseValidator(verifier auth.Verifier) *WechatPayResponseValidator

NewWechatPayResponseValidator 使用 auth.Verifier 初始化一个 WechatPayResponseValidator

func (*WechatPayResponseValidator) Validate

func (v *WechatPayResponseValidator) Validate(ctx context.Context, response *http.Response) error

Validate 使用验证器对微信支付应答报文进行验证

Jump to

Keyboard shortcuts

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