gpt4 book ai didi

php - 尝试使用 Adaptive Simple Payments 但出现黑屏

转载 作者:太空宇宙 更新时间:2023-11-03 16:28:17 24 4
gpt4 key购买 nike

我正在尝试弄清楚如何将 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 错误,但您没有在服务器上显示错误。尝试将其添加到脚本的顶部...

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

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

关于php - 尝试使用 Adaptive Simple Payments 但出现黑屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28755931/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com