【问题标题】:Paypal Sandbox IPN no ResponsePaypal 沙盒 IPN 无响应
【发布时间】:2013-09-07 23:42:06
【问题描述】:

我使用 Zend Framework 2 作为 Paypal 付款的监听器。 在沙盒环境中进行付款时会触发我的侦听器,但是当我生成请求以回复 Paypal 以获得 VERIFIED 或 INVALID 响应时,我没有收到响应。 Web 服务器日志中没有任何内容,没有错误,也没有抛出异常。 dispatch 和 Send 方法都试过了。

有什么方法可以查看请求是否发送到 Paypal 沙盒? 我可以在沙箱中的任何地方看到这个吗? 或者有什么方法可以让我看到回复回来。 我正在使用 Amazon WS,但我认为它不会在最初触发侦听器时被阻止。

非常感谢

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());

    }

【问题讨论】:

    标签: php zend-framework paypal-sandbox paypal-ipn


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2012-10-10
      • 2011-01-19
      • 2010-12-01
      • 2012-01-08
      • 2016-07-13
      • 2015-11-25
      • 2013-05-09
      • 2011-08-07
      • 2018-08-14
      相关资源
      最近更新 更多