Permalink
Browse files

Support live URL

  • Loading branch information...
exviva committed Oct 1, 2012
1 parent fb699f5 commit 14ba8f6e15ec811970f4eadc82ecd09b91ec2d9a
Showing with 9 additions and 1 deletion.
  1. +7 −1 lib/active_merchant/billing/clickand_buy_gateway.rb
  2. +2 −0 spec/spec_helper.rb
@@ -4,6 +4,12 @@
module ActiveMerchant
module Billing
class ClickandBuyGateway < Gateway
+ self.test_url = 'https://api.clickandbuy-s1.com/webservices/soap/pay_1_1_0'
+ self.live_url = 'https://api.clickandbuy.com/webservices/soap/pay_1_1_0'
+
+ self.homepage_url = 'http://www.clickandbuy.com'
+ self.display_name = 'ClickandBuy'
+
def initialize(auth)
requires!(auth, :project_id, :merchant_id, :secret_key)
@auth = auth
@@ -29,7 +35,7 @@ def headers
end
def endpoint_url
- 'https://api.clickandbuy-s1.com/webservices/soap/pay_1_1_0'
+ test? ? test_url : live_url
end
end
end
View
@@ -7,6 +7,8 @@
require 'money'
require 'active_support/core_ext/hash/except'
+ActiveMerchant::Billing::Base.mode = :test
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true

0 comments on commit 14ba8f6

Please sign in to comment.