I'm using this form to submit a request on the paypal sandbox site:
<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr"
method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="MY_EMAIL">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="item_name" value="Book!">
<input type="hidden" name="amount" value="13">
<input type="hidden" name="return" value="THIS URL">
<input type="hidden" name="notify_url" value="MY_IPN">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"
border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
The only values I replace are MY_EMAIL
and MY_IPN
. The latter, in particular, is a link to my ipn.php
file
include('ipnlistener.php');
$listener = new IpnListener();
// tell the IPN listener to use the PayPal test sandbox
$listener->use_sandbox = true;
// try to process the IPN POST
try {
$listener->requirePostMethod();
$verified = $listener->processIpn();
} catch (Exception $e) {
error_log($e->getMessage());
}
error_log($listener->getTextReport());
(ipnlistener.php source is on github). When I place the order, everything works smoothly (apart from the Please login to use the PayPal sandbox feature bug, which I assume won't be there as I switch from the sandbox to the real paypal).
The problem is: the order is placed correctly and in my sandbox account I receive the payment
Hello Test Store, You received a payment of €13.00 EUR from xxx xxx (xxx@test.test)
but in my error_log I see this:
payment_status Pending
Should I code my ipn.php file such that it accepts and delivers the digital goods also if payment_status
is set to Pending
? The guide I'm following advise to do so only if payment_status is Completed
.
Why isn't the paypal sandbox server sending me the confirmation?