Class: ActiveMerchant::Billing::PsigateGateway

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

Constant Summary collapse

TEST_URL =
'https://dev.psigate.com:7989/Messenger/XMLMessenger'
LIVE_URL =
'https://secure.psigate.com:7934/Messenger/XMLMessenger'
SUCCESS_MESSAGE =
'Success'
FAILURE_MESSAGE =
'The transaction was declined'

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 = {}) ⇒ PsigateGateway

Returns a new instance of PsigateGateway.



53
54
55
56
57
# File 'lib/active_merchant/billing/gateways/psigate.rb', line 53

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

Instance Method Details

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

Psigate PreAuth



60
61
62
63
64
# File 'lib/active_merchant/billing/gateways/psigate.rb', line 60

def authorize(money, creditcard, options = {})
  requires!(options, :order_id)                                                          
  options.update({ :CardAction => "1" })
  commit(money, creditcard, options)      
end

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

Psigate PostAuth



74
75
76
77
# File 'lib/active_merchant/billing/gateways/psigate.rb', line 74

def capture(money, authorization, options = {})
  options.update({ :CardAction => "2", :order_id => authorization })
  commit(money, nil, options)
end

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

Psigate Credit



81
82
83
84
# File 'lib/active_merchant/billing/gateways/psigate.rb', line 81

def credit(money, authorization, options = {})
  deprecated CREDIT_DEPRECATION_MESSAGE
  refund(money, authorization, options)
end

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

Psigate Sale



67
68
69
70
71
# File 'lib/active_merchant/billing/gateways/psigate.rb', line 67

def purchase(money, creditcard, options = {})
  requires!(options, :order_id)                                                          
  options.update({ :CardAction => "0" })
  commit(money, creditcard, options)     
end

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



86
87
88
89
# File 'lib/active_merchant/billing/gateways/psigate.rb', line 86

def refund(money, authorization, options = {})
  options.update({ :CardAction => "3", :order_id => authorization })
  commit(money, nil, options)
end