Class: ActiveMerchant::Billing::PacNetRavenGateway

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

Constant Summary

Constants inherited from Gateway

Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, 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?, #test?

Methods included from CreditCardFormatting

#format

Constructor Details

#initialize(options = {}) ⇒ PacNetRavenGateway

Returns a new instance of PacNetRavenGateway.



14
15
16
17
# File 'lib/active_merchant/billing/gateways/pac_net_raven.rb', line 14

def initialize(options = {})
  requires!(options, :user, :secret, :prn)
  super
end

Instance Method Details

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



19
20
21
22
23
24
25
26
27
# File 'lib/active_merchant/billing/gateways/pac_net_raven.rb', line 19

def authorize(money, creditcard, options = {})
  post = {}
  add_creditcard(post, creditcard)
  add_currency_code(post, money, options)
  add_address(post, options)
  post['PRN'] = @options[:prn]

  commit('cc_preauth', money, post)
end

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



47
48
49
50
51
52
53
54
# File 'lib/active_merchant/billing/gateways/pac_net_raven.rb', line 47

def capture(money, authorization, options = {})
  post = {}
  post['PreauthNumber'] = authorization
  post['PRN'] = @options[:prn]
  add_currency_code(post, money, options)

  commit('cc_settle', money, post)
end

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



29
30
31
32
33
34
35
36
37
# File 'lib/active_merchant/billing/gateways/pac_net_raven.rb', line 29

def purchase(money, creditcard, options = {})
  post = {}
  add_currency_code(post, money, options)
  add_creditcard(post, creditcard)
  add_address(post, options)
  post['PRN'] = @options[:prn]

  commit('cc_debit', money, post)
end

#refund(money, template_number, options = {}) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/active_merchant/billing/gateways/pac_net_raven.rb', line 56

def refund(money, template_number, options = {})
  post = {}
  post['PRN'] = @options[:prn]
  post['TemplateNumber'] = template_number
  add_currency_code(post, money, options)

  commit('cc_refund', money, post)
end

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



39
40
41
42
43
44
45
# File 'lib/active_merchant/billing/gateways/pac_net_raven.rb', line 39

def void(authorization, options = {})
  post = {}
  post['TrackingNumber'] = authorization
  post['PymtType'] = options[:pymt_type] || 'cc_debit'

  commit('void', nil, post)
end