Example Worldpay PHP/MySQL Callback?

Hello experts,

I am trying to figure out how to work Worldpay's callback (payment response) system, I get that WP blurt all the details back to an address (www.domain.com/callback.php), but I'm at a lost what to do with that information .. more importantly, how to get the data they send into a MySQL db (I have that setup an can connect to it to submit/retrieve data for example).

Worldpay typically not very helpful for beginners (http://www.rbsworldpay.com/support/kb/bg/paymentresponse/payment_response.html)

Any help/examples extremely welcome! Total n00b so please be gentle!
anelson2008Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

virmaiorCommented:
They pass it back as POST data:

http://www.rbsworldpay.com/support/kb/bg/paymentresponse/pr5200.html

this means you can access it in php using $_POST['x'] for whatever the variable names are respectively.


in your script, you would then,

(1) connect to your MySQL db: mysql_connect('host','username','password');
(2) select your db: mysql_select_db('my_db');
(3) send your query mysql_query('INSERT INTO my_table (my_field, my_field_2) VALUES ' . $_POST['my_field'] . ',' . $_POST['my_field']);

for (3), you will need to use single quotes if these are string values and ideally you will need to scrub the data to make sure no one can use a SQL injection attack.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tbsgadiCommented:
Have a look at the following:

http://www.webmasterworld.com/forum22/1186.htm

Gary
0
anelson2008Author Commented:
Spot on! Thank you both very much.
0
tbsgadiCommented:
Glad to assist
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.