Class: ActiveMerchant::Billing::UsaEpayGateway

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

Constant Summary collapse

GATEWAY_URL =
'https://www.usaepay.com/gate.php'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Gateway

gateway, supports?, #test?

Methods included from RequiresParameters

#requires!

Methods included from PostsData

#included?, #ssl_post

Constructor Details

#initialize(options = {}) ⇒ UsaEpayGateway

Returns a new instance of UsaEpayGateway.



11
12
13
14
15
# File 'lib/active_merchant/billing/gateways/usa_epay.rb', line 11

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/active_merchant/billing/gateways/usa_epay.rb', line 9

def options
  @options
end

#responseObject (readonly)

Returns the value of attribute response.



8
9
10
# File 'lib/active_merchant/billing/gateways/usa_epay.rb', line 8

def response
  @response
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/active_merchant/billing/gateways/usa_epay.rb', line 7

def url
  @url
end

Class Method Details

.supported_cardtypesObject



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

def self.supported_cardtypes
  [:visa, :master, :american_express]
end

Instance Method Details

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



17
18
19
20
21
22
23
24
25
# File 'lib/active_merchant/billing/gateways/usa_epay.rb', line 17

def authorize(money, creditcard, options = {})
  post = {}
  add_invoice(post, options)
  add_creditcard(post, creditcard)        
  add_address(post, creditcard, options)        
  add_customer_data(post, options)
  
  commit('authonly', money, post)
end

#capture(money, authorization, options = {}) ⇒ Object



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

def capture(money, authorization, options = {})
  post = {:refNum => authorization}
  commit('capture', money, post)
end

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



27
28
29
30
31
32
33
34
35
# File 'lib/active_merchant/billing/gateways/usa_epay.rb', line 27

def purchase(money, creditcard, options = {})
  post = {}
  add_invoice(post, options)
  add_creditcard(post, creditcard)        
  add_address(post, creditcard, options)   
  add_customer_data(post, options)
       
  commit('sale', money, post)
end