Documentation ¶
Index ¶
Constants ¶
View Source
const ( AlipayGatewayUrl = "https://openapi.alipay.com/gateway.do" AlipayFormat = "json" AlipayCharset = "UTF-8" // AlipayCharsetGBK = "GBK" AlipaySignType = "RSA2" AlipayVersion = "1.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SAlipayClient ¶
type SAlipayClient struct {
// contains filtered or unexported fields
}
func NewAlipayClient ¶
func NewDefaultAlipayClient ¶
func (*SAlipayClient) GetOAuthToken ¶
func (c *SAlipayClient) GetOAuthToken(ctx context.Context, code string) (*SAlipaySystemOAuthTokenResponse, error)
{"alipay_system_oauth_token_response":{"access_token":"authusrB9ee9ecc8105e4fc4869b41e8a470dX90","alipay_user_id":"20881023391875409149385062614990","expires_in":1296000,
"re_expires_in":2592000,"refresh_token":"authusrBe1a9c0bdf8d344e786ee57f2df9d6E90","user_id":"2088002723447908"}, "sign":"rXGE/YX12UrmkEae9jw9WD7B2dS13Hs0r+EnqWwKdERGsUiFmP..."}
func (*SAlipayClient) GetUserInfo ¶
func (c *SAlipayClient) GetUserInfo(ctx context.Context, authToken string) (map[string]string, error)
{"alipay_user_info_share_response":{"code":"10000","msg":"Success","city":"北京市","gender":"m","nick_name":"剑","province":"北京","user_id":"2088002723447908"},
"sign":"WZ+uBloiHvQYOOxq02aS/Y4MEoZf5+ANBnt1OKQ9Z8hOPmQsw=="}
type SCommonRequestParameters ¶
type SCommonRequestParameters struct { AppId string `json:"app_id"` Method string `json:"method"` Format string `json:"format"` Charset string `json:"charset"` SignType string `json:"sign_type"` Timestamp string `json:"timestamp"` Version string `json:"version"` AppAuthToken string `json:"app_auth_token"` }
Click to show internal directories.
Click to hide internal directories.