0

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?

4

1 回答 1

0

已解决 - 只需登录您的沙盒业务帐户,然后从那里启用以不同货币接收付款或/并接受付款。然后,您的 IPN 将正确接收“已完成”payment_status 属性。

于 2013-05-13T13:30:14.920 回答