wechatapi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetAccessTokenGrantType_AuthorizationCode = "client_credential"
)
View Source
const (
	JsCode2SessionGrantType_AuthorizationCode = "authorization_code"
)

Variables

This section is empty.

Functions

func WithWechatPayAutoAuthCipher

func WithWechatPayAutoAuthCipher(
	mchID string, certificateSerialNo string, privateKey *rsa.PrivateKey, mchAPIv3Key string,
) core.ClientOption

Types

type GetAccessTokenResponse

type GetAccessTokenResponse struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int64  `json:"expires_in"`
}

type GetPhoneNumberRequest

type GetPhoneNumberRequest struct {
	Code string `json:"code"`
}

type GetPhoneNumberResponse

type GetPhoneNumberResponse struct {
	ErrCode   int32  `json:"errcode"`
	ErrMsg    string `json:"errmsg"`
	PhoneInfo struct {
		PhoneNumber     string `json:"phoneNumber"`
		PurePhoneNumber string `json:"purePhoneNumber"`
		CountryCode     string `json:"countryCode"`
	} `json:"phone_info"`
}

type GetWxaCodeUnLimitRequest

type GetWxaCodeUnLimitRequest struct {
	Scene      string `json:"scene"`
	Page       string `json:"page"`
	EnvVersion string `json:"env_version"`
	CheckPath  bool   `json:"check_path"`
}

type GetWxaCodeUnLimitResponse

type GetWxaCodeUnLimitResponse struct {
	ErrCode     int32  `json:"errcode"`
	ErrMsg      string `json:"errmsg"`
	Buffer      []byte
	ContentType string
}

type JsCode2SessionResponse

type JsCode2SessionResponse struct {
	ErrCode    int32  `json:"errcode"`
	ErrMsg     string `json:"errmsg"`
	SessionKey string `json:"session_key"`
	UnionId    string `json:"unionid"`
	OpenId     string `json:"openid"`
}

type PayTransactionsJSAPINotifyResponse

type PayTransactionsJSAPINotifyResponse struct {
	ErrCode         int32
	ErrMsg          string
	Amount          *payments.TransactionAmount
	Appid           *string
	Attach          *string
	BankType        *string
	Mchid           *string
	OutTradeNo      *string
	Payer           *payments.TransactionPayer
	PromotionDetail []payments.PromotionDetail
	SuccessTime     *string
	TradeState      *string
	TradeStateDesc  *string
	TradeType       *string
	TransactionId   *string
}

func PayTransactionsJSAPINotify

func PayTransactionsJSAPINotify(ctx context.Context, appId string, mchId string, mchAPIv3Key string, certificateSerialNumber string, apiclientKeyPath string, request *http.Request) (*PayTransactionsJSAPINotifyResponse, error)

type PayTransactionsJSAPIResponse

type PayTransactionsJSAPIResponse struct {
	ErrCode   int32
	ErrMsg    string
	PrepayId  *string
	Appid     *string
	TimeStamp *string
	NonceStr  *string
	Package   *string
	SignType  *string
	PaySign   *string
}

func PayTransactionsJSAPI

func PayTransactionsJSAPI(ctx context.Context, appId string, mchId string, mchAPIv3Key string, certificateSerialNumber string, apiclientKeyPath string, openId string, description string, cpOrderId string, notifyUrl string, amount int64) (*PayTransactionsJSAPIResponse, error)

https://github.com/wechatpay-apiv3/wechatpay-go https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_5_1.shtml 小程序jsapi下单

type SmsSendResponse

type SmsSendResponse struct {
	ErrCode int32  `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

func SmsSend

func SmsSend(appId string, secretId string, secretKey string, region string, signName string, templateId string, templateParamSet []string, phoneNumberSet []string) (*SmsSendResponse, error)

type StsGetCredentialResponse

type StsGetCredentialResponse struct {
	ErrCode      int32  `json:"errcode"`
	ErrMsg       string `json:"errmsg"`
	TmpSecretID  string `json:"TmpSecretId"`
	TmpSecretKey string `json:"TmpSecretKey"`
	SessionToken string `json:"Token"`
}

func StsGetCredential

func StsGetCredential(appId string, secretId string, secretKey string, bucket string, region string) (*StsGetCredentialResponse, error)

https://cloud.tencent.com/document/product/436/14048 获取临时密钥 region ap-guangzhou

Jump to

Keyboard shortcuts

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