X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=InternetSecure.pm;h=65847f1aed8cc70bd5c7009aa202f4f129a602ab;hb=e97a2d3512479f30718872b70196a2be18ec2b2e;hp=76ae5a2fc0dfdd182aa98efc87ddcf2e96eafe7b;hpb=0e8df6b61bc37a97b87bc0c95ba818495b3b5d00;p=Business-OnlinePayment-InternetSecure.git diff --git a/InternetSecure.pm b/InternetSecure.pm index 76ae5a2..65847f1 100755 --- a/InternetSecure.pm +++ b/InternetSecure.pm @@ -12,7 +12,7 @@ use XML::Simple qw(xml_in xml_out); use base qw(Business::OnlinePayment Exporter); -our $VERSION = '0.02'; +our $VERSION = '0.03'; use constant SUCCESS_CODES => qw(2000 90000 900P1); @@ -135,7 +135,13 @@ sub to_xml { my %content = $self->content; - $self->required_fields(qw(action card_number exp_date)); + # Backwards-compatible support for exp_date + if (exists $content{exp_date} && ! exists $content{expiration}) { + $content{expiration} = delete $content{exp_date}; + $self->content(%content); + } + + $self->required_fields(qw(action card_number expiration)); croak "Unsupported transaction type: $content{type}" if $content{type} && @@ -178,7 +184,7 @@ sub to_xml { $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}); + my ($y, $m) = $self->parse_expdate($content{expiration}); $data{xxxCCYear} = sprintf '%.4u' => $y; $data{xxxCCMonth} = sprintf '%.2u' => $m; @@ -347,7 +353,7 @@ Business::OnlinePayment::InternetSecure - InternetSecure backend for Business::O type => 'Visa', # Optional card_number => '4111 1111 1111 1111', - exp_date => '2004-07', + expiration => '2004-07', cvv2 => '000', # Optional name => "Fr\x{e9}d\x{e9}ric Bri\x{e8}re", @@ -431,7 +437,7 @@ Transaction type, being one of the following: Credit card number. Spaces and dashes are automatically removed. -=item exp_date (required) +=item expiration (required) Credit card expiration date. Since C does not specify any syntax, this module is rather lax regarding what it will accept. The