Module: Cashbox

Extended by:
ActiveSupport::Autoload
Defined in:
lib/cashbox.rb,
lib/cashbox/error.rb,
lib/cashbox/request.rb,
lib/cashbox/version.rb,
lib/cashbox/model/model.rb,
lib/cashbox/model/price.rb,
lib/cashbox/model/period.rb,
lib/cashbox/model/refund.rb,
lib/cashbox/model/account.rb,
lib/cashbox/model/address.rb,
lib/cashbox/model/invoice.rb,
lib/cashbox/model/pay_pal.rb,
lib/cashbox/model/product.rb,
lib/cashbox/model/metadata.rb,
lib/cashbox/model/credit_card.rb,
lib/cashbox/model/description.rb,
lib/cashbox/model/entitlement.rb,
lib/cashbox/model/transaction.rb,
lib/cashbox/model/billing_plan.rb,
lib/cashbox/model/direct_debit.rb,
lib/cashbox/model/invoice_item.rb,
lib/cashbox/model/subscription.rb,
lib/cashbox/model/product_price.rb,
lib/cashbox/model/payment_method.rb,
lib/cashbox/model/transaction_item.rb,
lib/cashbox/model/subscription_item.rb,
lib/cashbox/model/transaction_status.rb,
lib/cashbox/model/billing_plan_period.rb,
lib/cashbox/model/product_description.rb,
lib/cashbox/model/transaction_status_pay_pal.rb

Defined Under Namespace

Modules: Concern, Rest, Type Classes: Account, Address, BillingPlan, BillingPlanPeriod, CreditCard, Description, DirectDebit, Entitlement, Error, Invoice, InvoiceItem, Metadata, Model, PayPal, PaymentMethod, Period, Price, Product, ProductDescription, ProductPrice, Refund, Request, Subscription, SubscriptionItem, Transaction, TransactionItem, TransactionStatus, TransactionStatusPayPal

Constant Summary collapse

VERSION =
"0.0.42"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/cashbox.rb', line 9

def password
  @password
end

.usernameObject

Returns the value of attribute username.



9
10
11
# File 'lib/cashbox.rb', line 9

def username
  @username
end

Class Method Details

.config(hash = {}) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/cashbox.rb', line 11

def config(hash = {})
  if block_given?
    yield(self)
  else
    hash.each { |k, v| self.send("#{k}=", v) }
  end
end

.debug!Object



39
40
41
# File 'lib/cashbox.rb', line 39

def self.debug!
  Cashbox::Request.debug_output $stdout
end

.development!Object



29
30
31
# File 'lib/cashbox.rb', line 29

def self.development!
  Cashbox::Request.base_uri('https://api.prodtest.vindicia.com')
end

.production!Object



21
22
23
# File 'lib/cashbox.rb', line 21

def self.production!
  Cashbox::Request.base_uri('https://api.vindicia.com')
end

.sandbox!Object



25
26
27
# File 'lib/cashbox.rb', line 25

def self.sandbox!
  Cashbox::Request.base_uri('https://api.prodtest.vindicia.com')
end

.test!Object



33
34
35
36
37
# File 'lib/cashbox.rb', line 33

def self.test!
  Cashbox.username = 'username'
  Cashbox.password = 'password'
  Cashbox::Request.base_uri('http://example.com')
end