- my $cardtype;
- if ( $options{method} && $options{method} eq 'CC' ) {
- $cardtype = cardtype($options{payinfo});
- } elsif ( $options{method} && $options{method} eq 'ECHECK' ) {
- $cardtype = 'ACH';
- } else {
- $cardtype = $options{method} || '';
+ my $cardtype = '';
+ if ( $options{method} ) {
+ if ( $options{method} eq 'CC' && $options{payinfo} ) {
+ $cardtype = cardtype($options{payinfo});
+ } elsif ( $options{method} eq 'ECHECK' ) {
+ $cardtype = 'ACH';
+ } elsif ( $options{method} eq 'PAYPAL' ) {
+ $cardtype = 'PayPal';
+ } else {
+ $cardtype = $options{method}
+ }