Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Jan 29, 2020
2 parents 7b10c24 + d49534e commit 4b0ca24
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/class/extrafields.class.php
Expand Up @@ -1466,7 +1466,7 @@ public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $
}

// 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 {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/main.inc.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -1497,7 +1497,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print '<!-- Includes JS added by page -->'."\n";
foreach ($arrayofjs as $jsfile)
{
if (preg_match('/^http/i', $jsfile))
if (preg_match('/^(http|\/\/)/i', $jsfile))
{
print '<script src="'.$jsfile.'"></script>'."\n";
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/public/payment/newpayment.php
Expand Up @@ -484,7 +484,7 @@
'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))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/stripe/admin/stripe.php
Expand Up @@ -165,7 +165,7 @@

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 '<span class="opacitymedium">'.$langs->trans("StripeDesc")."</span><br>\n";

Expand Down
11 changes: 6 additions & 5 deletions htdocs/stripe/class/stripe.class.php
Expand Up @@ -416,7 +416,8 @@ public function getPaymentIntent($amount, $currency_code, $tag, $description = '
"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
);
Expand Down Expand Up @@ -933,7 +934,7 @@ public function createPaymentStripe($amount, $currency, $origin, $item, $source,
$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,
Expand All @@ -943,7 +944,7 @@ public function createPaymentStripe($amount, $currency, $origin, $item, $source,
$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,
Expand All @@ -970,10 +971,10 @@ public function createPaymentStripe($amount, $currency, $origin, $item, $source,
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,
Expand Down
2 changes: 1 addition & 1 deletion htdocs/stripe/config.php
Expand Up @@ -55,4 +55,4 @@

\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

0 comments on commit 4b0ca24

Please sign in to comment.