sumup / sumup-ecom-php-sdk

SumUp eCom PHP SDK
Other
41 stars 18 forks source link

Wy i have response 400 ? #45

Open crownbackend opened 8 months ago

crownbackend commented 8 months ago

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

LynxTR commented 4 months ago

@crownbackend Did you able to find any workaround?

crownbackend commented 4 months ago

@crownbackend Did you able to find any workaround?

Hello no is not work