Class: PayPalSDK::Profile
- Inherits:
-
Object
- Object
- PayPalSDK::Profile
- Defined in:
- lib/ruby-paypal-extended/profile.rb
Overview
This class holds a merchant’s API crednetials and PayPal endpoint information
Constant Summary collapse
- DEFAULT_PROXY_INFO =
Proxy information of the client environment.
{"USE_PROXY" => false, "ADDRESS" => nil, "PORT" => nil, "USER" => nil, "PASSWORD" => nil }
Instance Attribute Summary collapse
-
#client_info ⇒ Object
Returns the value of attribute client_info.
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#endpoints ⇒ Object
Returns the value of attribute endpoints.
-
#proxy_info ⇒ Object
Returns the value of attribute proxy_info.
Instance Method Summary collapse
-
#initialize(credentials, use_production = false, proxy_info = nil) ⇒ Profile
constructor
Creates a new Profile, setting it with the options provided Options are:
credentials
- A hash of user credentials with keys of “USER”, “PWD”, and “SIGNATURE”use_production
- Set to true to interact with the production server. - #use_proxy? ⇒ Boolean
Constructor Details
#initialize(credentials, use_production = false, proxy_info = nil) ⇒ Profile
Creates a new Profile, setting it with the options provided Options are: credentials
- A hash of user credentials with keys of “USER”, “PWD”, and “SIGNATURE” use_production
- Set to true to interact with the production server. Defaults to false proxy_info
- A hash of proxy server info with keys of “USE_PROXY”, “ADDRESS”, “PORT”, “USER”, “PASSWORD”
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ruby-paypal-extended/profile.rb', line 19 def initialize(credentials, use_production = false, proxy_info = nil) @credentials = credentials @proxy_info = proxy_info || DEFAULT_PROXY_INFO @endpoints = use_production ? PayPalSDK::Config::PRODUCTION_API_ENDPOINT : PayPalSDK::Config::SANDBOX_API_ENDPOINT @client_info = { "VERSION" => PayPalSDK::Config::CLIENT_VERSION, "SOURCE" => PayPalSDK::Config::CLIENT_SOURCE } end |
Instance Attribute Details
#client_info ⇒ Object
Returns the value of attribute client_info.
8 9 10 |
# File 'lib/ruby-paypal-extended/profile.rb', line 8 def client_info @client_info end |
#credentials ⇒ Object
Returns the value of attribute credentials.
6 7 8 |
# File 'lib/ruby-paypal-extended/profile.rb', line 6 def credentials @credentials end |
#endpoints ⇒ Object
Returns the value of attribute endpoints.
7 8 9 |
# File 'lib/ruby-paypal-extended/profile.rb', line 7 def endpoints @endpoints end |
#proxy_info ⇒ Object
Returns the value of attribute proxy_info.
9 10 11 |
# File 'lib/ruby-paypal-extended/profile.rb', line 9 def proxy_info @proxy_info end |
Instance Method Details
#use_proxy? ⇒ Boolean
31 32 33 |
# File 'lib/ruby-paypal-extended/profile.rb', line 31 def use_proxy? @proxy_info["USE_PROXY"] end |