Class: Exchequer::Biller

Inherits:
Object
  • Object
show all
Defined in:
lib/exchequer/biller.rb

Instance Method Summary collapse

Constructor Details

#initialize(card, options = {}) ⇒ Biller

Returns a new instance of Biller.



2
3
4
5
# File 'lib/exchequer/biller.rb', line 2

def initialize(card, options = {})
  @card    = card
  @options = options
end

Instance Method Details

#chargeObject



7
8
9
10
11
12
# File 'lib/exchequer/biller.rb', line 7

def charge
  map_errors_from(customer)     and return false if customer.id.nil?
  map_errors_from(subscription) and return false if !subscription.save

  true
end

#subscription_idObject



14
15
16
# File 'lib/exchequer/biller.rb', line 14

def subscription_id
  subscription.id
end