Documentation ¶
Index ¶
- Constants
- func WithWechatPayAutoAuthCipher(mchID string, certificateSerialNo string, privateKey *rsa.PrivateKey, ...) core.ClientOption
- type GetAccessTokenResponse
- type GetPhoneNumberRequest
- type GetPhoneNumberResponse
- type GetWxaCodeUnLimitRequest
- type GetWxaCodeUnLimitResponse
- type JsCode2SessionResponse
- type PayTransactionsJSAPINotifyResponse
- type PayTransactionsJSAPIResponse
- type SmsSendResponse
- type StsGetCredentialResponse
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"` }
func GetAccessToken ¶
func GetAccessToken(appId string, secret string, grantType string) (*GetAccessTokenResponse, error)
https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getAccessToken.html 小程序登录
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"` }
func GetPhoneNumber ¶
func GetPhoneNumber(accessToken string, code string) (*GetPhoneNumberResponse, error)
type GetWxaCodeUnLimitResponse ¶
type GetWxaCodeUnLimitResponse struct { ErrCode int32 `json:"errcode"` ErrMsg string `json:"errmsg"` Buffer []byte ContentType string }
func GetWxaCodeUnLimit ¶
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"` }
func JsCode2Session ¶
func JsCode2Session(appId string, secret string, jsCode string, grantType string) (*JsCode2SessionResponse, error)
https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-login/code2Session.html 小程序登录
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 }
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 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
Click to show internal directories.
Click to hide internal directories.