HEX
Server: Apache
System: Linux webm004.cluster129.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: windevelwb (110072)
PHP: 8.5.0
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/windevelwb/www/stripe/test_checkout.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

require __DIR__ . '/vendor/autoload.php';

\Stripe\Stripe::setApiKey('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'); // ta clé secrète live

$amount = 500; // 5,00 €

$checkout_session = \Stripe\Checkout\Session::create([
    'mode' => 'payment',
    'payment_method_types' => ['card', 'bancontact'],
    'line_items' => [[
        'price_data' => [
            'currency' => 'eur',
            'product_data' => [
                'name' => 'Paiement Ongle Manager',
            ],
            'unit_amount' => $amount,
        ],
        'quantity' => 1,
    ]],
    'success_url' => 'https://www.windevelop.be/stripe/success.html',
    'cancel_url' => 'https://www.windevelop.be/stripe/cancel.html',
]);

header('Location: ' . $checkout_session->url);
exit;