apiv3

package
v0.0.0-...-d10c483 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//已实名
	Authorize_authorized = "AUTHORIZE_STATE_AUTHORIZED"
	//未实名
	Authorize_unauthorized = "AUTHORIZE_STATE_UNAUTHORIZED"
)

Variables

This section is empty.

Functions

func MerchantApplymentState

func MerchantApplymentState(v3 ApiV3, merchant string) bool

获取特约商户的实名状况

Types

type AesUtils

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

*

AES GCM解密方式

func (*AesUtils) DecryptToString

func (this *AesUtils) DecryptToString(associatedData, nonce, ciphertext string) (string, error)

解密文本

func (*AesUtils) Init

func (this *AesUtils) Init(key string) error

type ApiV3

type ApiV3 struct {
	//服务商商户号
	MerchantId string

	Nonce string
	// contains filtered or unexported fields
}

*

api v3 协议

func (*ApiV3) Call

func (this *ApiV3) Call(method string, url string, parameter string) ([]byte, error)

func (*ApiV3) DecryptText

func (this *ApiV3) DecryptText(ciphertext string) (string, error)

*

解密敏感信息

func (*ApiV3) DoGet

func (this *ApiV3) DoGet(url string) ([]byte, error)

func (*ApiV3) DoPost

func (this *ApiV3) DoPost(url string, body string) ([]byte, error)

func (*ApiV3) DownloadFlatPublicKey

func (this *ApiV3) DownloadFlatPublicKey(filename string) error

获取平台秘钥,并保存

func (*ApiV3) EncryptText

func (this *ApiV3) EncryptText(secretMessage string) (string, error)

*

加密敏感信息

func (*ApiV3) SetApiV3Key

func (this *ApiV3) SetApiV3Key(key string)

设置APIV3的秘钥

func (*ApiV3) SetFlatKey

func (this *ApiV3) SetFlatKey(cno string, publickey []byte) error

设置平台秘钥信息

func (*ApiV3) SetMerchantKey

func (this *ApiV3) SetMerchantKey(cno string, privatekey []byte) error

设置商户秘钥信息

Jump to

Keyboard shortcuts

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