guischarf Posted May 28, 2009 Share Posted May 28, 2009 Hello, I am developing a payment module to pay with credit card in a small local bank. The bank requires that I post two fields: totalAmmount which contains the total the customer will have to pay. orderNumber which should contain any string no longer than 12 chars I want to use the value in orders.orders_id, but don't know how to get it from within the module script. I checked global $orders, but this value is not available there. Any ideas ? Thanks. Quote Link to comment Share on other sites More sharing options...
web-project Posted May 28, 2009 Share Posted May 28, 2009 How to get an Order Number using the PHP and mysql query. Quote Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here! 8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself. Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues. Any issues with oscommerce, I am here to help you. Link to comment Share on other sites More sharing options...
guischarf Posted May 28, 2009 Author Share Posted May 28, 2009 using the PHP and mysql query. Thanks Alex, I output the hidden fields of the form using: function process_button() { global $order; $process_button_string = ''; $params['invoiceNumber'] = rand(1000,10000); //just for testing $params['totalAmount'] = $order->info['total']; foreach ($params as $key => $value) { $process_button_string .= tep_draw_hidden_field($key, $value); } //die($process_button_string); return $process_button_string; } As I undersntand, at this point the order has not been processed and therefore there is no order_id. The order_id is available after clicking the buttom and is available in function after_process() { } So I wonder if this would work function after_process() { global $insert_id; tep_draw_hidden_field('invoiceNumber', $insert_id); } Or by this time the form fields have already been sent. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.