Search code examples
paypalpaypal-ipnpaypal-sandbox

Why is paypal not making an IPN request from a Buy Now button?


I am trying to get IPN working with 'buy now' links. But it seems that the IPN is not being called, no matter what I do!

Here is my HTML:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> 
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="[email protected]" />
<input type="hidden" name="item_name" value="Training course">
<input type="hidden" name="item_number" value="001">
<input type="hidden" name="amount" value="2" />
<input type='hidden' name='notify_url' value='http://ccl.test.demo.com/rest/paypalpayment'>
<INPUT TYPE="hidden" NAME="currency_code" value="AUD">
<input type="submit" value="Pay now using PayPal" /></form>

I don't have the value 'hosted_button_id' but when I tried to do this I could not generate one for the sandbox environment that would work. Is this my problem?

Using the above code can result in a transaction being accepted, but when I monitor the IPN call back in the history: https://www.paypal.com/au/cgi-bin/webscr?cmd=_display-ipns-history it tells me that there is no history in the past 24 hours of any IPN transactions.

IPN Simulator tells me the listener works fine - with the notifyURL as specified. The transaction seems to proceed as expected in Paypal. Paypal is also configured to enable IPN. We can also confirm that that IPN Simulator appears on our application's logs.

There are no sandbox transactions related to the email address of the sandbox seller account: https://developer.paypal.com/developer/dashboard/sandbox/

Is there anything wrong with my HTML and form details above that might prevent the IPN from being called? My paypal account is business, and verified. I am using sandbox buyer accounts to do the payments.


Solution

  • The short answer is that IPN was not turned on within the sandbox seller account. Thanks @AndrewAngell for pointing me in that direction.

    The long answer is I could not check sandbox account settings because I kept seeing the live site, even though the address said 'www.sandbox.paypal.com'. I opened another browser (Chrome), cleared all the cache and ONLY visited the sandbox site using my sandbox seller account (business, as setup in the developer.paypal.com website). I am unsure as to whether this is a firefox or paypal issue. But it works now.