From 421802cc87154fa956526ea073b4e78ea9446d19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Jul 2025 23:40:20 +0200 Subject: [PATCH] Doc --- htdocs/public/stripe/ipn.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 110799270b0..fb8799fc9b4 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -360,14 +360,14 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P global $stripearrayofkeysbyenv; $error = 0; $object = $event->data->object; - $TRANSACTIONID = $object->id; // Example pi_123456789... + $TRANSACTIONID = $object->id; // Example 'pi_123456789...' $ipaddress = $object->metadata->ipaddress; $now = dol_now(); $currencyCodeType = strtoupper($object->currency); $paymentmethodstripeid = $object->payment_method; $customer_id = $object->customer; $invoice_id = ""; - $paymentTypeCode = ""; // payment type according to Stripe + $paymentTypeCode = ""; // payment type according to Stripe $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr $payment_amount = 0; $payment_amountInDolibarr = 0; @@ -449,7 +449,9 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P } $payment_amount = $payment_amountInDolibarr; - // TODO Check payment_amount in Stripe (received) is same than the one in Dolibarr + // TODO Add this checks ? May not be required because the message is already decoded with $event = \Stripe\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); + // - Check payment_amount in Stripe (received) is same than the one in Dolibarr + // - Check that payment intent is succeed (to avoid forged json webhook sent by malicious users) $postactionmessages = array();