Clean code
This commit is contained in:
parent
511b19d27b
commit
4616d2b9e6
@ -1125,6 +1125,7 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$regs = array();
|
||||||
preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs); // Take part before '?'
|
preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs); // Take part before '?'
|
||||||
if (!empty($regs[1])) {
|
if (!empty($regs[1])) {
|
||||||
//print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n";
|
//print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n";
|
||||||
|
|||||||
@ -232,8 +232,11 @@ if (empty($conf->stripeconnect->enabled)) {
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.getDolGlobalString('STRIPE_TEST_WEBHOOK_KEY').'" placeholder="'.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
|
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.getDolGlobalString('STRIPE_TEST_WEBHOOK_KEY').'" placeholder="'.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
|
||||||
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForTestWebhook").'</span> ';
|
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForTestWebhook").'</span> ';
|
||||||
$url = dol_buildpath('/public/stripe/ipn.php?test', 3);
|
$url = dol_buildpath('/public/stripe/ipn.php', 3);
|
||||||
|
$url .= '?test=1';
|
||||||
|
//global $dolibarr_main_instance_unique_id;
|
||||||
|
//$url .= '&securitykey='.dol_hash('stripeipn-'.$dolibarr_main_instance_unique_id.'-'.$conf->global->STRIPE_TEST_PUBLISHABLE_KEY, 'md5');
|
||||||
$out .= '<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.'" disabled>';
|
$out .= '<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.'" disabled>';
|
||||||
$out .= ajax_autoselect("onlinetestwebhookurl", 0);
|
$out .= ajax_autoselect("onlinetestwebhookurl", 0);
|
||||||
print '<br>'.$out;
|
print '<br>'.$out;
|
||||||
@ -250,7 +253,7 @@ if (empty($conf->stripeconnect->enabled)) {
|
|||||||
$endpoint->disabled = false;
|
$endpoint->disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$endpoint->url = dol_buildpath('/public/stripe/ipn.php?test', 3);
|
$endpoint->url = $url;
|
||||||
$endpoint->save();
|
$endpoint->save();
|
||||||
if ($endpoint->status == 'enabled') {
|
if ($endpoint->status == 'enabled') {
|
||||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=ipn&webhook='.$endpoint->id.'&status=0">';
|
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=ipn&webhook='.$endpoint->id.'&status=0">';
|
||||||
@ -296,6 +299,8 @@ if (empty($conf->stripeconnect->enabled)) {
|
|||||||
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.getDolGlobalString('STRIPE_LIVE_WEBHOOK_KEY').'" placeholder="'.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
|
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.getDolGlobalString('STRIPE_LIVE_WEBHOOK_KEY').'" placeholder="'.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
|
||||||
$out = img_picto('', 'globe', 'class="pictofixedwidth"').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForLiveWebhook").'</span> ';
|
$out = img_picto('', 'globe', 'class="pictofixedwidth"').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForLiveWebhook").'</span> ';
|
||||||
$url = dol_buildpath('/public/stripe/ipn.php', 3);
|
$url = dol_buildpath('/public/stripe/ipn.php', 3);
|
||||||
|
//global $dolibarr_main_instance_unique_id;
|
||||||
|
//$url .= '?securitykey='.dol_hash('stripeipn-'.$dolibarr_main_instance_unique_id.'-'.$conf->global->STRIPE_LIVE_PUBLISHABLE_KEY, 'md5');
|
||||||
$out .= '<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="'.$url.'" disabled>';
|
$out .= '<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="'.$url.'" disabled>';
|
||||||
$out .= ajax_autoselect("onlinelivewebhookurl", 0);
|
$out .= ajax_autoselect("onlinelivewebhookurl", 0);
|
||||||
print '<br>'.$out;
|
print '<br>'.$out;
|
||||||
@ -312,7 +317,7 @@ if (empty($conf->stripeconnect->enabled)) {
|
|||||||
$endpoint->disabled = false;
|
$endpoint->disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$endpoint->url = dol_buildpath('/public/stripe/ipn.php', 3);
|
$endpoint->url = $url;
|
||||||
$endpoint->save();
|
$endpoint->save();
|
||||||
if ($endpoint->status == 'enabled') {
|
if ($endpoint->status == 'enabled') {
|
||||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=ipn&webhook='.$endpoint->id.'&status=0">';
|
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=ipn&webhook='.$endpoint->id.'&status=0">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user