From 0915374fa126efda9260bf898e714eb7f65bda22 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 1 Jan 2023 16:54:36 +0100 Subject: [PATCH] Fix php 8 errors --- htdocs/stripe/class/stripe.class.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 43f940acdee..53adfdbe85b 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -378,7 +378,7 @@ class Stripe extends CommonObject $paymentintent = null; - if (is_object($object) && !empty($conf->global->STRIPE_REUSE_EXISTING_INTENT_IF_FOUND) && empty($conf->global->STRIPE_CARD_PRESENT)) { + if (is_object($object) && getDolGlobalInt('STRIPE_REUSE_EXISTING_INTENT_IF_FOUND') && !getDolGlobalInt('STRIPE_CARD_PRESENT')) { // Warning. If a payment was tried and failed, a payment intent was created. // But if we change something on object to pay (amount or other that does not change the idempotency key), reusing same payment intent is not allowed by Stripe. // Recommended solution is to recreate a new payment intent each time we need one (old one will be automatically closed by Stripe after a delay), Stripe will @@ -435,26 +435,26 @@ class Stripe extends CommonObject // list of payment method types $paymentmethodtypes = array("card"); $descriptor = dol_trunc($tag, 10, 'right', 'UTF-8', 1); - if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) { + if (getDolGlobalInt('STRIPE_SEPA_DIRECT_DEBIT')) { $paymentmethodtypes[] = "sepa_debit"; //&& ($object->thirdparty->isInEEC()) //$descriptor = preg_replace('/ref=[^:=]+/', '', $descriptor); // Clean ref } - if (!empty($conf->global->STRIPE_KLARNA)) { + if (getDolGlobalInt('STRIPE_KLARNA')) { $paymentmethodtypes[] = "klarna"; } - if (!empty($conf->global->STRIPE_BANCONTACT)) { + if (getDolGlobalInt('STRIPE_BANCONTACT')) { $paymentmethodtypes[] = "bancontact"; } - if (!empty($conf->global->STRIPE_IDEAL)) { + if (getDolGlobalInt('STRIPE_IDEAL')) { $paymentmethodtypes[] = "ideal"; } - if (!empty($conf->global->STRIPE_GIROPAY)) { + if (getDolGlobalInt('STRIPE_GIROPAY')) { $paymentmethodtypes[] = "giropay"; } - if (!empty($conf->global->STRIPE_SOFORT)) { + if (getDolGlobalInt('STRIPE_SOFORT')) { $paymentmethodtypes[] = "sofort"; } - if (!empty($conf->global->STRIPE_CARD_PRESENT) && $mode == 'terminal') { + if (getDolGlobalInt('STRIPE_CARD_PRESENT') && $mode == 'terminal') { $paymentmethodtypes = array("card_present"); } @@ -484,13 +484,13 @@ class Stripe extends CommonObject //$dataforintent["setup_future_usage"] = "off_session"; $dataforintent["off_session"] = true; } - if (!empty($conf->global->STRIPE_GIROPAY)) { + if (getDolGlobalInt('STRIPE_GIROPAY')) { unset($dataforintent['setup_future_usage']); } - if (!empty($conf->global->STRIPE_KLARNA)) { + if (getDolGlobalInt('STRIPE_KLARNA')) { unset($dataforintent['setup_future_usage']); } - if (!empty($conf->global->STRIPE_CARD_PRESENT) && $mode == 'terminal') { + if (getDolGlobalInt('STRIPE_CARD_PRESENT') && $mode == 'terminal') { unset($dataforintent['setup_future_usage']); $dataforintent["capture_method"] = "manual"; $dataforintent["confirmation_method"] = "manual"; @@ -500,7 +500,7 @@ class Stripe extends CommonObject $description .= ' - '.$payment_method; } - if ($conf->entity != $conf->global->STRIPECONNECT_PRINCIPAL && $stripefee > 0) { + if ($conf->entity != getDolGlobalInt('STRIPECONNECT_PRINCIPAL') && $stripefee > 0) { $dataforintent["application_fee_amount"] = $stripefee; } if ($usethirdpartyemailforreceiptemail && is_object($object) && $object->thirdparty->email) {