remove superfluous spaces

This commit is contained in:
Frédéric FRANCE 2018-08-13 09:00:22 +02:00
parent 1b27cca91c
commit 5d0d8d10fc
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
2 changed files with 34 additions and 35 deletions

View File

@ -131,7 +131,7 @@ else if (GETPOST('downloadcsv','alpha'))
{
// Make the first fetch to get first line
$obj = $db->fetch_object($res);
if ($obj)
if ($obj)
{
$previoushash = $block_static->getPreviousHash(0, $obj->rowid);
$firstid = $obj->rowid;

View File

@ -40,13 +40,13 @@ if (isset($_GET['connect'])){
{
$endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_CONNECT_KEY;
$service = 'StripeTest';
$servicestatus = 0;
$servicestatus = 0;
}
else
{
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY;
$service = 'StripeLive';
$servicestatus = 1;
$servicestatus = 1;
}
}
else {
@ -54,13 +54,13 @@ else {
{
$endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_KEY;
$service = 'StripeTest';
$servicestatus = 0;
$servicestatus = 0;
}
else
{
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY;
$service = 'StripeLive';
$servicestatus = 1;
$servicestatus = 1;
}
}
$payload = @file_get_contents("php://input");
@ -228,35 +228,35 @@ elseif ($event->type == 'charge.failed') {
}
elseif (($event->type == 'source.chargeable') && ($event->data->object->type == 'three_d_secure') && ($event->data->object->three_d_secure->authenticated==true)) {
$fulltag=$event->data->object->metadata->FULLTAG;
$fulltag=$event->data->object->metadata->FULLTAG;
// Save into $tmptag all metadata
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
if (! empty($tmptag['ORD'])){
$order=new Commande($db);
$order->fetch('',$tmptag['ORD']);
$origin='order';
$item=$order->id;
} elseif (! empty($tmptag['INV'])) {
$invoice = new Facture($db);
$invoice->fetch('',$tmptag['INV']);
$origin='invoice';
$item=$invoice->id;
}
$stripe=new Stripe($db);
$stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here)
$stripecu = $stripe->getStripeCustomerAccount($tmptag['CUS'], $servicestatus); // Get thirdparty cu_...
if (! empty($tmptag['ORD'])) {
$order=new Commande($db);
$order->fetch('',$tmptag['ORD']);
$origin='order';
$item=$order->id;
} elseif (! empty($tmptag['INV'])) {
$invoice = new Facture($db);
$invoice->fetch('',$tmptag['INV']);
$origin='invoice';
$item=$invoice->id;
}
$stripe=new Stripe($db);
$stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here)
$stripecu = $stripe->getStripeCustomerAccount($tmptag['CUS'], $servicestatus); // Get thirdparty cu_...
$charge=$stripe->createPaymentStripe($event->data->object->amount/100,$event->data->object->currency,$origin,$item,$event->data->object->id,$stripecu,$stripeacc,$servicestatus);
if (isset($charge->id) && $charge->statut=='error'){
if (isset($charge->id) && $charge->statut=='error') {
$msg=$charge->message;
$code=$charge->code;
$error++;
}
}
elseif (isset($charge->id) && $charge->statut=='success' && (! empty($tmptag['ORD']))) {
//$order=new Commande($db);
//$order->fetch('',$tmptag['ORD']);
//$order=new Commande($db);
//$order->fetch('',$tmptag['ORD']);
$invoice = new Facture($db);
$idinv=$invoice->createFromOrder($order,$user);
@ -272,17 +272,17 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type ==
$ifverif=$invoice->socid;
$currency=$invoice->multicurrency_code;
$total=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
}else{
} else {
$msg=$invoice->error;
$error++;
}
}else{
} else {
$msg=$invoice->error;
$error++;
}
}
if (!$error){
if (!$error) {
$datepaye = dol_now();
$paymentType ="CB";
$amounts=array();
@ -298,10 +298,10 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type ==
$paiement->note = '';
}
if (! $error){
if (! $error) {
$paiement_id=$paiement->create($user, 0);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($invoice->lines)){
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($invoice->lines)) {
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
@ -315,17 +315,17 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type ==
$invoice->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
if ($paiement_id < 0){
if ($paiement_id < 0) {
$msg=$paiement->errors;
$error++;
}else{
} else {
if ($event->data->object->metadata->source=='order') {
$order->classifyBilled($user);
}
}
}
if (! $error){
if (! $error) {
$label='(CustomerInvoicePayment)';
if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)';
$paiement->addPaymentToBank($user,'payment',$label,$conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS,'','');
@ -348,4 +348,3 @@ elseif ($event->type == 'customer.deleted') {
$db->query($sql);
$db->commit();
}