From b4758295e149723b629b95a6c3d53c95c2aff749 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 21 Jan 2020 10:59:57 +0100 Subject: [PATCH 1/5] fix stripe/charge.php for connect mode with payment intent --- htdocs/stripe/charge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 9d4bf71c040..3483efcaa18 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -142,7 +142,7 @@ if (!$rowid) } if (! empty($charge->payment_intent)) { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); } // The metadata FULLTAG is defined by the online payment page From d6766af35d3e83c4d5132b8791b54c1801b2af02 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 21 Jan 2020 14:17:53 +0100 Subject: [PATCH 2/5] Fix dom and missing param --- htdocs/core/class/commonobject.class.php | 3 ++- htdocs/core/class/html.form.class.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bf39cc1e94d..d4735e4ba8d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5932,7 +5932,8 @@ abstract class CommonObject { $param_list=array_keys($param['options']); // $param_list='ObjectName:classPath' $showempty=(($required && $default != '')?0:1); - $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty); + $out=$form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam); + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { list($class,$classfile)=explode(':', $param_list[0]); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3f9a6827e49..cb46be383db 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5044,11 +5044,11 @@ class Form { if ($societe_vendeuse->id == $mysoc->id) { - $return.= ''.$langs->trans("ErrorYourCountryIsNotDefined").''; + $return.= '
'.$langs->trans("ErrorYourCountryIsNotDefined").'
'; } else { - $return.= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; + $return.= '
'.$langs->trans("ErrorSupplierCountryIsNotDefined").'
'; } return $return; } From c91ab621b848180c0954043eb0d63e0c8081dfd2 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 21 Jan 2020 17:49:27 +0100 Subject: [PATCH 3/5] FIX length, width and height coherence in product table --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 47b190ed4f7..aa6dd5e08a8 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -819,9 +819,9 @@ class Product extends CommonObject $this->height = price2num($this->height); $this->height_units = trim($this->height_units); // set unit not defined - if ($this->length_units) { $this->width_units = $this->length_units; // Not used yet + if (is_numeric($this->length_units)) { $this->width_units = $this->length_units; // Not used yet } - if ($this->length_units) { $this->height_units = $this->length_units; // Not used yet + if (is_numeric($this->length_units)) { $this->height_units = $this->length_units; // Not used yet } // Automated compute surface and volume if not filled if (empty($this->surface) && !empty($this->length) && !empty($this->width) && $this->length_units == $this->width_units) { From 443e4e22230f4c069c58d5da73e5f70076aecfa3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:44:42 +0100 Subject: [PATCH 4/5] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cb46be383db..acbd15712e5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5044,11 +5044,11 @@ class Form { if ($societe_vendeuse->id == $mysoc->id) { - $return.= '
'.$langs->trans("ErrorYourCountryIsNotDefined").'
'; + $return.= ''.$langs->trans("ErrorYourCountryIsNotDefined").''; } else { - $return.= '
'.$langs->trans("ErrorSupplierCountryIsNotDefined").'
'; + $return.= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").''; } return $return; } From 999e36344616c199a8cf5ebb3ba28831f369036e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Jan 2020 13:52:37 +0100 Subject: [PATCH 5/5] Update charge.php --- htdocs/stripe/charge.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 3483efcaa18..992b5266b5b 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -142,7 +142,11 @@ if (!$rowid) } if (! empty($charge->payment_intent)) { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + } else { + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + } } // The metadata FULLTAG is defined by the online payment page