Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

I'm doing a personalized payment module for a credit card gateway

 

They ask me to send them my order number. I need this because the result of the transaction is stored in a control panel they provide, so then when I look at the orders in the admin panel, i have to llok for that order in their panel. I've seen that most of the modules generate a number with the date and time like this:

 

tep_draw_hidden_field('ordernumber', $customer_id . '-' . date('Ymdhis'))

 

But I need to send the real number the order will hae when I look at the orders in the admin section.

 

I looked at the order.php class but I havent seen anthing like $order > info['id'];. All the parameters I could find were related to the customer or products but no order number.

 

How can I generate the real order number?

Edited by JuanIgnacio
Posted

Unfortunately there is no real way of doing this as the order id is not assigned until the order is stored in the db after payment is process.

 

The closest way is to query the orders table to find the order number of the last order then increment it by 1 to predict the order number - this works most times.

 

Tom

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...