Giter VIP home page Giter VIP logo

Comments (6)

rleo79 avatar rleo79 commented on August 11, 2024 1

from sumup-ecom-php-sdk.

lyubomir-sumup avatar lyubomir-sumup commented on August 11, 2024

Hi @rleo79,
There is nothing wrong with your code. You are missing the payments scope. You can read more about the restricted scopes here. You should write to [email protected] to be properly onboarded for this functionality.

from sumup-ecom-php-sdk.

chrisreiter avatar chrisreiter commented on August 11, 2024

what does " You should write to [email protected] to be properly onboarded for this functionality." mean? Is there anything to be activated in the account as well? I am having that issue on test- and real accounts

from sumup-ecom-php-sdk.

pratikdzignuts avatar pratikdzignuts commented on August 11, 2024

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 Rest-api code, I'm try to integrate Sum-up Online payment Integration in my Laravel project, but I'm getting error like this
{
"message": "Response error: Client error",
"success": false
}
So, Anyone can give me suggestion for how to fix this issue.

from sumup-ecom-php-sdk.

shahsagar1998 avatar shahsagar1998 commented on August 11, 2024

Hello everyone,

I got the same issue, and i have added payments scope in my code.
Please check and give me suggestion, how to fix this issue.

$sumup = new \SumUp\SumUp([
'app_id' => 'SUM_UP_APP_ID',
'app_secret' => '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;

Thanks in Advance.

from sumup-ecom-php-sdk.

pratikdzignuts avatar pratikdzignuts commented on August 11, 2024

from sumup-ecom-php-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.