client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOptions

func AddOptions(s string, opt interface{}) (string, error)

func CertificateDecrypt

func CertificateDecrypt(ciphertext []byte, key, nonce, associated string) (str string, err error)

CertificateDecrypt using AES-256-GCM algorithm to decrypt ciphertext Notice: ciphertext is decrypted after base64

Types

type Client

type Client struct {
	BaseURL *url.URL

	MchId      int64
	SerialNo   string
	PrivateKey string
	PublicKey  string
	// contains filtered or unexported fields
}

func New

func New(mchId int64, serialNo, privateKey, publicKey string) *Client

func (*Client) Do

func (pay *Client) Do(req *http.Request, v interface{}) (err error)

func (*Client) NewRequest

func (pay *Client) NewRequest(method, rawurl string, body interface{}) (req *http.Request, err error)

type ErrorMessage

type ErrorMessage struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Service

type Service struct {
	Client *Client
}

Jump to

Keyboard shortcuts

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