From f5e2ccbe08721894b68dba9669af89d4ccda5523 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Dec 2023 18:32:38 +0100 Subject: [PATCH] Debug v19 --- htdocs/public/stripe/ipn.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index c408f1c7f9f..bee8b99ab0d 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -594,7 +594,7 @@ if ($event->type == 'payout.created') { $objerrcode = ''; $objerrmessage = ''; $objpaymentmodetype = ''; - if (property_exists($object, 'charges')) { // Old format + if (!empty($object->charges)) { // Old format $chargesdataarray = $object->charges->data; foreach ($chargesdataarray as $chargesdata) { $objpayid = $chargesdata->id; @@ -610,7 +610,8 @@ if ($event->type == 'payout.created') { break; } } - if (property_exists($object, 'last_payment_error')) { // New format 2023-10-16 + if (!empty($object->last_payment_error)) { // New format 2023-10-16 + // $object is probably an object of type Stripe\PaymentIntent $objpayid = $object->latest_charge; $objpaydesc = $object->description; $objinvoiceid = 0; @@ -623,7 +624,7 @@ if ($event->type == 'payout.created') { $objpaymentmodetype = $object->last_payment_error->payment_method->type; } - dol_syslog("objpaymentmodetype = ".$objpaymentmodetype); + dol_syslog("objpayid=".$objpayid." objpaymentmodetype=".$objpaymentmodetype." objerrcode=".$objerrcode); // If this is a differed payment for SEPA, add a line into agenda events if ($objpaymentmodetype == 'sepa_debit') {