Questioner
Questioner

Reputation: 7463

Do I need a particular type of Paypal button to initiate an IPN?

I am very much a newbie with Paypal, but with much effort and help, I feel as though I have got 90% of the set up complete, I just can't get an IPN response back from Paypal.

When I go into the sandbox testing tools and do a simulated IPN, I get green checks indicating everything works.

I have a sandbox merchant, and a sandbox buyer. I've created sandbox "subscribe" buttons. When I click the button, I'm taken to the sandbox Paypal site, I enter my sandbox buyer information, and the payment gets processed.

Everything seems to work fine, but that's where it ends. I'm left on a page that says the payment is complete. Nowhere in this process does Paypal seem to send any kind of request to my specified IPN landing page.

At the top of the PHP code where I receive the IPN, I have a simple mail() function, just for testing to let me know the code has been triggered. I know it works because if I just run it directly in the browser, I get the mail. I do not get the mail when I go through the Paypal sandbox transaction.

All indications are that I have not set up Paypal correctly so that it knows I want it to send an IPN notification during the transaction.

Do I need a particular button (none of them explicitly say "IPN capable" or anything like that, so my default assumption was that any of them would work.)?

In my profile I've specified the page to go to for the IPN message, but perhaps there is another setting that also needs to be configured?


Update:

Here is the code for my button. Note I pretty much just used what was generated for me. I am coming to understand that there are supposed to be extra parameters, but it's not at all clear how I'm supposed to know what additional parameters to include or where to get them.

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXXXXXXXXXXXXXXXX">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Upvotes: 2

Views: 114

Answers (2)

Josh
Josh

Reputation: 8191

With buttons, you need to add the notify_url parameter. This directs where PayPal needs to POST the IPN. Add the following with the URL to your IPN listener to your code.

<input type="hidden" name="notify_url" value="YOUR FULL IPN URL HERE">

Although you have specified the IPN URL in your profile, ensure that you also enabled IPN messages.

To identify additional parameters that may be of some help to you, please read HTML Form Basics for Website Payments Standard.

Upvotes: 3

Rodrigo Ornelas
Rodrigo Ornelas

Reputation: 1

try to use ob_start(); this can fix the problem!

Upvotes: -2

Related Questions