Class: PushPay::Configuration
- Inherits:
-
Object
- Object
- PushPay::Configuration
- Defined in:
- lib/pushpay/configuration.rb
Instance Attribute Summary collapse
-
#auth_url ⇒ Object
Returns the value of attribute auth_url.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#merchant_key ⇒ Object
Returns the value of attribute merchant_key.
-
#organization_key ⇒ Object
Returns the value of attribute organization_key.
-
#scopes ⇒ Object
Returns the value of attribute scopes.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #missing_credentials ⇒ Object
- #sandbox! ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 |
# File 'lib/pushpay/configuration.rb', line 8 def initialize @base_url = "https://api.pushpay.io" @auth_url = "https://auth.pushpay.com/pushpay/oauth/token" @timeout = 30 @scopes = ["read"] end |
Instance Attribute Details
#auth_url ⇒ Object
Returns the value of attribute auth_url.
5 6 7 |
# File 'lib/pushpay/configuration.rb', line 5 def auth_url @auth_url end |
#base_url ⇒ Object
Returns the value of attribute base_url.
5 6 7 |
# File 'lib/pushpay/configuration.rb', line 5 def base_url @base_url end |
#client_id ⇒ Object
Returns the value of attribute client_id.
5 6 7 |
# File 'lib/pushpay/configuration.rb', line 5 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
5 6 7 |
# File 'lib/pushpay/configuration.rb', line 5 def client_secret @client_secret end |
#merchant_key ⇒ Object
Returns the value of attribute merchant_key.
5 6 7 |
# File 'lib/pushpay/configuration.rb', line 5 def merchant_key @merchant_key end |
#organization_key ⇒ Object
Returns the value of attribute organization_key.
5 6 7 |
# File 'lib/pushpay/configuration.rb', line 5 def organization_key @organization_key end |
#scopes ⇒ Object
Returns the value of attribute scopes.
5 6 7 |
# File 'lib/pushpay/configuration.rb', line 5 def scopes @scopes end |
#timeout ⇒ Object
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/pushpay/configuration.rb', line 5 def timeout @timeout end |
Instance Method Details
#missing_credentials ⇒ Object
26 27 28 29 30 31 |
# File 'lib/pushpay/configuration.rb', line 26 def missing_credentials missing = [] missing << "client_id" if client_id.nil? || client_id.to_s.empty? missing << "client_secret" if client_secret.nil? || client_secret.to_s.empty? missing end |
#sandbox! ⇒ Object
15 16 17 18 19 |
# File 'lib/pushpay/configuration.rb', line 15 def sandbox! @base_url = "https://sandbox-api.pushpay.io" @auth_url = "https://auth.pushpay.com/pushpay-sandbox/oauth/token" self end |
#valid? ⇒ Boolean
21 22 23 24 |
# File 'lib/pushpay/configuration.rb', line 21 def valid? !client_id.nil? && !client_id.empty? && !client_secret.nil? && !client_secret.empty? end |