0
votes

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.

1
Here is more information: I just tried a real transaction (removed sandbox from the url) and it worked. Transaction in IPN history and appears on the listener. But why won't sandbox work?Scott Spence
Are you sure you have IPN enabled in both the live and sandbox account? IPNs work just fine in the sandbox, so you need to make sure that account has them enabled.Drew Angell
Thanks @AndrewAngell, when I try to visit sandbox.paypal.com I get diverted to paypal.com. I have created accounts in my developer area and successfully used these to test other transactions. Is there something special I should do to view the sandbox site?Scott Spence
As a follow-up, when I visit sandbox.paypal.com/cgi-bin/… I see that IPN is turned on. I disabled it and noticed that paypal.com/cgi-bin/customerprofileweb?cmd=_profile-ipn-notify was now disabled. I suspect that both sites use the same configuration?Scott Spence

1 Answers

0
votes

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.