Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Create oauth credentials to operate on behalf of a seller // It is a post request to the endpoint: "https://api.mercadopago.com/oauth/token" // Reference: https://www.mercadopago.com/developers/en/reference/oauth/_oauth_token/post Create(ctx context.Context, authorizationCode, redirectURI string) (*Response, error) // GetAuthorizationURL gets url for oauth authorization. GetAuthorizationURL(clientID, redirectURI, state string) string // Refresh token received when you create credentials. // It is a post request to the endpoint: "https://api.mercadopago.com/oauth/token" // Reference: https://www.mercadopago.com/developers/en/reference/oauth/_oauth_token/post Refresh(ctx context.Context, refreshToken string) (*Response, error) }
Client contains the method to interact with the Oauth API.
type RefreshTokenRequest ¶
type RefreshTokenRequest struct { GrantType string `json:"grant_type,omitempty"` ClientSecret string `json:"client_secret,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` }
RefreshTokenRequest represents credential information to perform a refresh credential request.
type Request ¶
type Request struct { GrantType string `json:"grant_type,omitempty"` ClientSecret string `json:"client_secret,omitempty"` Code string `json:"code,omitempty"` RedirectURI string `json:"redirect_uri,omitempty"` }
Request represents credential information to perform a create credential request.
type Response ¶
type Response struct { AccessToken string `json:"access_token"` Scope string `json:"scope"` RefreshToken string `json:"refresh_token"` PublicKey string `json:"public_key"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` LiveMode bool `json:"live_mode"` }
Response represents credential information for an Oauth authorization
Click to show internal directories.
Click to hide internal directories.