Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
4b0ca24ca3
@ -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 {
|
||||
|
||||
@ -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 '<!-- 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";
|
||||
}
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -165,7 +165,7 @@ print '<input type="hidden" name="action" value="setvalue">';
|
||||
|
||||
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";
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user