certificates

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	// 证书序列号
	SerialNo *string `json:"serial_no"`
	// 证书有效期开始时间
	EffectiveTime *time.Time `json:"effective_time"`
	// 证书过期时间
	ExpireTime *time.Time `json:"expire_time"`
	// 为了保证安全性,微信支付在回调通知和平台证书下载接口中,对关键信息进行了AES-256-GCM加密
	EncryptCertificate *EncryptCertificate `json:"encrypt_certificate"`
}

Certificate 微信支付平台证书信息

func (Certificate) Clone

func (o Certificate) Clone() *Certificate

func (Certificate) MarshalJSON

func (o Certificate) MarshalJSON() ([]byte, error)

func (Certificate) String

func (o Certificate) String() string

type CertificatesApiService

type CertificatesApiService services.Service

func (*CertificatesApiService) DownloadCertificates

func (a *CertificatesApiService) DownloadCertificates(ctx context.Context) (resp *DownloadCertificatesResponse, result *core.APIResult, err error)

DownloadCertificates 获取平台证书列表

获取商户当前可用的平台证书列表。微信支付提供该接口,帮助商户后台系统实现平台证书的平滑更换。

Example
package main

import (
	"context"

	"github.com/wechatpay-apiv3/wechatpay-go/core"
	"github.com/wechatpay-apiv3/wechatpay-go/services/certificates"
)

func main() {
	var (
		ctx    context.Context
		client *core.Client
	)
	// 假设已获得初始化后的 core.Client

	svc := certificates.CertificatesApiService{Client: client}
	resp, result, err := svc.DownloadCertificates(ctx)

	// TODO: 处理返回结果
	_, _, _ = resp, result, err
}
Output:

type DownloadCertificatesResponse

type DownloadCertificatesResponse struct {
	// 平台证书列表
	Data []Certificate `json:"data,omitempty"`
}

DownloadCertificatesResponse

func (DownloadCertificatesResponse) Clone

func (DownloadCertificatesResponse) MarshalJSON

func (o DownloadCertificatesResponse) MarshalJSON() ([]byte, error)

func (DownloadCertificatesResponse) String

type EncryptCertificate

type EncryptCertificate struct {
	// 加密所使用的算法,目前可能取值仅为 AEAD_AES_256_GCM
	Algorithm *string `json:"algorithm"`
	// 加密所使用的随机字符串
	Nonce *string `json:"nonce"`
	// 附加数据包(可能为空)
	AssociatedData *string `json:"associated_data"`
	// 证书内容密文,解密后会获得证书完整内容
	Ciphertext *string `json:"ciphertext"`
}

EncryptCertificate 为了保证安全性,微信支付在回调通知和平台证书下载接口中,对关键信息进行了AES-256-GCM加密

func (EncryptCertificate) Clone

func (EncryptCertificate) MarshalJSON

func (o EncryptCertificate) MarshalJSON() ([]byte, error)

func (EncryptCertificate) String

func (o EncryptCertificate) String() string

Jump to

Keyboard shortcuts

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