Class: CCBill::Configuration
- Inherits:
-
Object
- Object
- CCBill::Configuration
- Defined in:
- lib/ccbill_ruby/configuration.rb
Constant Summary collapse
- TEST_ENDPOINT =
'https://sandbox-api.ccbill.com/wap-frontflex/flexforms/'- LIVE_ENDPOINT =
'https://api.ccbill.com/wap-frontflex/flexforms/'
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#default_currency ⇒ Object
Returns the value of attribute default_currency.
-
#flexform_id ⇒ Object
Returns the value of attribute flexform_id.
-
#live_endpoint ⇒ Object
Returns the value of attribute live_endpoint.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#sub_account ⇒ Object
Returns the value of attribute sub_account.
-
#test_endpoint ⇒ Object
Returns the value of attribute test_endpoint.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #test? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 |
# File 'lib/ccbill_ruby/configuration.rb', line 18 def initialize @mode = :test @default_currency = '840' # USD @test_endpoint = TEST_ENDPOINT @live_endpoint = LIVE_ENDPOINT end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
11 12 13 |
# File 'lib/ccbill_ruby/configuration.rb', line 11 def account @account end |
#default_currency ⇒ Object
Returns the value of attribute default_currency.
9 10 11 |
# File 'lib/ccbill_ruby/configuration.rb', line 9 def default_currency @default_currency end |
#flexform_id ⇒ Object
Returns the value of attribute flexform_id.
14 15 16 |
# File 'lib/ccbill_ruby/configuration.rb', line 14 def flexform_id @flexform_id end |
#live_endpoint ⇒ Object
Returns the value of attribute live_endpoint.
16 17 18 |
# File 'lib/ccbill_ruby/configuration.rb', line 16 def live_endpoint @live_endpoint end |
#mode ⇒ Object
Returns the value of attribute mode.
6 7 8 |
# File 'lib/ccbill_ruby/configuration.rb', line 6 def mode @mode end |
#salt ⇒ Object
Returns the value of attribute salt.
8 9 10 |
# File 'lib/ccbill_ruby/configuration.rb', line 8 def salt @salt end |
#sub_account ⇒ Object
Returns the value of attribute sub_account.
12 13 14 |
# File 'lib/ccbill_ruby/configuration.rb', line 12 def sub_account @sub_account end |
#test_endpoint ⇒ Object
Returns the value of attribute test_endpoint.
15 16 17 |
# File 'lib/ccbill_ruby/configuration.rb', line 15 def test_endpoint @test_endpoint end |
Instance Method Details
#endpoint ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/ccbill_ruby/configuration.rb', line 30 def endpoint if test? test_endpoint else live_endpoint end end |
#test? ⇒ Boolean
26 27 28 |
# File 'lib/ccbill_ruby/configuration.rb', line 26 def test? mode.to_sym == :test end |