Skip to content

Wy i have response 400 ? #45

@crownbackend

Description

@crownbackend

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions