Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SumUp integration in Php using Api's #29

Closed
pratikdzignuts opened this issue Oct 11, 2021 · 1 comment
Closed

SumUp integration in Php using Api's #29

pratikdzignuts opened this issue Oct 11, 2021 · 1 comment

Comments

@pratikdzignuts
Copy link

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
Copy link
Contributor

joelrose commented Mar 3, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants