Class: ActiveMerchant::Billing::NetRegistryGateway
- Defined in:
- lib/active_merchant/billing/gateways/net_registry.rb
Overview
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) if a receipt was issued by the gateway.
Constant Summary collapse
- FILTERED_PARAMS =
%w[card_no card_expiry receipt_array]
- TRANSACTIONS =
{ authorization: 'preauth', purchase: 'purchase', capture: 'completion', status: 'status', refund: 'refund' }
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#authorize(money, credit_card, options = {}) ⇒ Object
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].
-
#capture(money, authorization, options = {}) ⇒ Object
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].
- #credit(money, identification, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ NetRegistryGateway
constructor
Create a new NetRegistry gateway.
- #purchase(money, credit_card, options = {}) ⇒ Object
- #refund(money, identification, options = {}) ⇒ Object
-
#status(identification) ⇒ Object
Specific to NetRegistry.
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #scrub, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ NetRegistryGateway
Create a new NetRegistry gateway.
Options :login and :password must be given.
50 51 52 53 |
# File 'lib/active_merchant/billing/gateways/net_registry.rb', line 50 def initialize( = {}) requires!(, :login, :password) super end |
Instance Method Details
#authorize(money, credit_card, options = {}) ⇒ Object
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]
59 60 61 62 63 64 65 66 67 |
# File 'lib/active_merchant/billing/gateways/net_registry.rb', line 59 def (money, credit_card, = {}) params = { 'AMOUNT' => amount(money), 'CCNUM' => credit_card.number, 'CCEXP' => expiry(credit_card) } add_request_details(params, ) commit(:authorization, params) end |
#capture(money, authorization, options = {}) ⇒ Object
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]
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/active_merchant/billing/gateways/net_registry.rb', line 73 def capture(money, , = {}) requires!(, :credit_card) credit_card = [:credit_card] params = { 'PREAUTHNUM' => , 'AMOUNT' => amount(money), 'CCNUM' => credit_card.number, 'CCEXP' => expiry(credit_card) } add_request_details(params, ) commit(:capture, params) end |
#credit(money, identification, options = {}) ⇒ Object
106 107 108 109 |
# File 'lib/active_merchant/billing/gateways/net_registry.rb', line 106 def credit(money, identification, = {}) ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE refund(money, identification, ) end |
#purchase(money, credit_card, options = {}) ⇒ Object
87 88 89 90 91 92 93 94 95 |
# File 'lib/active_merchant/billing/gateways/net_registry.rb', line 87 def purchase(money, credit_card, = {}) params = { 'AMOUNT' => amount(money), 'CCNUM' => credit_card.number, 'CCEXP' => expiry(credit_card) } add_request_details(params, ) commit(:purchase, params) end |
#refund(money, identification, options = {}) ⇒ Object
97 98 99 100 101 102 103 104 |
# File 'lib/active_merchant/billing/gateways/net_registry.rb', line 97 def refund(money, identification, = {}) params = { 'AMOUNT' => amount(money), 'TXNREF' => identification } add_request_details(params, ) commit(:refund, params) end |
#status(identification) ⇒ Object
Specific to NetRegistry.
Run a ‘status’ command. This lets you view the status of a completed transaction.
116 117 118 119 120 121 122 |
# File 'lib/active_merchant/billing/gateways/net_registry.rb', line 116 def status(identification) params = { 'TXNREF' => identification } commit(:status, params) end |