Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with $order object in payment module


Recommended Posts

I'm trying to get my Smart Status contrib to work, but, in checkout_confirmation.php, $order is no longer an object when it reaches my payment module. Yet, in checkout_payment.php, it is an object. :(

 

I basically need to be able to test

$order->info['shipping_method']

or figure out another way of testing whether this order needs to ship.

 

Here's the payment module code:

 

 ?class authorizenetaim {
? ?var $code, $title, $description, $enabled;

// class constructor
? ?function authorizenetaim() {
? ?
? ?	global $order;
? ?  ? ?
? ? ? // TESTING IF OBJECT - RETURNS NO IN CHK_PROC
? ?	if (is_object($order)) {
? ?
? ? ?echo "YEP - it's an object!";
? ?	} else {
? ? ?echo "NOPE";
? ?	}

?$this->code = 'authorizenetaim';
?$this->title = MODULE_PAYMENT_AUTHORIZENETAIM_TEXT_TITLE;
?$this->description = MODULE_PAYMENT_AUTHORIZENETAIM_TEXT_DESCRIPTION;
?$this->enabled = ((MODULE_PAYMENT_AUTHORIZENETAIM_STATUS == 'True') ? true : false);
?$this->error = '';
?
?if ((int)MODULE_PAYMENT_AUTHORIZENETAIM_ORDER_STATUS_ID > 0) {
?
?	if ($order->info['shipping_method'] != '') {	
? ?// SHIP ITEM - MARK UNFULFILLED
? ? ?$this->order_status = MODULE_PAYMENT_AUTHORIZENETAIM_ORDER_STATUS_ID;
?	} else { 
? ?// DOWNLOAD ONLY ITEM - MARK e-FULFILLED
? ? ?$this->order_status = (MODULE_PAYMENT_AUTHORIZENETAIM_ORDER_STATUS_ID + 3);
?	}
? ? ?	}

? ? ?	if (is_object($order)) $this->update_status();

?// Change made by using ADC Direct Connection
?$this->form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false);
? ?}

 

TIA for any help or pointers you can provide. :)

 

- jeff

Edited by swissarmyknife
Link to comment
Share on other sites

I basically need to be able to test
$order->info['shipping_method']

or figure out another way of testing whether this order needs to ship.

 

 

It is tested in checkout_shipping.php with this:

 

  if ($order->content_type == 'virtual') {
   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
   $shipping = false;
   $sendto = false;
   tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }

 

 

HTH

 

Matti

Link to comment
Share on other sites

It is tested in checkout_shipping.php with this:

 

 ?if ($order->content_type == 'virtual') {
? ?if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
? ?$shipping = false;
? ?$sendto = false;
? ?tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
?}

HTH

 

Matti

 

Thanks, Matti. I'll try to work with that. The reason I'm testing for that is to determine (in the payment modules) which status to write to the db. For instance, for our download orders, I want the status to show fulfilled, but for items needing to be shipped, it should show unfulfilled.

 

And the only place I see that the status is being written is in the payment modules. Yet, I can't retrieve the shipping info there because the $order object is dead once that function is called.

 

Maybe I'm making this way too hard. Any suggestions?

 

Thanks again for your help!

- jeff

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...