diff --git a/lib/twocheckout.rb b/lib/twocheckout.rb index a7ea2fe..e106665 100644 --- a/lib/twocheckout.rb +++ b/lib/twocheckout.rb @@ -1,13 +1,11 @@ -require "twocheckout/version" -require "twocheckout/api" -require "twocheckout/hash_object" -require "twocheckout/validate_response" -require "twocheckout/company" -require "twocheckout/lineitem" -require "twocheckout/invoice" -require "twocheckout/sale" -require "twocheckout/coupon" -require "twocheckout/product" -require "twocheckout/option" -require "twocheckout/checkout" -require "twocheckout/twocheckout_error" +require 'twocheckout/version' +require 'twocheckout/api' +require 'twocheckout/hash_object' +require 'twocheckout/validate_response' +require 'twocheckout/company' +require 'twocheckout/lineitem' +require 'twocheckout/invoice' +require 'twocheckout/sale' +require 'twocheckout/product' +require 'twocheckout/checkout' +require 'twocheckout/twocheckout_error' diff --git a/lib/twocheckout/api.rb b/lib/twocheckout/api.rb index 9b5fbc9..051ef65 100755 --- a/lib/twocheckout/api.rb +++ b/lib/twocheckout/api.rb @@ -3,16 +3,14 @@ module Twocheckout class API - PROD_BASE = 'https://www.2checkout.com' - SANDBOX_BASE = 'https://sandbox.2checkout.com' - API_VERSION = '1' + PROD_BASE = 'https://www.2checkout.com'.freeze + API_VERSION = '1'.freeze def self.credentials=(opts) @username = opts[:username] @password = opts[:password] @private_key = opts[:private_key] @seller_id = opts[:seller_id] - @sandbox = opts[:sandbox] end def self.request(http_method, api_call, params = nil) @@ -33,7 +31,7 @@ def self.request(http_method, api_call, params = nil) private def self.set_opts(http_method, api_call, params = null) - url = @sandbox ? SANDBOX_BASE : PROD_BASE + url = PROD_BASE if api_call == 'authService' url += '/checkout/api/' + API_VERSION + '/' + @seller_id + '/rs/' + api_call params['sellerId'] = @seller_id diff --git a/lib/twocheckout/checkout.rb b/lib/twocheckout/checkout.rb index 3f5421a..b2592d8 100755 --- a/lib/twocheckout/checkout.rb +++ b/lib/twocheckout/checkout.rb @@ -3,10 +3,6 @@ class Checkout < HashObject @checkout_url = 'https://www.2checkout.com/checkout/purchase' - def self.sandbox(sandbox) - @checkout_url = sandbox ? 'https://sandbox.2checkout.com/checkout/purchase' : @checkout_url; - end - def self.form(params={}, button_text='Proceed to Checkout') @form = "