Skip to content
Advertisement

Paypal payout PHP internal server error when creating new ProductionEnvironment object

I’m trying to integrate PaypalPayoutSDK in my project. I’ve tried setting up the project like described in the instructions.

Here is what I have:

use PaypalPayoutsSDKCorePayPalHttpClient;
use PaypalPayoutsSDKCoreProductionEnvironment;

// Creating an environment
$clientId = "myid";
$clientSecret = "mysecret";

$environment = new ProductionEnvironment($clientId, $clientSecret);

And the folder structure is just:

-payment
  -myfile.php
  -PaypalPayoutsSDK

When I try to use new ProductionEnvironment() I get an 500 Internal Server Error I’m not very adept in PHP so I might not easily understand what’s going on an how to fix it. For example I’m not using composer and I probably won’t be able to unless it is absolutely necessary to get this to work. My project is purely PHP without anything added to it.

Here is the error message I get:

Fatal error: Uncaught Error: Class 'PaypalPayoutsSDKCoreProductionEnvironment' not found in /hermes/bosnaweb27a/b1507/dom.mynamestudios/myname/payment/payuser.php:14 Stack trace: #0 {main} thrown in /hermes/bosnaweb27a/b1507/dom.mynamestudios/myname/payment/payuser.php on line 14

What could be the problem here? And how can I fix it?

Advertisement

Answer

If you add things like:

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

To the top of your PHP file, you may get a more meaningful error message

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement