Class: PayPal::PayPalEnvironment

Inherits:
PayPalHttp::Environment
  • Object
show all
Defined in:
lib/core/paypal_environment.rb

Direct Known Subclasses

LiveEnvironment, SandboxEnvironment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id, client_secret, base_url, web_url) ⇒ PayPalEnvironment

Returns a new instance of PayPalEnvironment.



14
15
16
17
18
19
# File 'lib/core/paypal_environment.rb', line 14

def initialize(client_id, client_secret, base_url, web_url)
  super(base_url)
  @client_id = client_id
  @client_secret = client_secret
  @web_url = web_url
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



12
13
14
# File 'lib/core/paypal_environment.rb', line 12

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



12
13
14
# File 'lib/core/paypal_environment.rb', line 12

def client_secret
  @client_secret
end

#web_urlObject

Returns the value of attribute web_url.



12
13
14
# File 'lib/core/paypal_environment.rb', line 12

def web_url
  @web_url
end

Instance Method Details

#authorizationStringObject



21
22
23
24
# File 'lib/core/paypal_environment.rb', line 21

def authorizationString
  encoded = Base64.strict_encode64("#{@client_id}:#{@client_secret}")
  return "Basic #{encoded}"
end