简体   繁体   English

贝宝沙盒IPN无响应

[英]Paypal Sandbox IPN no Response

I am using Zend Framework 2 as my listener for a Paypal payment. 我使用Zend Framework 2作为我的Paypal付款监听器。 My listener is triggered when the payment is made in the sandbox environment, but when I generate the request to reply to Paypal in order to get a VERIFIED or INVALID response I do not get a response. 在沙盒环境中付款时会触发我的监听器,但是当我生成答复Paypal的请求以获取VERIFIED或INVALID响应时,却没有响应。 There is nothing coming up in the web server logs, no errors and no exception is thrown. Web服务器日志中没有任何内容,没有错误,也没有引发异常。 Have tried both the dispatch and Send methods. 已经尝试了dispatch和Send方法。

Is there any way I can see if the request is sent to Paypal sandbox? 有什么办法可以查看请求是否发送到Paypal沙箱? Anywhere in the sandbox I can see this? 在沙箱中的任何地方,我都能看到吗? Or is there any way I can see the response come back. 还是有什么办法可以让我看到回复。 Am using Amazon WS but I don't think it's getting blocked as the listener is initially triggered. 我正在使用Amazon WS,但我不认为它是因为最初触发了侦听器而被阻止了。

Many thanks 非常感谢

Code for IPN listenter is below: IPN侦听器的代码如下:

$request1 = $this->getRequest();

    // Follow Paypal IPN protocol
    // First send back to PayPal received request
    $request = new Request();
    $request->setMethod(Request::METHOD_POST);

    $client = new Client();
    $client->setRequest($request);
    $client->setUri('https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate');

    $postArray = $request1->getPost()->getArrayCopy();
    $client->setParameterPost($postArray);

    $requestHeaders  = $client->getRequest()->getHeaders();

    try {

        $response = $client->send();
        //$response = $client->dispatch($request);

    } catch (Exception $e) {

        $logger->info("Exception:");
        $logger->info($e->getMessage());

    }

最终使用https://github.com/paypal/ipn-code-samples/blob/master/IPN_PHP.txt上的paypal代码解决了上述问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM