I want to implement a paiement in Stripe using Checkout in server side. I followed their tutorial but I can't return the id. I used the following code, just added echo 1,2,3... to check where there is a problem.
When I execute the following code I just return "1".
(of course I have created an account on Stripe)
<?php
    echo "1";
    \Stripe\Stripe::setApiKey('sk_test_XXXXXXXXXXXXXXXXXXXX');
    echo "2";
    $session = \Stripe\Checkout\Session::create([
                                                'payment_method_types' => ['card'],
                                                'line_items' => [[
                                                'name' => 'T-shirt',
                                                'description' => 'Comfortable cotton t-shirt',
                                                'images' => ['https://example.com/t-shirt.png'],
                                                'amount' => 500,
                                                'currency' => 'eur',
                                                'quantity' => 1,
                                                ]],
                                                'success_url' => 'https://example.com/success',
                                                'cancel_url' => 'https://example.com/cancel',
                                                ]);
    echo "3";
    $session_id = $object->id;
    echo "4";
    if ($session_id) {
        echo "sessionID OK";
    } else {  
        echo "No Session ID!";
    }
    echo "5";
?>
Do you know what is wrong ?
 
    