Class: PayPal::PayPalEnvironment
- Inherits:
-
PayPalHttp::Environment
- Object
- PayPalHttp::Environment
- PayPal::PayPalEnvironment
- Defined in:
- lib/paypal/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
- #authorization_string ⇒ 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
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_id ⇒ Object
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_secret ⇒ Object
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_url ⇒ Object
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_string ⇒ Object
22 23 24 25 |
# File 'lib/paypal/paypal_environment.rb', line 22 def encoded = Base64.strict_encode64("#{@client_id}:#{@client_secret}") "Basic #{encoded}" end |