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

Response error: request_not_allowed. Error 403 on Payment #31

Open
fokkerprop opened this issue Jan 15, 2022 · 1 comment
Open

Response error: request_not_allowed. Error 403 on Payment #31

fokkerprop opened this issue Jan 15, 2022 · 1 comment

Comments

@fokkerprop
Copy link

Hi

I am trying to use the payments widget in a test environment initially but am having a 403 error when trying to create a checkout. I have previously had an email indicating that the payment scope was active when I was using the woocommerce interface.

My code is

try{
    $sumup = new \SumUp\SumUp([
        'app_id'     => get_option('cws_sumup_key'),
        'app_secret' => get_option('cws_sumup_secret_key'),
        'grant_type' => 'client_credentials',
        'scopes'      => ['payments', 'transactions.history', 'user.app-settings', 'user.profile_readonly']
    ]);
    $accessToken = $sumup->getAccessToken();
    $value = $accessToken->getValue();
    error_log("ACCESS TOKEN=" . $value);

    $sumup = new \SumUp\SumUp([
        'app_id'     => get_option('cws_sumup_key'),
        'app_secret' => get_option('cws_sumup_secret_key'),
        'access_token' => $value
    ]);

    $checkoutsService = $sumup->getCheckoutService();

//     WORKING FINE TO THIS POINT

    $response = $checkoutsService->create(10, 'GBP', 'DYS00001', '[email protected]');
    $checkoutId = $response->getBody()->id;


} 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();
}

I am getting an access token and the checkout service seems to work but I'm getting
Response error: request_not_allowed

with the create method. This is taking too much time and I need to get it sorted. Please help. Is there a better PHP guide or a sample app that I can take a look at.

Thanks

@liedekef
Copy link

liedekef commented Jun 3, 2022

Apparently you need to contact sump for checkout activation. Seems weird ...
See #24 and #19

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