尝试使用自适应简单支付,但屏幕为空白


Trying to use Adaptive Simple Payments but get blank screen

我正在尝试了解如何使用Paypal API的自适应简单支付,并尝试测试它们的默认代码:

$payRequest = new PayRequest();
$receiver = array();
$receiver[0] = new Receiver();
$receiver[0]->amount = "1.00";
$receiver[0]->email = "platfo_1255170694_biz@gmail.com";
$receiverList = new ReceiverList($receiver);
$payRequest->receiverList = $receiverList;
$requestEnvelope = new RequestEnvelope("en_US");
$payRequest->requestEnvelope = $requestEnvelope; 
$payRequest->actionType = "PAY";
$payRequest->cancelUrl = "https://devtools-paypal.com/guide/ap_simple_payment/php?cancel=true";
$payRequest->returnUrl = "https://devtools-paypal.com/guide/ap_simple_payment/php?success=true";
$payRequest->currencyCode = "USD";
$payRequest->ipnNotificationUrl = "http://replaceIpnUrl.com";
$sdkConfig = array(
    "mode" => "sandbox",
    "acct1.UserName" => "reznik.demarket-facilitator_api1.gmail.com",
    "acct1.Password" => "BV5GBSV7QBPXJUNR",
    "acct1.Signature" => "AcK.GqlanslGMma1L2TIOPx.t0xQApMepP-Rt7jundLbNOzkwOhrqbJ4",
    "acct1.AppId" => "APP-80W284485P519543T"
);
$adaptivePaymentsService = new AdaptivePaymentsService($sdkConfig);
$payResponse = $adaptivePaymentsService->Pay($payRequest); 

它应该给我这样的json答案:

{"responseEnvelope":{"timestamp":"2015-02-26T17:14:06.242-08:00","ack":"Success","correlationId":"aae1f46492b42","build":"15089777"},"payKey":"AP-0SN13003KN641223K","paymentExecStatus":"CREATED"}

为什么我可以得到一个没有任何错误或成功消息的空白屏幕?

听起来像是遇到了PHP错误,但服务器上没有显示错误。尝试将其添加到脚本顶部。。。

error_reporting(E_ALL);
ini_set('display_errors', '1');

这应该可以让你看到正在发生的错误,这样你就可以修复它。