Class: PayPal::AccessTokenRequest
- Inherits:
-
Object
- Object
- PayPal::AccessTokenRequest
- Defined in:
- lib/paypal/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, refresh_token = nil) ⇒ AccessTokenRequest
constructor
A new instance of AccessTokenRequest.
Constructor Details
#initialize(environment, refresh_token = nil) ⇒ AccessTokenRequest
Returns a new instance of AccessTokenRequest.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/paypal/token_requests.rb', line 7 def initialize(environment, refresh_token = nil) @path = "/v1/oauth2/token" @body = { grant_type: "client_credentials", } if refresh_token @body[:grant_type] = "refresh_token" @body[:refresh_token] = refresh_token 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.
5 6 7 |
# File 'lib/paypal/token_requests.rb', line 5 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'lib/paypal/token_requests.rb', line 5 def headers @headers end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/paypal/token_requests.rb', line 5 def path @path end |
#verb ⇒ Object
Returns the value of attribute verb.
5 6 7 |
# File 'lib/paypal/token_requests.rb', line 5 def verb @verb end |