From 2989dbb6d8c7bbd6c54a35cf4a52f1834aa63318 Mon Sep 17 00:00:00 2001 From: Dennis Theisen Date: Mon, 6 Jun 2011 10:36:50 -0400 Subject: [PATCH] WorldPay: Update endpoint URLs for offsite gateway. --- .../billing/integrations/world_pay.rb | 19 ++++--------------- test/remote/gateways/remote_worldpay_test.rb | 2 +- .../integrations/world_pay_module_test.rb | 13 +++---------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/lib/active_merchant/billing/integrations/world_pay.rb b/lib/active_merchant/billing/integrations/world_pay.rb index c0b219e0d2e..8b5abc26674 100644 --- a/lib/active_merchant/billing/integrations/world_pay.rb +++ b/lib/active_merchant/billing/integrations/world_pay.rb @@ -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 = {}) diff --git a/test/remote/gateways/remote_worldpay_test.rb b/test/remote/gateways/remote_worldpay_test.rb index 0f23c67bc9c..579553458fd 100644 --- a/test/remote/gateways/remote_worldpay_test.rb +++ b/test/remote/gateways/remote_worldpay_test.rb @@ -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') diff --git a/test/unit/integrations/world_pay_module_test.rb b/test/unit/integrations/world_pay_module_test.rb index fc9374e18e9..fc4a45738ce 100644 --- a/test/unit/integrations/world_pay_module_test.rb +++ b/test/unit/integrations/world_pay_module_test.rb @@ -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