Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

Wy i have response 400 ? #45

Open
Open

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', 'dev_gabutyqs@sumup.com', '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

Activity

  1. LynxTR commented on Mar 6, 2024

    @LynxTR

    @crownbackend Did you able to find any workaround?

  2. crownbackend commented on Mar 12, 2024

    @crownbackend
    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

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