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

Wy i have response 400 ? #45

Open
crownbackend opened this issue Nov 15, 2023 · 2 comments
Open

Wy i have response 400 ? #45

crownbackend opened this issue Nov 15, 2023 · 2 comments

Comments

@crownbackend
Copy link

Hello, i have problem,

I followed the documentation to make a payment except that it doesn't work, I use the php sdk, here is an extract of my code:

`try {
$data = json_encode([
'payment_type' => 'card',
'card' => [
'name' => 'John Doe',
'number' => '4242424242424242',
'expiry_month' => '12',
'expiry_year' => '34',
'cvv' => '123',
],
]);

        $sumup = new SumUp([
            'app_id' => $this->clientId,
            'app_secret' => $this->clientSecert,
            'grant_type' => 'client_credentials',
            'scopes' => ['payments', 'payment_instruments', 'transactions.history', 'user.app-settings', 'user.profile_readonly'],
        ]);

// $checkoutsService = $sumup->getCheckoutService();
// $response = $checkoutsService->create(20, 'EUR', 'C4F45478R', '[email protected]', 'Sample one-time payment');
// $checkoutId = $response->getBody()->id;
// dump($checkoutId);
$customService = $sumup->getCustomService();
$checkoutId = "17b5fb52-4c02-4c46-ad25-6a9a202a4402";
$response = $customService->request('PUT', "/v0.1/checkouts/{$checkoutId}", $data);
//$response = $customService->request('GET', '/v0.1/checkouts');
dump($response->getBody());
} catch (SumUpSDKException $exception) {
dd($exception);
}`

this is account test, wy the card john doe not work ? is return 400 for me ;

SumupApi.php on line 44:
SumUp\Exceptions\SumUpResponseException {#901 ▼
#message: "Client error"
#code: 400
#file: "/home/belhassen/Documents/dev/ams/ams-mantes-association/vendor/sumup/sumup-ecom-php-sdk/src/SumUp/HttpClients/Response.php"
#line: 103

can you help me ? thanks for you response

@LynxTR
Copy link

LynxTR commented Mar 6, 2024

@crownbackend Did you able to find any workaround?

@crownbackend
Copy link
Author

@crownbackend Did you able to find any workaround?

Hello no is not work

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