X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpayby.pm;h=30a03ddfe6f769083f063d7343e28aa684573e9f;hb=dafdfc24616b04a5ff594da31e2cdd03f58634b6;hp=349d266a332448506eebc08d89844b3e274362ee;hpb=978fea1c303551f90c95ae852b6463951b78246b;p=freeside.git diff --git a/FS/FS/payby.pm b/FS/FS/payby.pm index 349d266a3..30a03ddfe 100644 --- a/FS/FS/payby.pm +++ b/FS/FS/payby.pm @@ -48,32 +48,38 @@ tie %hash, 'Tie::IxHash', tinyname => 'card', shortname => 'Credit card', longname => 'Credit card (automatic)', + realtime => 1, }, 'DCRD' => { tinyname => 'card', shortname => 'Credit card', longname => 'Credit card (on-demand)', cust_pay => 'CARD', #this is a customer type only, payments are CARD... + realtime => 1, }, 'CHEK' => { tinyname => 'check', shortname => 'Electronic check', longname => 'Electronic check (automatic)', + realtime => 1, }, 'DCHK' => { tinyname => 'check', shortname => 'Electronic check', longname => 'Electronic check (on-demand)', cust_pay => 'CHEK', #this is a customer type only, payments are CHEK... + realtime => 1, }, 'LECB' => { tinyname => 'phone bill', shortname => 'Phone bill billing', longname => 'Phone bill billing', + realtime => 1, }, 'BILL' => { tinyname => 'billing', shortname => 'Billing', + payname => 'Check', longname => 'Billing', }, 'PREP' => { @@ -130,6 +136,15 @@ sub can_payby { return 1; } +sub realtime { # can use realtime payment facilities + my( $self, $payby ) = @_; + + return 0 unless $hash{$payby}; + return 0 unless exists( $hash{$payby}->{realtime} ); + + return $hash{$payby}->{realtime}; +} + sub payby2longname { my $self = shift; map { $_ => $hash{$_}->{longname} } $self->payby; @@ -140,6 +155,14 @@ sub shortname { $hash{$payby}->{shortname}; } +sub payname { + my( $self, $payby ) = @_; + #$hash{$payby}->{payname} || $hash{$payby}->{shortname}; + exists($hash{$payby}->{payname}) + ? $hash{$payby}->{payname} + : $hash{$payby}->{shortname}; +} + sub longname { my( $self, $payby ) = @_; $hash{$payby}->{longname}; @@ -148,6 +171,7 @@ sub longname { %payby2bop = ( 'CARD' => 'CC', 'CHEK' => 'ECHECK', + 'MCRD' => 'CC', ); sub payby2bop {