sumup / sumup-ecom-php-sdk

SumUp eCom PHP SDK
Other
41 stars 18 forks source link

SumUp integration in Php using Api's #29

Closed pratikdzignuts closed 2 years ago

pratikdzignuts commented 2 years ago

try { $sumup = new \SumUp\SumUp([ 'app_id' => env('SUM_UP_APP_ID'), 'app_secret' => env('SUM_UP_APP_SECRET'), 'grant_type' => 'client_credentials', 'scopes' => ['payments', 'transactions.history', 'user.app-settings', 'user.profile_readonly'], ]); $checkoutService = $sumup->getCheckoutService(); // $checkoutResponse = $checkoutService->create($amount, $currency, $checkoutRef, $payToEmail); // $checkoutId = $checkoutResponse->getBody()->id; $success = [ 'message' => 'Get Sum Up Auth.', 'success' =>true, 'data' => $checkoutService ]; // pass the $chekoutId to the front-end to be processed } catch (\SumUp\Exceptions\SumUpAuthenticationException $e) { $success = [ 'message' => 'Authentication error: ' . $e->getMessage(), 'success' =>false, ]; } catch (\SumUp\Exceptions\SumUpResponseException $e) { $success = [ 'message' => 'Response error: ' . $e->getMessage(), 'success' =>false, ]; } catch(\SumUp\Exceptions\SumUpSDKException $e) { $success = [ 'message' => 'SumUp SDK error: ' . $e->getMessage(), 'success' =>false, ]; }

This is my api code ,I want to create a checkout api but I'm face response error, So, give me suggestion how to fix this error.

joelrose commented 2 years ago

Hi, Thank you for reporting this! Your account needs to be enabled for checkout. If you are still experiencing this issue, please open a new issue, and we'll help you!