Class: ActiveMerchant::Billing::BpointGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/activemerchant/billing/gateways/bpoint.rb

Constant Summary collapse

LIVE_URL =
'https://www.bpoint.com.au/evolve/service.asmx'

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ BpointGateway

Returns a new instance of BpointGateway.



13
14
15
16
17
# File 'lib/activemerchant/billing/gateways/bpoint.rb', line 13

def initialize(options = {})
  requires!(options, :login, :password, :merchant_number)
  @options = options
  super
end

Instance Method Details

#purchase(money, creditcard, options = {}) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/activemerchant/billing/gateways/bpoint.rb', line 19

def purchase(money, creditcard, options = {})
  post = {}
  add_invoice(post, options)
  add_creditcard(post, creditcard, options)

  commit('ProcessPayment', money, post)
end

#store(credit_card, options = {}) ⇒ Object



27
28
29
30
31
32
# File 'lib/activemerchant/billing/gateways/bpoint.rb', line 27

def store(credit_card, options = {})
  post = {}
  add_creditcard(post, credit_card, options)

  commit('AddToken', nil, post)
end

#test?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/activemerchant/billing/gateways/bpoint.rb', line 40

def test?
  @options[:test] || super
end

#unstore(token, options = {}) ⇒ Object



34
35
36
37
38
# File 'lib/activemerchant/billing/gateways/bpoint.rb', line 34

def unstore(token, options = {})
  post = { :token => token }

  commit('DeleteToken', nil, post)
end