Added backwards-compatible support for exp_date
[Business-OnlinePayment-InternetSecure.git] / InternetSecure.pm
index c41e3ce..65847f1 100755 (executable)
@@ -135,6 +135,12 @@ sub to_xml {
 
        my %content = $self->content;
 
+       # 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}"