Class: PayLane::RecurringPayment

Inherits:
Object
  • Object
show all
Defined in:
lib/paylane/recurring_payment.rb

Instance Method Summary collapse

Constructor Details

#initialize(previous_sale_id, options = {}) ⇒ RecurringPayment

Returns a new instance of RecurringPayment.



3
4
5
6
7
8
9
# File 'lib/paylane/recurring_payment.rb', line 3

def initialize(previous_sale_id, options = {})
  gateway = Gateway.new(PayLane., PayLane.password)
  @api = API.new(gateway.connect)
  @previous_sale_id = previous_sale_id
  @options = options
  @product = Product.new @options[:product]
end

Instance Method Details

#charge_card(amount) ⇒ Object



11
12
13
14
15
16
# File 'lib/paylane/recurring_payment.rb', line 11

def charge_card(amount)
  @amount = amount
  response = @api.resale(params)
  PayLane.logger.info("[PayLane] #{response}")
  response
end