J'ai testé en réel, les paiements s'effectuent bien.
J'ai 2 scripts: server.php et webhook.php.
Je pense que c'est dans ce dernier que je dois mettre mon line de maj de database suite paiement?
<?php
// webhook.php
//
// Use this sample code to handle webhook events in your integration.
//
// 1) Paste this code into a new file (webhook.php)
//
// 2) Install dependencies
// composer require stripe/stripe-php
//
// 3) Run the server on http://localhost:4242
// php -S localhost:4242
require 'vendor/autoload.php';
// This is your Stripe CLI webhook secret for testing your endpoint locally.
$endpoint_secret = 'xxxxxxxxxxxxx';
$payload = @file_get_contents('php://input');
$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];
$event = null;
try {
$event = \Stripe\Webhook::constructEvent(
$payload, $sig_header, $endpoint_secret
);
} catch(\UnexpectedValueException $e) {
// Invalid payload
http_response_code(400);
exit();
} catch(\Stripe\Exception\SignatureVerificationException $e) {
// Invalid signature
http_response_code(400);
exit();
}
// Handle the event
switch ($event->type) {
case 'cash_balance.funds_available':
$cashBalance = $event->data->object;
// ... handle other event types
default:
echo 'Received unknown event type ' . $event->type;
}
http_response_code(200);
?>
J'ai testé en réel, les paiements s'effectuent bien.
J'ai 2 scripts: server.php et webhook.php.
Je pense que c'est dans ce dernier que je dois mettre mon line de maj de database suite paiement?
[PHP]
<?php
// webhook.php
//
// Use this sample code to handle webhook events in your integration.
//
// 1) Paste this code into a new file (webhook.php)
//
// 2) Install dependencies
// composer require stripe/stripe-php
//
// 3) Run the server on http://localhost:4242
// php -S localhost:4242
require 'vendor/autoload.php';
// This is your Stripe CLI webhook secret for testing your endpoint locally.
$endpoint_secret = 'xxxxxxxxxxxxx';
$payload = @file_get_contents('php://input');
$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];
$event = null;
try {
$event = \Stripe\Webhook::constructEvent(
$payload, $sig_header, $endpoint_secret
);
} catch(\UnexpectedValueException $e) {
// Invalid payload
http_response_code(400);
exit();
} catch(\Stripe\Exception\SignatureVerificationException $e) {
// Invalid signature
http_response_code(400);
exit();
}
// Handle the event
switch ($event->type) {
case 'cash_balance.funds_available':
$cashBalance = $event->data->object;
// ... handle other event types
default:
echo 'Received unknown event type ' . $event->type;
}
http_response_code(200);
?>
[/PHP]