<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,6 @@
 = ActiveMerchant CHANGELOG
 
+* Update gateway templates [cody]
 * Fix Authorize.net test where authorize() was being called instead of purchase(). Perform some cleanup of the tests [ianlotin...@hotmail.com, cody]
 * Improve Authorize.net documentation based on the DataCashGateway docs [patrick.t.joyce]
 * Update EfsnetGateway to support avs and cvv data. Remove test_result_from_cc_number. [cody]</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -46,10 +46,6 @@ module ActiveMerchant #:nodoc:
         commit('capture', money, post)
       end
     
-      def self.supported_cardtypes
-        [:visa, :master, :american_express]
-      end
-         
       private                       
       
       def add_customer_data(post, options)</diff>
      <filename>generators/gateway/templates/gateway.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,44 +1,49 @@
 require File.dirname(__FILE__) + '/../../test_helper'
 
 class &lt;%= class_name %&gt;Test &lt; Test::Unit::TestCase
-  AMOUNT = 100
-
   def setup
     @gateway = &lt;%= class_name %&gt;Gateway.new(
                  :login =&gt; 'login',
                  :password =&gt; 'password'
                )
 
-    @creditcard = credit_card('4242424242424242')
-
-    @address = { :address1 =&gt; '1234 My Street',
-                 :address2 =&gt; 'Apt 1',
-                 :company =&gt; 'Widgets Inc',
-                 :city =&gt; 'Ottawa',
-                 :state =&gt; 'ON',
-                 :zip =&gt; 'K1C2N6',
-                 :country =&gt; 'Canada',
-                 :phone =&gt; '(555)555-5555'
-               }
+    @credit_card = credit_card
+    @amount = 100
+    
+    @options = { 
+      :order_id =&gt; '1',
+      :billing_address =&gt; address,
+      :description =&gt; 'Store Purchase'
+    }
   end
   
-  def test_successful_request
-    @creditcard.number = 1
-    assert response = @gateway.purchase(AMOUNT, @creditcard, {})
+  def test_successful_purchase
+    @gateway.expects(:ssl_post).returns(successful_purchase_response)
+    
+    assert response = @gateway.purchase(@amount, @credit_card, @options)
+    assert_instance_of 
     assert_success response
-    assert_equal '5555', response.authorization
+    
+    # Replace with authorization number from the successful response
+    assert_equal '', response.authorization
     assert response.test?
   end
 
   def test_unsuccessful_request
-    @creditcard.number = 2
-    assert response = @gateway.purchase(AMOUNT, @creditcard, {})
+    @gateway.expects(:ssl_post).returns(failed_purchase_response)
+    
+    assert response = @gateway.purchase(@amount, @credit_card, @options)
     assert_failure response
     assert response.test?
   end
 
-  def test_request_error
-    @creditcard.number = 3
-    assert_raise(Error){ @gateway.purchase(AMOUNT, @creditcard, {}) }
+  private
+  
+  # Place raw successful response from gateway here
+  def successful_purchase_response
+  end
+  
+  # Place raw failed response from gateway here
+  def failed_purcahse_response
   end
 end</diff>
      <filename>generators/gateway/templates/gateway_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,36 +1,37 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
 class Remote&lt;%= class_name %&gt;Test &lt; Test::Unit::TestCase
-  AMOUNT = 100
+  
 
   def setup
     @gateway = &lt;%= class_name %&gt;Gateway.new(fixtures(:&lt;%= class_name.underscore %&gt;))
-
-    @creditcard = credit_card('4000100011112224')
-
+    
+    @amount = 100
+    @credit_card = credit_card('4000100011112224')
     @declined_card = credit_card('4000300011112220')
-
-    @options = { :address =&gt; { :address1 =&gt; '1234 Shady Brook Lane',
-                              :zip =&gt; '90210'
-                             }
-               }
+    
+    @options = { 
+      :order_id =&gt; '1',
+      :billing_address =&gt; address,
+      :description =&gt; 'Store Purchase'
+    }
   end
   
   def test_successful_purchase
-    assert response = @gateway.purchase(AMOUNT, @creditcard, @options)
-    assert_equal 'REPLACE WITH SUCCESS MESSAGE', response.message
+    assert response = @gateway.purchase(@amount, @credit_card, @options)
     assert_success response
+    assert_equal 'REPLACE WITH SUCCESS MESSAGE', response.message
   end
 
   def test_unsuccessful_purchase
-    assert response = @gateway.purchase(AMOUNT, @declined_card, @options)
-    assert_equal 'REPLACE WITH FAILED PURCHASE MESSAGE', response.message
+    assert response = @gateway.purchase(@amount, @declined_card, @options)
     assert_failure response
+    assert_equal 'REPLACE WITH FAILED PURCHASE MESSAGE', response.message
   end
 
   def test_authorize_and_capture
-    amount = AMOUNT
-    assert auth = @gateway.authorize(amount, @creditcard, @options)
+    amount = @amount
+    assert auth = @gateway.authorize(amount, @credit_card, @options)
     assert_success auth
     assert_equal 'Success', auth.message
     assert auth.authorization
@@ -39,18 +40,18 @@ class Remote&lt;%= class_name %&gt;Test &lt; Test::Unit::TestCase
   end
 
   def test_failed_capture
-    assert response = @gateway.capture(AMOUNT, '')
+    assert response = @gateway.capture(@amount, '')
     assert_failure response
     assert_equal 'REPLACE WITH GATEWAY FAILURE MESSAGE', response.message
   end
 
   def test_invalid_login
-    gateway = &lt;%= class_name %&gt;Gateway.new({
-        :login =&gt; '',
-        :password =&gt; ''
-      })
-    assert response = gateway.purchase(AMOUNT, @creditcard, @options)
-    assert_equal 'REPLACE WITH FAILURE MESSAGE', response.message
+    gateway = &lt;%= class_name %&gt;Gateway.new(
+                :login =&gt; '',
+                :password =&gt; ''
+              )
+    assert response = gateway.purchase(@amount, @credit_card, @options)
     assert_failure response
+    assert_equal 'REPLACE WITH FAILURE MESSAGE', response.message
   end
 end</diff>
      <filename>generators/gateway/templates/remote_gateway_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -126,9 +126,9 @@ module Test
         md5.hexdigest
       end
       
-      def credit_card(number = nil, options = {})
+      def credit_card(number = '4242424242424242', options = {})
         defaults = {
-          :number =&gt; (number || '4242424242424242'),
+          :number =&gt; number,
           :month =&gt; 9,
           :year =&gt; Time.now.year + 1,
           :first_name =&gt; 'Longbob',</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f410edc61cc5466459c2862697b5c13513254017</id>
    </parent>
  </parents>
  <author>
    <name>codyfauser</name>
    <email>codyfauser@6513ea26-6c20-0410-8a68-89cd7235086d</email>
  </author>
  <url>http://github.com/BDQ/active_merchant/commit/7098f41a9b9d6f0680e208c3c72fe5b03f30fc05</url>
  <id>7098f41a9b9d6f0680e208c3c72fe5b03f30fc05</id>
  <committed-date>2008-01-18T13:46:11-08:00</committed-date>
  <authored-date>2008-01-18T13:46:11-08:00</authored-date>
  <message>Update gateway templates

git-svn-id: https://activemerchant.googlecode.com/svn/trunk/active_merchant@561 6513ea26-6c20-0410-8a68-89cd7235086d</message>
  <tree>9653c444d9f6bb80c3e616afeb6b0b99934d01bb</tree>
  <committer>
    <name>codyfauser</name>
    <email>codyfauser@6513ea26-6c20-0410-8a68-89cd7235086d</email>
  </committer>
</commit>
