- $cust_main{'payby'} = 'CARD';
- if ($cust_main{'payinfo'} =~ /\s*([AD]?)(.*)\s*$/) {
- $cust_main{'payby'} = 'DCRD' if $1 eq 'D';
- $cust_main{'payinfo'} = $2;
+
+ if ( $cust_main{'payinfo'} =~ /^\s*(\d+\@[\d\.]+)\s*$/ ) {
+
+ delete $cust_main{'payinfo'};
+
+ $cust_payby = new FS::cust_payby {
+ 'payby' => 'CHEK',
+ 'payinfo' => $1,
+ };
+
+ } elsif ($cust_main{'payinfo'} =~ /^\s*([AD]?)(.*)\s*$/) {
+
+ delete $cust_main{'payinfo'};
+
+ $cust_payby = new FS::cust_payby {
+ 'payby' => ($1 eq 'D') ? 'DCRD' : 'CARD',
+ 'payinfo' => $2,
+ 'paycvv' => delete $cust_main{'paycvv'},
+ 'paydate' => delete $cust_main{'paydate'},
+ 'payname' => $cust_main{'first'}. ' '. $cust_main{'last'},
+ };
+