1 package FS::part_event::Action::realtime_auto;
4 use base qw( FS::part_event::Action );
7 #'Run card with a <a href="http://420.am/business-onlinepayment/">Business::OnlinePayment</a> realtime gateway';
8 'Run card or check with a Business::OnlinePayment realtime gateway';
11 sub eventtable_hashref {
17 sub default_weight { 30; }
20 my( $self, $object ) = @_;
22 my $cust_main = $self->cust_main($object);
24 my %opt = ('cc_surcharge_from_event' => 1);
27 my $balance = $cust_main->balance;
28 if ( ref($object) eq 'FS::cust_main' ) {
30 } elsif ( ref($object) eq 'FS::cust_bill' ) {
31 $amount = ( $balance < $object->owed ) ? $balance : $object->owed;
32 $opt{'invnum'} = $object->invnum;
34 die 'guru meditation #5454.au';
37 $cust_main->realtime_cust_payby( 'amount' => $amount, %opt, );