class AlipayMini::Api::SystemOauthToken

Public Instance Methods

get(grant_type, code) click to toggle source

when grant_type is 'authorization_code', code is the auth_code when grant_type is 'refresh_token', code is the refresh_token

# File lib/alipay_mini/api/system_oauth_token.rb, line 7
def get(grant_type, code)
  case grant_type
  when 'authorization_code'
    params = base_params.merge(grant_type: grant_type, code: code)
  when 'refresh_token'
    params = base_params.merge(grant_type: grant_type, refresh_token: code)
  else
    raise ArgumentError, 'grant type not valid, allow type "authorization_code", "refresh_token"'
  end

  AlipayMini::Request.get(method, sign_params(params))
end

Private Instance Methods

method() click to toggle source
# File lib/alipay_mini/api/system_oauth_token.rb, line 22
def method
  "alipay.system.oauth.token"
end