PayPal Field Data Passing

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
milanoff
Forum Newbie
Posts: 3
Joined: Wed Apr 20, 2005 3:15 pm

PayPal Field Data Passing

Post 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.
Last edited by milanoff on Mon Aug 10, 2009 9:43 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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... :?
milanoff
Forum Newbie
Posts: 3
Joined: Wed Apr 20, 2005 3:15 pm

Post 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 :)
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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?
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post 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??
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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
bobsta63
Forum Commoner
Posts: 28
Joined: Thu Apr 21, 2005 7:03 pm
Location: Ipswich, UK

Post 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! :)
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post 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
Post Reply