I have created a website and need to enable online payments. I have a development account with my clients payments company (http://www.paymentexpress.com/
). I have a form (vouchers.php) attached that I use ajax to send to a processing page to insert into the DB and send an email of the purchase. This works good. At the moment it returns a response via ajax and the customer gets a message on the form. Now, I have a sample form with the code (php) to redirect to a secure payments page. The customer makes the payment and the sample form should get back a success or decline response (like most IPN). My problem is I don't know where to put the sample code and at what point in the chain.
Currently I have the real form and my processing script. I am guessing that the sample code in the sample form should be placed in my real form and that should then go to payments page to make payment. I then need the information along with the payment response to go to my processing page (voucher-process_DEV.php) so I can continue with the whole process (send email and register the sale in the DB).
Can someone help me with getting the right code from the sample form and modifying my actual form (vouchers.php) to complete this entire process? I am lost trying to do it although I wrote all the scripts for the website, this payments stuff is losing me.
I have attached the files
1: vouchers.php // this is my real form. Processed via ajax call.
3: voucher-process_DEV.php // this is the final processing script after the payment has been made
4: PxPay_Sample_Curl.php // a sample form with the code to process the payment and get the response
5: PxPay_Curl.inc.php // this file is required and has the classes for the PxPay_Sample_Curl.php file
If someone could put the code required inside the sample form in the right place on my form and help set this up it would save me from standing on the freeway and waiting for a big truck to run me over so I don't have to deal with this age old problem any more. 3 Weeks I have been reading their literature on how to do this and I just don't quite get it. Please someone help me with this. I will be eternally greatfull. Will ajax still be able to be used for this or will I need to send it the old fashion way?
PxPay-Sample-Curl.php PxPay-Curl.inc.php vouchers.js vouchers.php voucher-process-DEV.php