Class: PayPal::AccessTokenRequest
- Inherits:
-
Object
- Object
- PayPal::AccessTokenRequest
- Defined in:
- lib/core/token_requests.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#path ⇒ Object
Returns the value of attribute path.
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(environment, refreshToken = nil) ⇒ AccessTokenRequest
constructor
A new instance of AccessTokenRequest.
Constructor Details
#initialize(environment, refreshToken = nil) ⇒ AccessTokenRequest
Returns a new instance of AccessTokenRequest.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/core/token_requests.rb', line 5 def initialize(environment, refreshToken = nil) @path = "/v1/oauth2/token" @body = { :grant_type => "client_credentials", } if (refreshToken) @body[:grant_type] = "refresh_token" @body[:refresh_token] = refreshToken end @headers = { "Content-Type" => "application/x-www-form-urlencoded", "Authorization" => environment.(), } @verb = "POST" end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/core/token_requests.rb', line 3 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
3 4 5 |
# File 'lib/core/token_requests.rb', line 3 def headers @headers end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/core/token_requests.rb', line 3 def path @path end |
#verb ⇒ Object
Returns the value of attribute verb.
3 4 5 |
# File 'lib/core/token_requests.rb', line 3 def verb @verb end |