Jump to content
Larry Ullman's Book Forums

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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? 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
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.

Loading...

×
×
  • Create New...