Class: PayPal::RefreshTokenRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/paypal/token_requests.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment, authorization_code) ⇒ RefreshTokenRequest

Returns a new instance of RefreshTokenRequest.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/paypal/token_requests.rb', line 29

def initialize(environment, authorization_code)
  @path = "/v1/identity/openidconnect/tokenservice"
  @body = {
    grant_type: "authorization_code",
    code: authorization_code,
  }
  @headers = {
    "Content-Type" => "application/x-www-form-urlencoded",
    "Authorization" => environment.authorization_string,
  }
  @verb = "POST"
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



27
28
29
# File 'lib/paypal/token_requests.rb', line 27

def body
  @body
end

#headersObject

Returns the value of attribute headers.



27
28
29
# File 'lib/paypal/token_requests.rb', line 27

def headers
  @headers
end

#pathObject

Returns the value of attribute path.



27
28
29
# File 'lib/paypal/token_requests.rb', line 27

def path
  @path
end

#verbObject

Returns the value of attribute verb.



27
28
29
# File 'lib/paypal/token_requests.rb', line 27

def verb
  @verb
end