Class: Stripe2QB::QuickbooksApi
- Inherits:
-
Object
- Object
- Stripe2QB::QuickbooksApi
- Includes:
- ActiveSupport::Inflector, OptionsReading
- Defined in:
- lib/stripe2qb/quickbooks_api.rb,
lib/stripe2qb/quickbooks_api/access_token.rb
Defined Under Namespace
Classes: AccessToken
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#deposit_account ⇒ Object
readonly
Returns the value of attribute deposit_account.
-
#deposit_fees_account ⇒ Object
readonly
Returns the value of attribute deposit_fees_account.
-
#deposit_fees_vendor ⇒ Object
readonly
Returns the value of attribute deposit_fees_vendor.
-
#realm_id ⇒ Object
readonly
Returns the value of attribute realm_id.
-
#receipt_account ⇒ Object
readonly
Returns the value of attribute receipt_account.
-
#receipt_customer ⇒ Object
readonly
Returns the value of attribute receipt_customer.
-
#receipt_item ⇒ Object
readonly
Returns the value of attribute receipt_item.
-
#receipt_payment_method ⇒ Object
readonly
Returns the value of attribute receipt_payment_method.
Instance Method Summary collapse
-
#initialize(options) ⇒ QuickbooksApi
constructor
A new instance of QuickbooksApi.
- #method_missing(symbol, *args) ⇒ Object
- #renew_access_token ⇒ Object
Methods included from OptionsReading
#get_required_from_options, #set_attribute_from_options
Constructor Details
#initialize(options) ⇒ QuickbooksApi
Returns a new instance of QuickbooksApi.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 20 def initialize() ('realm_id', ) @access_token = AccessToken.new() @receipt_customer = find_by_name_or_id(:customer, 'receipt_customer', , :display_name) @receipt_item = find_by_name_or_id(:item, 'receipt_item', ) @receipt_payment_method = find_by_name_or_id(:payment_method, 'receipt_payment_method', ) @receipt_account = find_by_name_or_id(:account, 'receipt_account', ) @deposit_account = find_by_name_or_id(:account, 'deposit_account', ) @deposit_fees_vendor = find_by_name_or_id(:vendor, 'deposit_fees_vendor', , :display_name) @deposit_fees_account = find_by_name_or_id(:account, 'deposit_fees_account', ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 38 def method_missing(symbol, *args) if symbol.to_s =~ /^(.+)_service$/ get_service($1.camelize) else super end end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
11 12 13 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 11 def access_token @access_token end |
#deposit_account ⇒ Object (readonly)
Returns the value of attribute deposit_account.
16 17 18 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 16 def deposit_account @deposit_account end |
#deposit_fees_account ⇒ Object (readonly)
Returns the value of attribute deposit_fees_account.
18 19 20 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 18 def deposit_fees_account @deposit_fees_account end |
#deposit_fees_vendor ⇒ Object (readonly)
Returns the value of attribute deposit_fees_vendor.
17 18 19 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 17 def deposit_fees_vendor @deposit_fees_vendor end |
#realm_id ⇒ Object (readonly)
Returns the value of attribute realm_id.
10 11 12 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 10 def realm_id @realm_id end |
#receipt_account ⇒ Object (readonly)
Returns the value of attribute receipt_account.
15 16 17 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 15 def receipt_account @receipt_account end |
#receipt_customer ⇒ Object (readonly)
Returns the value of attribute receipt_customer.
12 13 14 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 12 def receipt_customer @receipt_customer end |
#receipt_item ⇒ Object (readonly)
Returns the value of attribute receipt_item.
13 14 15 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 13 def receipt_item @receipt_item end |
#receipt_payment_method ⇒ Object (readonly)
Returns the value of attribute receipt_payment_method.
14 15 16 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 14 def receipt_payment_method @receipt_payment_method end |
Instance Method Details
#renew_access_token ⇒ Object
32 33 34 35 36 |
# File 'lib/stripe2qb/quickbooks_api.rb', line 32 def renew_access_token result = access_token_service.renew { token: result.token, secret: result.secret, created_on: Date.today } end |