Class: PayPal::PayPalEnvironment
- Inherits:
-
PayPalHttp::Environment
- Object
- PayPalHttp::Environment
- PayPal::PayPalEnvironment
- Defined in:
- lib/core/paypal_environment.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#web_url ⇒ Object
Returns the value of attribute web_url.
Instance Method Summary collapse
- #authorizationString ⇒ Object
-
#initialize(client_id, client_secret, base_url, web_url) ⇒ PayPalEnvironment
constructor
A new instance of PayPalEnvironment.
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_id ⇒ Object
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_secret ⇒ Object
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_url ⇒ Object
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
#authorizationString ⇒ Object
21 22 23 24 |
# File 'lib/core/paypal_environment.rb', line 21 def encoded = Base64.strict_encode64("#{@client_id}:#{@client_secret}") return "Basic #{encoded}" end |