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

SDK not working on shared hosting #23

Closed
codebeginer opened this issue Apr 6, 2021 · 2 comments
Closed

SDK not working on shared hosting #23

codebeginer opened this issue Apr 6, 2021 · 2 comments

Comments

@codebeginer
Copy link

I am facing this weird issue. I tried the sdk on local system, where it is working fine. When I move the code to live server, it stopped working. The live server not getting the response from api.sumup.com.

Is their any criteria that sumup server blocks the domain from accessing it or it might have any other issue. I checked the error logs and do not find any error in requesting the api.

<?php 
require_once('vendor/autoload.php');
try {
    $sumup = new \SumUp\SumUp([
        'app_id'     => 'xxxxx',
        'app_secret' => 'xxxx',
        'grant_type' => 'client_credentials',
        'scopes'      => ['payments']
    ]);
    $checkoutService = $sumup->getCheckoutService();
    $checkoutResponse = $checkoutService->create(1,'USD', 'ASDASDSAD', '[email protected]');
    $checkoutId = $checkoutResponse->getBody()->id;

    echo $checkoutId;die;
//  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();
}
@ptrovatelli
Copy link

it may be complicated to get all logs from a shared hosting platform. have you tried adding this at the begining of the file to help troubleshoot?

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

@joelrose
Copy link
Contributor

joelrose commented Mar 3, 2022

Hi, If you are still experiencing the same problem, please open a new issue!

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

3 participants