<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -77,7 +77,14 @@ module ActiveMerchant #:nodoc:
       def name
         &quot;#{@first_name} #{@last_name}&quot;
       end
-            
+      
+      def name=(string)
+        first_name_match = string.match(/^([a-zA-Z]*) /)
+        @first_name = first_name_match[1] if first_name_match
+        last_name_match = string.match(/^[a-zA-Z]* (.*)/)
+        @last_name = last_name_match[1] if last_name_match
+      end
+      
       def verification_value?
         !@verification_value.blank?
       end</diff>
      <filename>lib/active_merchant/billing/credit_card.rb</filename>
    </modified>
    <modified>
      <diff>@@ -257,7 +257,34 @@ class CreditCardTest &lt; Test::Unit::TestCase
     c = CreditCard.new(:first_name =&gt; 'James', :last_name =&gt; 'Herdman')
     assert c.name?
   end
-
+  
+  def test_should_work_with_a_single_name_attribute
+    c = CreditCard.new(:name =&gt; 'John Smith')
+    assert c.name?
+    assert_equal &quot;John&quot;, c.first_name
+    assert_equal &quot;Smith&quot;, c.last_name
+  end
+  
+  def test_should_work_with_a_single_name_attribute_that_is_double_barrelled
+    c = CreditCard.new(:name =&gt; 'John Hammer Smith')
+    assert c.name?
+    assert_equal &quot;John&quot;, c.first_name
+    assert_equal &quot;Hammer Smith&quot;, c.last_name
+  end
+  
+  def test_should_work_with_a_single_name_attribute_that_is_double_barrell_hyphenated
+    c = CreditCard.new(:name =&gt; 'John Hammer-Smith')
+    assert c.name?
+    assert_equal &quot;John&quot;, c.first_name
+    assert_equal &quot;Hammer-Smith&quot;, c.last_name
+  end
+  
+  def test_should_work_with_a_single_blank_name_attribute
+    c = CreditCard.new(:name =&gt; '')
+    assert_false c.first_name?
+    assert_false c.last_name?
+  end
+  
   # The following is a regression for a bug that raised an exception when
   # a new credit card was validated
   def test_validate_new_card</diff>
      <filename>test/unit/credit_card_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b8945dae1de380422b193a3886ef826243145df9</id>
    </parent>
  </parents>
  <author>
    <name>David Rice</name>
    <email>davidjrice@gmail.com</email>
  </author>
  <url>http://github.com/davidjrice/active_merchant/commit/ae7150a18d79c1ac18ada6e9f8530b252c20bcbc</url>
  <id>ae7150a18d79c1ac18ada6e9f8530b252c20bcbc</id>
  <committed-date>2009-08-27T05:34:58-07:00</committed-date>
  <authored-date>2009-08-27T05:34:58-07:00</authored-date>
  <message>Adding handling for a single :name attribute to be given to a credit card, it is then split into first name / last name via the magic of regex</message>
  <tree>730db680879be9075ccc438013e967480ec1eb32</tree>
  <committer>
    <name>David Rice</name>
    <email>davidjrice@gmail.com</email>
  </committer>
</commit>
