Class: PayPal::SDK::Core::Credential::ThirdParty::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/paypal-sdk/core/credential/third_party/token.rb

Constant Summary collapse

RemoveProperties =
[ :username, :password, :signature ]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credential, config, url) ⇒ Token

Initialize Token credentials

Arguments

  • credential – Credential Object

  • config – Configuration object

  • url – Request url



13
14
15
16
17
18
# File 'lib/paypal-sdk/core/credential/third_party/token.rb', line 13

def initialize(credential, config, url)
  @credential   = credential
  @token        = config.token
  @token_secret = config.token_secret
  @url          = url
end

Instance Attribute Details

#credentialObject

Returns the value of attribute credential.



6
7
8
# File 'lib/paypal-sdk/core/credential/third_party/token.rb', line 6

def credential
  @credential
end

#tokenObject

Returns the value of attribute token.



6
7
8
# File 'lib/paypal-sdk/core/credential/third_party/token.rb', line 6

def token
  @token
end

#token_secretObject

Returns the value of attribute token_secret.



6
7
8
# File 'lib/paypal-sdk/core/credential/third_party/token.rb', line 6

def token_secret
  @token_secret
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/paypal-sdk/core/credential/third_party/token.rb', line 6

def url
  @url
end

Instance Method Details

#propertiesObject

Return credential properties for authentication.



23
24
25
26
27
# File 'lib/paypal-sdk/core/credential/third_party/token.rb', line 23

def properties
  credential_properties = credential.properties
  credential_properties.delete_if{|k,v| RemoveProperties.include? k }
  credential_properties.merge( :authorization => oauth_authentication )
end