Class: PayPal::PayPalEnvironment

Inherits:
PayPalHttp::Environment
  • Object
show all
Defined in:
lib/paypal/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



15
16
17
18
19
20
# File 'lib/paypal/paypal_environment.rb', line 15

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.



13
14
15
# File 'lib/paypal/paypal_environment.rb', line 13

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



13
14
15
# File 'lib/paypal/paypal_environment.rb', line 13

def client_secret
  @client_secret
end

#web_urlObject

Returns the value of attribute web_url.



13
14
15
# File 'lib/paypal/paypal_environment.rb', line 13

def web_url
  @web_url
end

Instance Method Details

#authorization_stringObject



22
23
24
25
# File 'lib/paypal/paypal_environment.rb', line 22

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