Permalink
Browse files

WorldPay: Update endpoint URLs for offsite gateway.

  • Loading branch information...
1 parent 6553a15 commit 2989dbb6d8c7bbd6c54a35cf4a52f1834aa63318 @Soleone Soleone committed Jun 6, 2011
@@ -6,23 +6,12 @@ module Billing #:nodoc:
module Integrations #:nodoc:
module WorldPay
+ # production and test have the same endpoint
mattr_accessor :production_url
- self.production_url = 'https://select.worldpay.com/wcc/purchase'
-
- mattr_accessor :test_url
- self.test_url = 'https://select-test.worldpay.com/wcc/purchase'
-
-
+ self.production_url = 'https://secure.wp3.rbsworldpay.com/wcc/purchase'
+
def self.service_url
- mode = ActiveMerchant::Billing::Base.integration_mode
- case mode
- when :production
- production_url
- when :test
- test_url
- else
- raise StandardError, "Integration mode set to an invalid value: #{mode}"
- end
+ production_url
end
def self.notification(post, options = {})
@@ -4,7 +4,7 @@ class RemoteWorldpayTest < Test::Unit::TestCase
def setup
- @gateway = WorldpayGateway.new(fixtures(:worldpay_gateway))
+ @gateway = WorldpayGateway.new(fixtures(:world_pay_gateway))
@amount = 100
@credit_card = credit_card('4111111111111111')
@@ -8,21 +8,14 @@ def setup
end
def test_service_url_in_test_mode
- assert_equal 'https://select-test.worldpay.com/wcc/purchase', WorldPay.service_url
+ assert_equal 'https://secure.wp3.rbsworldpay.com/wcc/purchase', WorldPay.service_url
end
def test_service_url_in_production_mode
ActiveMerchant::Billing::Base.integration_mode = :production
- assert_equal 'https://select.worldpay.com/wcc/purchase', WorldPay.service_url
+ assert_equal 'https://secure.wp3.rbsworldpay.com/wcc/purchase', WorldPay.service_url
end
-
- def test_service_url_in_unknown_mode
- ActiveMerchant::Billing::Base.integration_mode = :invalid_mode
- assert_raises StandardError do
- WorldPay.service_url
- end
- end
-
+
def test_notification_method
assert_instance_of WorldPay::Notification, WorldPay.notification('name=Andrew White', {})
end

0 comments on commit 2989dbb

Please sign in to comment.