diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 36b83bb32b7..816dde6a619 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1466,7 +1466,7 @@ class ExtraFields
}
// We have to join on extrafield table
- if (strpos($InfoFieldList[4], 'extra') !== false) {
+ if (strpos($InfoFieldList[4], 'extra.') !== false) {
$sql .= ' as main, '.MAIN_DB_PREFIX.$InfoFieldList[0].'_extrafields as extra';
$sqlwhere .= ' WHERE extra.fk_object=main.'.$InfoFieldList[2].' AND '.$InfoFieldList[4];
} else {
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index a6de7819237..041fda15ea9 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1345,7 +1345,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
{
foreach ($arrayofcss as $cssfile)
{
- if (preg_match('/^http/i', $cssfile))
+ if (preg_match('/^(http|\/\/)/i', $cssfile))
{
$urltofile = $cssfile;
}
@@ -1497,7 +1497,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print ''."\n";
foreach ($arrayofjs as $jsfile)
{
- if (preg_match('/^http/i', $jsfile))
+ if (preg_match('/^(http|\/\/)/i', $jsfile))
{
print ''."\n";
}
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 694d5b0318e..3810f18dea3 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -484,7 +484,7 @@ if ($action == 'charge' && !empty($conf->stripe->enabled))
'metadata' => $metadata,
'customer' => $customer->id,
'source' => $card,
- 'statement_descriptor' => dol_trunc($FULLTAG, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
+ 'statement_descriptor_suffix' => dol_trunc($FULLTAG, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
), array("idempotency_key" => "$FULLTAG", "stripe_account" => "$stripeacc"));
// Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...)
if (empty($charge))
diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php
index c26f1ea709c..32ee844a120 100644
--- a/htdocs/stripe/admin/stripe.php
+++ b/htdocs/stripe/admin/stripe.php
@@ -165,7 +165,7 @@ print '';
dol_fiche_head($head, 'stripeaccount', '', -1);
-$stripearrayofwebhookevents = array('payout.created', 'payout.paid', 'charge.pending', 'charge.refunded', 'charge.succeeded', 'charge.failed', 'payment_intent.succeeded', 'payment_intent.payment_failed', 'payment_method.attached', 'payment_method.updated', 'payment_method.card_automatically_updated', 'payment_method.detached', 'source.chargeable', 'customer.deleted');
+$stripearrayofwebhookevents=array('account.updated', 'payout.created', 'payout.paid', 'charge.pending', 'charge.refunded', 'charge.succeeded', 'charge.failed', 'payment_intent.succeeded', 'payment_intent.payment_failed', 'payment_method.attached', 'payment_method.updated', 'payment_method.card_automatically_updated', 'payment_method.detached', 'source.chargeable', 'customer.deleted');
print ''.$langs->trans("StripeDesc")."
\n";
diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php
index 160bb28bef3..cb57ba2a53f 100644
--- a/htdocs/stripe/class/stripe.class.php
+++ b/htdocs/stripe/class/stripe.class.php
@@ -416,7 +416,8 @@ class Stripe extends CommonObject
"currency" => $currency_code,
"payment_method_types" => array("card"),
"description" => $description,
- "statement_descriptor" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
+ "statement_descriptor_suffix" => dol_trunc($tag, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
+ //"save_payment_method" => true,
"setup_future_usage" => "on_session",
"metadata" => $metadata
);
@@ -933,7 +934,7 @@ class Stripe extends CommonObject
$charge = \Stripe\Charge::create(array(
"amount" => "$stripeamount",
"currency" => "$currency",
- "statement_descriptor" => dol_trunc($description, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
+ "statement_descriptor_suffix" => dol_trunc($description, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
"description" => "Stripe payment: ".$description,
"capture" => $capture,
"metadata" => $metadata,
@@ -943,7 +944,7 @@ class Stripe extends CommonObject
$paymentarray = array(
"amount" => "$stripeamount",
"currency" => "$currency",
- "statement_descriptor" => dol_trunc($description, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
+ "statement_descriptor_suffix" => dol_trunc($description, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
"description" => "Stripe payment: ".$description,
"capture" => $capture,
"metadata" => $metadata,
@@ -970,10 +971,10 @@ class Stripe extends CommonObject
if (!in_array($currency, $arrayzerounitcurrency)) $stripefee = round($fee * 100);
else $stripefee = round($fee);
- $paymentarray = array(
+ $paymentarray = array(
"amount" => "$stripeamount",
"currency" => "$currency",
- "statement_descriptor" => dol_trunc($description, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
+ "statement_descriptor_suffix" => dol_trunc($description, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description)
"description" => "Stripe payment: ".$description,
"capture" => $capture,
"metadata" => $metadata,
diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php
index 0226c724165..65d80f9587b 100644
--- a/htdocs/stripe/config.php
+++ b/htdocs/stripe/config.php
@@ -55,4 +55,4 @@ else
\Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
\Stripe\Stripe::setAppInfo("Dolibarr Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version
-\Stripe\Stripe::setApiVersion(empty($conf->global->STRIPE_FORCE_VERSION) ? "2019-05-16" : $conf->global->STRIPE_FORCE_VERSION); // force version API
+\Stripe\Stripe::setApiVersion(empty($conf->global->STRIPE_FORCE_VERSION) ? "2019-09-09" : $conf->global->STRIPE_FORCE_VERSION); // force version API