lib/active_merchant/billing/gateways/nab_transact.rb in activemerchant-1.26.0 vs lib/active_merchant/billing/gateways/nab_transact.rb in activemerchant-1.27.0
- old
+ new
@@ -6,15 +6,17 @@
# be a rebadged Securepay Australia service, though some differences exist.
class NabTransactGateway < Gateway
API_VERSION = 'xml-4.2'
PERIODIC_API_VERSION = "spxml-4.2"
- TEST_URL = 'https://transact.nab.com.au/test/xmlapi/payment'
- LIVE_URL = 'https://transact.nab.com.au/live/xmlapi/payment'
- TEST_PERIODIC_URL = "https://transact.nab.com.au/xmlapidemo/periodic"
- LIVE_PERIODIC_URL = "https://transact.nab.com.au/xmlapi/periodic"
+ class_attribute :test_periodic_url, :live_periodic_url
+ self.test_url = 'https://transact.nab.com.au/test/xmlapi/payment'
+ self.live_url = 'https://transact.nab.com.au/live/xmlapi/payment'
+ self.test_periodic_url = 'https://transact.nab.com.au/xmlapidemo/periodic'
+ self.live_periodic_url = 'https://transact.nab.com.au/xmlapi/periodic'
+
self.supported_countries = ['AU']
# The card types supported by the payment gateway
# Note that support for Diners, Amex, and JCB require extra
# steps in setting up your account, as detailed in the NAB Transact API
@@ -190,19 +192,19 @@
xml.target!
end
def commit(action, request)
- response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, build_request(action, request)))
+ response = parse(ssl_post(test? ? self.test_url : self.live_url, build_request(action, request)))
Response.new(success?(response), message_from(response), response,
:test => test?,
:authorization => authorization_from(response)
)
end
def commit_periodic(request)
- response = parse(ssl_post(test? ? TEST_PERIODIC_URL : LIVE_PERIODIC_URL, build_periodic_request(request)))
+ response = parse(ssl_post(test? ? self.test_periodic_url : self.live_periodic_url, build_periodic_request(request)))
Response.new(success?(response), message_from(response), response,
:test => test?,
:authorization => authorization_from(response)
)
end