lib/active_merchant/billing/gateways/swipe_checkout.rb in activemerchant-1.85.0 vs lib/active_merchant/billing/gateways/swipe_checkout.rb in activemerchant-1.86.0
- old
+ new
@@ -4,14 +4,11 @@
module Billing #:nodoc:
class SwipeCheckoutGateway < Gateway
TRANSACTION_APPROVED_MSG = 'Transaction approved'
TRANSACTION_DECLINED_MSG = 'Transaction declined'
- LIVE_URLS = {
- 'NZ' => 'https://api.swipehq.com',
- 'CA' => 'https://api.swipehq.ca'
- }
+ self.live_url = 'https://api.swipehq.com'
self.test_url = 'https://api.swipehq.com'
TRANSACTION_API = '/createShopifyTransaction.php'
self.supported_countries = %w[ NZ CA ]
@@ -133,15 +130,15 @@
params[:merchant_id] = @options[:login]
params[:api_key] = @options[:api_key]
# ssl_post() returns the response body as a string on success,
# or raises a ResponseError exception on failure
- JSON.parse(ssl_post(url(@options[:region], api), params.to_query))
+ JSON.parse(ssl_post(url(api), params.to_query))
end
- def url(region, api)
- ((test? ? self.test_url : LIVE_URLS[region]) + api)
+ def url(api)
+ (test? ? self.test_url : self.live_url) + api
end
def build_error_response(message, params={})
Response.new(
false,
@@ -151,6 +148,5 @@
)
end
end
end
end
-