check for order_number method before using it
[Vend-Payment-BusinessOnlinePayment.git] / BusinessOnlinePayment.pm
index 63e8c96..5c1a167 100644 (file)
@@ -134,6 +134,16 @@ for details on what options are required, if any.
 
 Ivan Kohler <ivan-interchange@420.am>
 
+Initial development of this module was sponsored in part by Simply Marketing,
+Inc. <http://www.simplymarketinginc.com/>.
+
+=head1 COPYRIGHT
+
+Copyright 2004 Ivan Kohler.  All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
 =cut
 
 package Vend::Payment;
@@ -273,7 +283,9 @@ sub onlinepayment {
   if ( $transaction->is_success() ) {
 
     $result{MStatus} = 'success';
-    $result{'order-id'} = $transaction->order_number || $opt->{'order_id'};
+    $result{'order-id'} = 
+      ( $transaction->can('order_number') && $transaction->order_number ) 
+      || $opt->{'order_id'};
 
   } else {