Class: PayLane::Payment

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Payment

Returns a new instance of Payment.



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

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

Instance Method Details

#charge_card(amount) ⇒ Object



10
11
12
# File 'lib/paylane/payment.rb', line 10

def charge_card(amount)
  do_payment(amount, {'card_data' => card_data})
end

#direct_debit(amount) ⇒ Object



14
15
16
# File 'lib/paylane/payment.rb', line 14

def direct_debit(amount)
  do_payment(amount, {'account_data' => })
end