Class: SolidusPaypalCommercePlatform::AccessTokenAuthorizationRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/solidus_paypal_commerce_platform/access_token_authorization_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(environment:, auth_code:, nonce:) ⇒ AccessTokenAuthorizationRequest

Returns a new instance of AccessTokenAuthorizationRequest.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/solidus_paypal_commerce_platform/access_token_authorization_request.rb', line 7

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



5
6
7
# File 'lib/solidus_paypal_commerce_platform/access_token_authorization_request.rb', line 5

def body
  @body
end

#headersObject

Returns the value of attribute headers.



5
6
7
# File 'lib/solidus_paypal_commerce_platform/access_token_authorization_request.rb', line 5

def headers
  @headers
end

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/solidus_paypal_commerce_platform/access_token_authorization_request.rb', line 5

def path
  @path
end

#verbObject

Returns the value of attribute verb.



5
6
7
# File 'lib/solidus_paypal_commerce_platform/access_token_authorization_request.rb', line 5

def verb
  @verb
end