public
Description: Active Merchant is a simple payment abstraction library used in and sponsored by Shopify. It is written by Tobias Luetke, Cody Fauser, and contributors. The aim of the project is to feel natural to Ruby users and to abstract as many parts as possible away from the user to offer a consistent interface across all supported gateways.
Homepage: http://activemerchant.org
Clone URL: git://github.com/Shopify/active_merchant.git
Added a separate test url for PayJunctionGateway.  Pay Junction started using a 
different url for test transactions in 09/2008 according to their API docs.  All 
remote tests for PayJunctionGateway pass again.
PJ Kelly (author)
Wed Nov 12 22:08:12 -0800 2008
commit  c3c6ea210aad32acf48a99984f26b92168781383
tree    5b6d0720c2e06e8b9f70cb5b38d41b6b6331593b
parent  9e7407deb7acf76c2252404b920dd7695b118167
...
98
99
100
101
102
 
 
 
 
 
 
103
104
105
...
318
319
320
321
 
 
 
322
323
324
...
98
99
100
 
 
101
102
103
104
105
106
107
108
109
...
322
323
324
 
325
326
327
328
329
330
0
@@ -98,8 +98,12 @@ module ActiveMerchant #:nodoc:
0
     # See #recurring for periodic transaction fields
0
     class PayJunctionGateway < Gateway
0
       API_VERSION   = '1.2'
0
-      URL      = 'https://payjunction.com/quick_link' # also handles test requests 
0
-      
0
+
0
+      class_inheritable_accessor :test_url, :live_url
0
+
0
+      self.test_url = "https://demo.payjunction.com/quick_link"
0
+      self.live_url = "https://payjunction.com/quick_link"
0
+
0
       TEST_LOGIN = 'pj-ql-01'
0
       TEST_PASSWORD = 'pj-ql-01p'
0
       
0
@@ -318,7 +322,9 @@ module ActiveMerchant #:nodoc:
0
       end
0
       
0
       def commit(action, parameters)
0
-        response = parse( ssl_post(URL, post_data(action, parameters)) )
0
+        url = test? ? self.test_url : self.live_url
0
+
0
+        response = parse( ssl_post(url, post_data(action, parameters)) )
0
         
0
         Response.new(successful?(response), message_from(response), response, 
0
           :test => test?, 

Comments