olaoyesunday Posted April 29, 2015 Share Posted April 29, 2015 Dear Admin, In chapter 6 The payment gateway that I am using want me to insert transaction id, amount , payment status to my order table before sending it to their payment gateway and on my thanks php they want me to compare the transaction_id returned from their site with the one in my database before the receipt is shown or printed. please, where do I place the code : INSERT INTO orders (user_id, transaction_id, payment_status, payment_amount) in my registration script before sending captured information to the payment processor? Link to comment Share on other sites More sharing options...
olaoyesunday Posted May 1, 2015 Author Share Posted May 1, 2015 Please, I need answer by anyone that can help me out. Link to comment Share on other sites More sharing options...
Bill Posted May 2, 2015 Share Posted May 2, 2015 It could go in the mysql statement of the script. I don't know for sure as I have the book with stored procedures. Link to comment Share on other sites More sharing options...
olaoyesunday Posted May 2, 2015 Author Share Posted May 2, 2015 Thank you Bill. My problem is on how to insert into two tables simultaneously, I tried inserting into orders table after the line 100 in the registration.php which read $uid = mysqli_insert(dbc,q); $_SESSION['reg_user_id'] = $uid; but it is not working. You know what I need to know is how to insert into multiple table simultaneously. i.e users and orders table upon knowing the user_id Link to comment Share on other sites More sharing options...
Bill Posted May 2, 2015 Share Posted May 2, 2015 Try to ensure program is connecting to database as a lot of problems are related to this. .This may not be relevant but are you creating your own reg script or is the code you are using direct from downloaded code from Larry's website? Link to comment Share on other sites More sharing options...
abigail Posted May 2, 2015 Share Posted May 2, 2015 I don't have time to answer thoroughly but I can point you in the right direction maybe. You have to do each table separately but use a Transaction so they will both succeed or fail together. Link to comment Share on other sites More sharing options...
olaoyesunday Posted May 2, 2015 Author Share Posted May 2, 2015 Bill I am using the code I downloaded from Larry's site. Link to comment Share on other sites More sharing options...
olaoyesunday Posted May 2, 2015 Author Share Posted May 2, 2015 Abigail, I tried but is that I'm missing it somewhere Link to comment Share on other sites More sharing options...
abigail Posted May 3, 2015 Share Posted May 3, 2015 I don't understand "you tried". To update 2 tables you need to do two queries. Link to comment Share on other sites More sharing options...
olaoyesunday Posted May 3, 2015 Author Share Posted May 3, 2015 Abiagail I wrote the two queries, I would have posted it but this text editor does not allow to copy and paste I wouldn't know why it is preventing me from pasting? or is there any other way to paste on this particular text editor? Link to comment Share on other sites More sharing options...
Bill Posted May 4, 2015 Share Posted May 4, 2015 I think those tables will populate after providing appropriate merchant information such as your login id and transaction key. Your book should explain how to set up payment gateway and how to fully test the site using credit card details. This is how 1st edition takes care of payment process. As I do not have 2nd edition only the earlier 1st edition, I am unable to provide clarity as to how you can do it! Sorry. Link to comment Share on other sites More sharing options...
abigail Posted May 4, 2015 Share Posted May 4, 2015 What doesn't work about it? What does it do or not do? Link to comment Share on other sites More sharing options...
Recommended Posts