billing event to call web services, RT#35167
[freeside.git] / FS / FS / part_event.pm
index e7acf5a..9a1144c 100644 (file)
@@ -369,6 +369,7 @@ sub eventtable_labels {
     'cust_pkg'       => 'Package',
     'cust_bill'      => 'Invoice',
     'cust_main'      => 'Customer',
+    'cust_pay'       => 'Payment',
     'cust_pay_batch' => 'Batch payment',
     'cust_statement' => 'Statement',  #too general a name here? "Invoice group"?
     'svc_acct'       => 'Login service',
@@ -408,6 +409,7 @@ sub eventtable_pkey {
     'cust_main'      => 'custnum',
     'cust_bill'      => 'invnum',
     'cust_pkg'       => 'pkgnum',
+    'cust_pay'       => 'paynum',
     'cust_pay_batch' => 'paybatchnum',
     'cust_statement' => 'statementnum',
     'svc_acct'       => 'svcnum',
@@ -604,6 +606,22 @@ sub process_initialize {
   $part_event->initialize;
 }
 
+sub _upgrade_data { #class method
+  my ($class, %opts) = @_;
+
+  foreach my $part_event (
+    qsearch('part_event', { 'action' => 'cust_bill_realtime_card' }),
+    qsearch('part_event', { 'action' => 'cust_bill_realtime_check' }),
+  ) {
+
+    $part_event->action('realtime_auto');
+    my $error = $part_event->replace;
+    die $error if $error;
+
+  }
+     
+}
+
 =back
 
 =head1 SEE ALSO