Class: ActiveMerchant::Billing::ConveniencePayGateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/gateways/convenience_pay.rb

Overview

See the remote test file for example usage.

  • All transactions use dollar values.

Constant Summary collapse

TEST_URL =
'https://mo.paybill.com/WebServices/v3.6/PaybillService36.asmx'
LIVE_URL =
'https://www.paybill.com/WebServices/v3.6/PaybillService36.asmx'

Constants inherited from Gateway

Gateway::DEBIT_CARDS

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods inherited from Gateway

#card_brand, card_brand, inherited, supports?

Methods included from Utils

generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

included, #ssl_get, #ssl_post

Constructor Details

#initialize(options = {}) ⇒ ConveniencePayGateway

These are the options that can be used when creating a new Convenience Pay Gateway object.

:login => your username

:password => your password

:test => true sets the gateway to test mode



25
26
27
28
29
# File 'lib/active_merchant/billing/gateways/convenience_pay.rb', line 25

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

Instance Method Details

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



36
37
38
39
40
# File 'lib/active_merchant/billing/gateways/convenience_pay.rb', line 36

def purchase(money, creditcard, options = {})
  requires!(options, :order_id)
  setup_address_hash(options)
  commit('AuthorizeCreditCard', build_purchase_request(money, creditcard, options), options)
end

#test?Boolean

Should run against the test servers or not?

Returns:

  • (Boolean)


32
33
34
# File 'lib/active_merchant/billing/gateways/convenience_pay.rb', line 32

def test?
  @options[:test] || Base.gateway_mode == :test
end

#void(identification, options = {}) ⇒ Object



42
43
44
# File 'lib/active_merchant/billing/gateways/convenience_pay.rb', line 42

def void(identification, options = {})
  commit('VoidPayment', build_void_request(identification, options), options)
end