From 7cb68d6438530e80f8aa6270b34baeb6fb016b85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Aug 2019 18:02:10 +0200 Subject: [PATCH] NEW Default for Stripe is STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION --- htdocs/core/class/conf.class.php | 4 ++-- htdocs/public/payment/newpayment.php | 32 +++++++++++++++++----------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index d64033d969d..f94c95ff246 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -569,8 +569,8 @@ class Conf // By default, we show state code in combo list if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1; - // Use a SCA ready workflow with Stripe module - if (! isset($this->global->STRIPE_USE_NEW_CHECKOUT)) $this->global->STRIPE_USE_NEW_CHECKOUT=1; + // Use a SCA ready workflow with Stripe module (STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION by default if nothing defined) + if (! isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) $this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION=1; // Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal" if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later. diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index daf77674190..db37b15345b 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1834,7 +1834,8 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment print '
'; - print '
'; + print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; @@ -1852,7 +1853,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment print ''; print ''; - if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($conf->global->STRIPE_USE_NEW_CHECKOUT)) + if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($conf->global->STRIPE_USE_NEW_CHECKOUT)) // Use a SCA ready method { require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; @@ -1876,8 +1877,8 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment } } - if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($paymentintent)) - { + //if (empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) || ! empty($paymentintent)) + //{ print '
'; @@ -1914,7 +1915,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment print '
'; - } + //} if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) { @@ -1942,6 +1943,8 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment { print ''; print ''."\n"; + $urllogofull = 'http://home.destailleur.fr:805/dolibarr_dev/htdocs/viewimage.php?modulepart=mycompany&entity=1&file=logos%2Fthumbs%2Ffbm+logo_small.png'; + print ''."\n"; // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code. print '