Skip to content Skip to sidebar Skip to footer

How Can I Get Posted Data Passed Along When The User Is First Redirected Through Paypal?

I've been trying to tackle this for some time now. I have an order page where the customer must enter information like name, address, etc. and some more unique fields. I have set u

Solution 1:

are you using the Paypal Sandbox for testing? If not, I strongly recommend it: https://developer.paypal.com/, and the manual: https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_Sandbox_UserGuide.pdf.

I don't see the field name="business" in you code. That is the field which Paypal uses to identify you seller account. But maybe it only has to do with the "cmd" parameter (I use _xclick).

Here is a set of fields which works at this time for me, maybe it helps you:

<form name="_xclick" action="https://www.paypal.com/de/cgi-bin/webscr" method="post">
    <inputtype="hidden" name="cmd" value="_xclick">
    <inputtype="hidden" name="business" value="seller_email_here">
    <inputtype="hidden" name="notify_url" value="ipn_url_here">
    <inputtype="hidden" name="return" value="redirect_url">
    <inputtype="hidden" name="cancel_return" value="redirect_if_cancelled_url">
    <inputtype="hidden" name="amount" value="number_of_items">
    <inputtype="hidden" name="currency_code" value="EUR">
    <inputtype="hidden" name="item_name" value="product_name">
    <inputtype="hidden" name="item_number" value="product_number">

Solution 2:

Your problem is that you're using a hosted button. You can't include custom stuff in the general HTML for those. The only custom fields that can be included have to be done in the PayPal button creation wizard.

You also need to make sure you're not confusing IPN and PDT. If you simply want data to come back to your return URL that the user is sent to after completing payment that would be PDT. It's not recommended that you handle post-order-processing with this, though, because there is no guarantee the user will make it there.

IPN can be used for that because it will be triggered no matter what, but again, that's totally separate from your checkout and PDT.

I would highly recommend using Express Checkout instead of standard buttons since you seem to be familiar with PHP, too. I've got a PHP class library for PayPal that makes this very simple for you, and I can provide 30 min of free training if you need it, which is generally more than enough to get people up-and-running as long as you understand PHP and how to work with array data.

You can do it with Standard, too, but you'd have to move away from using a hosted button @AndreiHardau is showing. That would allow you to include additional fields like address1, address2, address_overide, etc, and those fields would then be returned in IPN, PDT, and in GetTransactionDetails.

Post a Comment for "How Can I Get Posted Data Passed Along When The User Is First Redirected Through Paypal?"