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;