简体   繁体   English

Paypal php sdk problen

[英]Paypal php sdk problen

Hey i have a problem with my php code. 嘿,我的PHP代码有问题。 When i tried in on localhost it worked but when i upload it to my server it doesn't. 当我尝试使用localhost时,它可以工作,但是当我将它上传到我的服务器时却没有。

I think the problem is here. 我认为问题出在这里。

$payment->setRedirectUrls($redirectUrls);

echo '10';

try {

echo " 10 ";

$payment->create($api);


echo '11';

And as you can see there is echo " 10 "; 正如你所看到的那样有回音“10”; and echo " 11 "; 并回声“11”; and the last number shown is 10. 最后显示的数字是10。

The error I get: 我得到的错误:

Fatal error: Uncaught exception 'PayPal\Exception\PayPalConnectionException' with message 'HEJ HEJGot Http response code 500 when accessing https://api.paypal.com/v1/payments/payment.' in /var/www/jjracing.dk/public_html/Tipperen/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php:159 Stack trace: #0 /var/www/jjracing.dk/public_html/Tipperen/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Transport/PayPalRestCall.php(74): PayPal\Core\PayPalHttpConnection->execute('{"intent":"sale...') #1 /var/www/jjracing.dk/public_html/Tipperen/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Common/PayPalResourceModel.php(103): PayPal\Transport\PayPalRestCall->execute(Array, '/v1/payments/pa...', 'POST', '{"intent":"sale...', NULL) #2 /var/www/jjracing.dk/public_html/Tipperen/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Api/Payment.php(303): PayPal\Common\PayPalResourceModel::executeCall('/v1/payments/pa...', 'POST', '{"intent":"sale...', NULL, Object(PayPal\Rest\ApiContext), NULL) #3 /var/www/jjracin in /var/www/jjracing.dk/public_html/Tipperen/PayPal-PHP-SDK/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php on line 159

As you can see on your log file, at the end : http://pastebin.com/WsvDEJtq Line 457, You have null in your transaction object. 正如您在日志文件中看到的那样,最后: http//pastebin.com/WsvDEJtq第457行,您的事务对象中有null。 You should be passing a transaction object in there. 你应该在那里传递一个事务对象。

You can checkout the logs on the same bin and you would see that the ones that were successful have transaction filled in properly. 您可以检查同一垃圾箱中的日志,您会看到成功的垃圾邮件已正确填写。

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

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