Page 1 of 1

PayPal Field Data Passing

Posted: Wed Apr 20, 2005 3:16 pm
by milanoff
Hello everybody, and welcome me to the forums! :)

I have 2 questions:

I have a form (processed with PHP): The visitor fills his name, address, phone etc. On the same page he/she chooses the product +color(custom field 1) +shape(custom field 2) +material(custom field 3). The payment amount is automatically calculated. Ok, i now have all the data, so POST to PayPal. Here comes question one:


How to post more than one custom fields to PayPal?


Next, i am assuming that all the data (including the custom fields) was POST-ed to PayPal. The visitor fills his/her's data, pays. The payment process is complete, and PayPal redirects the user to my thanks.php page. Question 2:


How to POST the PayPal data back to my website (including the custom fields)?


I don't actually need to process the custom fields with PayPal, but i need them on the final page, after the payment is done. That's why my idea is to pass them trough PayPal, and when the checkout is complete, to pass them back to my website. I need all the information (name, address, phone, email, payment amount + the custom fields) POST-ed to my thanks.php page.

Right now i don't have a problem to create a page that posts the regular data (but not the custom fields) to PayPal, and it works fine. But i don't know how to post the custom fields

Any help is appreciated. Thank you.

Posted: Wed Apr 20, 2005 5:35 pm
by feyd
why not just store the data on your server? All you need to know then is whether the transaction was a success or not... :?

Posted: Thu Apr 21, 2005 2:50 pm
by milanoff
Hi,

what i actually want is to store everything in a SQl database, send an confirmation email to myself and the buyer. But if i do that before the buyer goes trough PayPal, i can't be sure that he/she will make the payment. And if the buyer decides to close the PayPal page before doing the payment, we still receive the email, right? That's how it works now, and i want the email and the data to be added after payment is sent.

Thanks :)

Posted: Fri Apr 22, 2005 6:16 am
by malcolmboston
i have had this problem before of no way of actually beiong 100% sure the user has completed payment

anyone know a workaround?

Posted: Fri Apr 22, 2005 7:03 am
by phpScott
I think what fyed was trying to convey was that you store the customers order in a db with a flag such as in_shopping_cart or proccessing or purchased.

the idea being that when the customer adds items to there cart the flag is set to the first one, when they got to start the transaction you switch the flag to the second one, after they have gone through paypal ( or whatever payment method ) you check to see if the transaction was succesfull. If it was then switch the flag to purchased, if not they you can always set the flag to a 4th option of something like failed_processing.

So all you have to do is send along somehting like the customer_id and what other information your payment processor requires. You can then use the customer_id to do the updating.

does that make more sense??

Posted: Fri Apr 22, 2005 7:06 am
by malcolmboston
i already thought of this method, however i was looking out an automatic verification system, this would require some return information being sent from paypal's server which im sure they do but is private so unavailable to the general public

Posted: Fri Apr 22, 2005 7:35 am
by bobsta63
If you use Macromedia Dreamweaver, I know you can get a Paypal plugin that allows you to add custom fields to paypal. - Well almost 97% sure anyway mate.

If your that stuck it might be worth downloading a trial version from Macromedia website and then downloading the plugin then seeing how the code works etc.

^ Just a thought! :)

Posted: Fri Apr 22, 2005 8:16 am
by phpScott
There would have to be some way that paypal (never used them) notifies the user if the transaction was succesful or not, how else would you as say a paying customer buying something know whether you will recieve the product or not, or if you have to top up your paypal account.

I don't think paypal would just say thanks, and not let you know if your transaction was succesful or not :?

any paypal users out there that can verify this?

phpScott