【问题标题】:Trying to use Adaptive Simple Payments but get blank screen尝试使用自适应简单付款但出现空白屏幕
【发布时间】:2015-04-29 15:00:56
【问题描述】:

我正在尝试弄清楚如何将 Adaptive Simple Payments 与 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 json curl paypal


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2015-07-15
      • 2011-12-06
      • 1970-01-01
      • 2014-04-19
      • 1970-01-01
      • 2011-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多