Most of the payment gateways require both the first name and last name
provided separately. It is pretty hard to guess with a 3 part name
whether to select 2 names as the first name or 2 names for the last
name. The customer is more likely to be able to put the 2 names into
the correct box.
We've processed many thousands of transactions in Shopify using both
the first and last name and we haven't had any problems that I've
heard of yet.
There are some payment gateways that do take the full name of customer
in one field. In such cases we use the CreditCard#name method that
concatenates the name into a single string.
--
Cody Fauser
http://shopify.com - e-commerce done right
http://www.codyfauser.com - blog
http://peepcode.com/products/activemerchant-pdf - ActiveMerchant PeepCode
http://www.oreilly.com/catalog/rjsrails - RJS Templates for Rails
Using your own CreditCard subclass is a nice way to do this. See http://pastie.caboo.se/174477
for an example of what we're currently using.
Even though the separate first and last name doesn't seem to make
sense it is required by a lot of gateways including Authorize.net
Kind regards,
Thijs
--
Fingertips - http://www.fngtps.com
We could also add a name= method to the CreditCard class that splits
the single name into the first_name and last_name components, but also
stores the full name in case the gateway can use it.
def name=(value)
return if value.blank?
@name = value
segments = value.split(' ')
@last_name = segments.pop
@first_name = segments.join(' ')
end
def name
@name ||= "#{first_name} #{last_name}"
end
This way if the gateway supports a single name field and you've set
the name using name= then the entire name would be passed to the
gateway unaltered.
Comments?
--
I've done this very thing in a few projects.
----
Benjamin Curtis
http://railskits.com/ - Ready-made Rails code
http://catchthebest.com/ - Team-powered recruiting
http://www.bencurtis.com/ - Personal blog
--
Jonathan
--
> ----
> Benjamin Curtis
> http://railskits.com/ - Ready-made Rails code
> http://catchthebest.com/ - Team-powered recruiting
> http://www.bencurtis.com/ - Personal blog
>
>
>
> On May 14, 2008, at 3:30 AM, Cody Fauser wrote:
>>
>> Anyone want to whip up a patch?
>>
>>
>
>
>
>
--
----
Benjamin Curtis
http://railskits.com/ - Ready-made Rails code
http://catchthebest.com/ - Team-powered recruiting
http://www.bencurtis.com/ - Personal blog
On Thu, May 15, 2008 at 3:37 PM, Benjamin Curtis
<benjami...@gmail.com> wrote:
>
> Heh, we should definitely call her agent and ask how she orders stuff
> online. :)
>
> ----
> Benjamin Curtis
> http://railskits.com/ - Ready-made Rails code
> http://catchthebest.com/ - Team-powered recruiting
> http://www.bencurtis.com/ - Personal blog
>
>
>
> On May 15, 2008, at 12:13 PM, Cody Fauser wrote:
>>
>> Madonna ;)
>>
>> On Thu, May 15, 2008 at 12:41 PM, Benjamin Curtis
>> <benjami...@gmail.com> wrote:
>>> Is this too naïve? It will fail if someone has no space in the name
>>> on their card, but I don't know whether that happens.
>>>
>>>>
>
> >
>
--
first_name: "Mrs"
last_name: "Ritchie"
--
Damien McKenna - Husband, father, geek.
dam...@mc-kenna.com - http://www.mc-kenna.com/