add payby types for apple store, android market and EDI (bill pay), RT#15309
[freeside.git] / FS / FS / payby.pm
index b54e5d9..bee787c 100644 (file)
@@ -48,28 +48,33 @@ 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',
@@ -101,6 +106,24 @@ tie %hash, 'Tie::IxHash',
     longname  => 'Manual credit card', 
     cust_main => 'BILL', #this is a payment type only, customers go to BILL...
   },
+  'APPL' => {
+    tinyname  => 'apple store',
+    shortname => 'Apple Store',
+    longname  => 'Apple Store',
+    cust_main => 'BILL', #this is a payment type only, customers go to BILL...
+  },
+  'ANRD' => {
+    tinyname  => 'android market',
+    shortname => 'Android Market',
+    longname  => 'Android Market',
+    cust_main => 'BILL', #this is a payment type only, customers go to BILL...
+  },
+  'EDI' => {
+    tinyname  => 'EDI',
+    shortname => 'Electronic Debit',
+    longname  => 'Electronic Debit',
+    cust_main => '', #not a customer type
+  },
   'COMP' => {
     tinyname  => 'comp',
     shortname => 'Complimentary',
@@ -131,6 +154,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;
@@ -157,6 +189,7 @@ sub longname {
 %payby2bop = (
   'CARD' => 'CC',
   'CHEK' => 'ECHECK',
+  'MCRD' => 'CC',
 );
 
 sub payby2bop {