sumup / sumup-ecom-php-sdk

SumUp eCom PHP SDK
Other
42 stars 19 forks source link

Fatal error: Class 'SumUp\SumUp' not found in #33

Open cutman-friseur opened 2 years ago

cutman-friseur commented 2 years ago

I get this error msg Fatal error: Class 'SumUp\SumUp' not found in XXXX/XXXX/sumup-test.php on line 3 when I call this code as explained. sumup installed via composer

code try { $sumup = new \SumUp\SumUp([ 'app_id' => 'YOUR-CLIENT-ID', 'app_secret' => 'YOUR-CLIENT-SECRET', 'code' => 'YOUR-AUTHORIZATION-CODE' ]); $checkoutService = $sumup->getCheckoutService(); $checkoutResponse = $checkoutService->create($amount, $currency, $checkoutRef, $payToEmail); $checkoutId = $checkoutResponse->getBody()->id; // pass the $chekoutId to the front-end to be processed } catch (\SumUp\Exceptions\SumUpAuthenticationException $e) { echo 'Authentication error: ' . $e->getMessage(); } catch (\SumUp\Exceptions\SumUpResponseException $e) { echo 'Response error: ' . $e->getMessage(); } catch(\SumUp\Exceptions\SumUpSDKException $e) { echo 'SumUp SDK error: ' . $e->getMessage(); }