From e073ba9f3ec63298790683c9e0b8b20b8cd40417 Mon Sep 17 00:00:00 2001 From: fbriere Date: Fri, 17 Feb 2006 23:38:35 +0000 Subject: [PATCH] Remove dashes from card_number as well --- InternetSecure.pm | 4 ++-- t/20emit.t | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/InternetSecure.pm b/InternetSecure.pm index 13e1858..e3a21e5 100755 --- a/InternetSecure.pm +++ b/InternetSecure.pm @@ -169,7 +169,7 @@ sub to_xml { $data{MerchantNumber} = $self->merchant_id; - $data{xxxCard_Number} =~ tr/ //d; + $data{xxxCard_Number} =~ tr/- //d; $data{xxxCard_Number} =~ s/^[^3-6]/4/ if $self->test_transaction; my ($y, $m) = $self->parse_expdate($content{exp_date}); @@ -397,7 +397,7 @@ Transaction type, being one of the following: =item card_number (required) -Credit card number. Spaces are allowed, and will be automatically removed. +Credit card number. Spaces and dashes are automatically removed. =item exp_date (required) diff --git a/t/20emit.t b/t/20emit.t index aa9af6a..62baea7 100755 --- a/t/20emit.t +++ b/t/20emit.t @@ -16,7 +16,7 @@ use constant TRANSACTIONS => ( action => 'Normal Authorization', type => 'Visa', - card_number => '0000000000000000', + card_number => '4111 1111 1111 1111', exp_date => '2004-07', cvv2 => '000', @@ -57,8 +57,8 @@ use constant TRANSACTIONS => ( action => 'Normal Authorization', - type => 'Visa', - card_number => '4000000000000000', + type => 'MasterCard', + card_number => '5111-1111-1111-1111', exp_date => '7/2004', name => "Fr\x{e9}d\x{e9}ric Bri\x{e8}re", @@ -94,7 +94,7 @@ __DATA__ 0000 - 0000000000000000 + 4111111111111111 07 2004 1 @@ -123,7 +123,7 @@ __DATA__ 0000 - 4000000000000000 + 5111111111111111 07 2004 0 -- 2.11.0