Class: Payflow::Configuration
- Inherits:
-
Object
- Object
- Payflow::Configuration
- Defined in:
- lib/payflow/configuration.rb
Instance Attribute Summary collapse
-
#asaas_api_key ⇒ Object
Returns the value of attribute asaas_api_key.
-
#asaas_webhook_token ⇒ Object
Returns the value of attribute asaas_webhook_token.
-
#billable_class_name ⇒ Object
Returns the value of attribute billable_class_name.
-
#provider ⇒ Object
(also: #default_provider)
Returns the value of attribute provider.
-
#stripe_api_key ⇒ Object
Returns the value of attribute stripe_api_key.
-
#stripe_webhook_secret ⇒ Object
Returns the value of attribute stripe_webhook_secret.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #provider_credentials(provider_name) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 |
# File 'lib/payflow/configuration.rb', line 15 def initialize @provider = :asaas @billable_class_name = nil end |
Instance Attribute Details
#asaas_api_key ⇒ Object
Returns the value of attribute asaas_api_key.
5 6 7 |
# File 'lib/payflow/configuration.rb', line 5 def asaas_api_key @asaas_api_key end |
#asaas_webhook_token ⇒ Object
Returns the value of attribute asaas_webhook_token.
5 6 7 |
# File 'lib/payflow/configuration.rb', line 5 def asaas_webhook_token @asaas_webhook_token end |
#billable_class_name ⇒ Object
Returns the value of attribute billable_class_name.
5 6 7 |
# File 'lib/payflow/configuration.rb', line 5 def billable_class_name @billable_class_name end |
#provider ⇒ Object Also known as: default_provider
Returns the value of attribute provider.
5 6 7 |
# File 'lib/payflow/configuration.rb', line 5 def provider @provider end |
#stripe_api_key ⇒ Object
Returns the value of attribute stripe_api_key.
5 6 7 |
# File 'lib/payflow/configuration.rb', line 5 def stripe_api_key @stripe_api_key end |
#stripe_webhook_secret ⇒ Object
Returns the value of attribute stripe_webhook_secret.
5 6 7 |
# File 'lib/payflow/configuration.rb', line 5 def stripe_webhook_secret @stripe_webhook_secret end |
Instance Method Details
#provider_credentials(provider_name) ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/payflow/configuration.rb', line 20 def provider_credentials(provider_name) case provider_name.to_sym when :asaas { api_key: asaas_api_key, webhook_token: asaas_webhook_token } when :stripe { api_key: stripe_api_key, webhook_secret: stripe_webhook_secret } else raise ProviderNotFoundError, "Unknown provider: #{provider_name}" end end |