Class ActiveMerchant::Billing::NetRegistryGateway
In: lib/active_merchant/billing/gateways/net_registry.rb
Parent: Gateway

Gateway for netregistry.com.au.

Note that NetRegistry itself uses gateway service providers. At the time of this writing, there are at least two (Quest and Ingenico). This module has only been tested with Quest.

Also note that NetRegistry does not offer a test mode, nor does it have support for the authorize/capture/void functionality by default (you may arrange for this as described in "Programming for NetRegistry‘s E-commerce Gateway." [rubyurl.com/hNG]), and no void functionality is documented. As a result, the authorize and capture have not yet been tested through a live gateway, and void will raise an error.

If you have this functionality enabled, please consider contributing to ActiveMerchant by writing tests/code for these methods, and submitting a patch.

In addition to the standard ActiveMerchant functionality, the response will contain a ‘receipt’ parameter (response.params[‘receipt’]) if a receipt was issued by the gateway.

Methods

authorize   capture   credit   new   purchase   status  

Constants

URL = 'https://4tknox.au.com/cgi-bin/themerchant.au.com/ecom/external2.pl'
FILTERED_PARAMS = [ 'card_no', 'card_expiry', 'receipt_array' ]
TRANSACTIONS = { :authorization => 'preauth', :purchase => 'purchase', :capture => 'completion', :status => 'status', :credit => 'refund'

Public Class methods

Create a new NetRegistry gateway.

Options :login and :password must be given.

[Source]

    # File lib/active_merchant/billing/gateways/net_registry.rb, line 50
50:       def initialize(options = {})
51:         requires!(options, :login, :password)
52:         @options = options
53:         super
54:       end

Public Instance methods

Note that authorize and capture only work if your account vendor is St George, and if your account has been setup as described in "Programming for NetRegistry‘s E-commerce Gateway." [rubyurl.com/hNG]

[Source]

    # File lib/active_merchant/billing/gateways/net_registry.rb, line 60
60:       def authorize(money, credit_card, options = {})
61:         params = {
62:           'AMOUNT'  => amount(money),
63:           'CCNUM'   => credit_card.number,
64:           'CCEXP'   => expiry(credit_card)
65:         }
66:         add_request_details(params, options)
67:         commit(:authorization, params)
68:       end

Note that authorize and capture only work if your account vendor is St George, and if your account has been setup as described in "Programming for NetRegistry‘s E-commerce Gateway." [rubyurl.com/hNG]

[Source]

    # File lib/active_merchant/billing/gateways/net_registry.rb, line 74
74:       def capture(money, authorization, options = {})
75:         requires!(options, :credit_card)
76:         credit_card = options[:credit_card]
77: 
78:         params = {
79:           'PREAUTHNUM' => authorization,
80:           'AMOUNT'     => amount(money),
81:           'CCNUM'      => credit_card.number,
82:           'CCEXP'      => expiry(credit_card)
83:         }
84:         add_request_details(params, options)
85:         commit(:capture, params)
86:       end

[Source]

     # File lib/active_merchant/billing/gateways/net_registry.rb, line 98
 98:       def credit(money, identification, options = {})
 99:         params = {
100:           'AMOUNT'  => amount(money),
101:           'TXNREF'  => identification
102:         }
103:         add_request_details(params, options)
104:         commit(:credit, params)
105:       end

[Source]

    # File lib/active_merchant/billing/gateways/net_registry.rb, line 88
88:       def purchase(money, credit_card, options = {})
89:         params = {
90:           'AMOUNT'  => amount(money),
91:           'CCNUM'   => credit_card.number,
92:           'CCEXP'   => expiry(credit_card)
93:         }
94:         add_request_details(params, options)
95:         commit(:purchase, params)
96:       end

Specific to NetRegistry.

Run a ‘status’ command. This lets you view the status of a completed transaction.

[Source]

     # File lib/active_merchant/billing/gateways/net_registry.rb, line 112
112:       def status(identification)
113:         params = {
114:           'TXNREF'  => identification
115:         }
116:         
117:         commit(:status, params)
118:       end

[Validate]