[ic] Using charge inside of [perl] [/perl] or UserTag

Mike Heins interchange-users@icdevgroup.org
Thu Oct 17 21:07:01 2002


Quoting Shawn Mathews (shawn@oceanebi.com):
> Hi All,
> 
> I sure hope somebody can tell me what I'm doing wrong or why what I'm trying
> to do isn't possible....
> 
> I'm attemping to allow administrators to void/refund transactions from
> within the admin interface. I added some code to the order_delete_archive
> file to call the charge tag with some additional info.
> 
> When interchange calls the charge tag I get the follow error:
>   payment routine 'ezic' returned error: require trapped by operation mask
> at (tag 'perl') line 3.
> 
> Code I added to order_delete_archive:
> 
>                         # Get The Fields Needed for a Cancel
>                   for(grep $_, @{$CGI_array->{order}}) {
>                         my $trans_id, $order_id;
>                         $order_id =$db->field($_,'order_number');
>                         $trans_id = $db->field($_,'order_id');
>                         $Tag->log({file=>'orderadmin.log',
>                            create=>1,
>                            type=>'error'},"Canceling Order for $order_id and
> $trans_id\n");
>                         my $rslt = $Tag->charge({
>                                 'route' => 'ezic',
>                                 'transaction' => 'reverse',
>                                 'master_id' => $trans_id,
>                                 'order_id' => $order_id});
>                         $Tag->log({file=>'orderadmin.log',
>                            type=>'error'},"cancel result: ".$rslt."\n");
>                         if ($rslt) {
>                           $db->set_field($_,$action_col,$value);
>                         }
>                   } # End For Loop
> 
> 
> 
> My payment module is attached. (I basically copied the Authorizenet module
> and made changes to support the processor EZIC http://www.ezic.com)
> 

Also, I just put up something similar in devel CVS, update_order_status.tag,
which does a settle. I had intended to modify that to do void or returns,
but hadn't done the interface yet.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

If you think nobody cares if you're alive, try missing a couple of
car payments.  -- Earl Wilson