mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for creating an account using OAuth
This commit is contained in:
parent
fb17dd7e0b
commit
e76567f337
@ -65,7 +65,7 @@ class CheckData extends Command
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ninja:check-data {--database=} {--fix=}';
|
||||
protected $signature = 'ninja:check-data {--database=} {--fix=} {--client_id=}';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
@ -449,7 +449,7 @@ class LoginController extends BaseController
|
||||
|
||||
MultiDB::setDefaultDatabase();
|
||||
|
||||
$account = CreateAccount::dispatchNow($new_account);
|
||||
$account = CreateAccount::dispatchNow($new_account, request()->getClientIp());
|
||||
|
||||
Auth::login($account->default_company->owner(), true);
|
||||
|
||||
|
@ -347,68 +347,4 @@ class AutoBillInvoice extends AbstractService
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes any existing unpaid gateway fees
|
||||
* due to previous payment failure.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
// private function purgeStaleGatewayFees()
|
||||
// {
|
||||
// $starting_amount = $this->invoice->amount;
|
||||
|
||||
// $line_items = $this->invoice->line_items;
|
||||
|
||||
// $new_items = [];
|
||||
|
||||
// foreach($line_items as $item)
|
||||
// {
|
||||
|
||||
// if($item->type_id != 3)
|
||||
// $new_items[] = $item;
|
||||
|
||||
// }
|
||||
|
||||
// $this->invoice->line_items = $new_items;
|
||||
// $this->invoice->save();
|
||||
|
||||
// $this->invoice = $this->invoice->calc()->getInvoice();
|
||||
|
||||
// if($starting_amount != $this->invoice->amount && $this->invoice->status_id != Invoice::STATUS_DRAFT){
|
||||
// $this->invoice->client->service()->updateBalance($this->invoice->amount - $starting_amount)->save();
|
||||
// $this->invoice->ledger()->updateInvoiceBalance($this->invoice->amount - $starting_amount, 'Invoice balance updated after stale gateway fee removed')->save();
|
||||
// }
|
||||
|
||||
// return $this;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Checks whether a given gateway token is able
|
||||
// * to process the payment after passing through the
|
||||
// * fees and limits check.
|
||||
// *
|
||||
// * @param CompanyGateway $cg The CompanyGateway instance
|
||||
// * @param float $amount The amount to be paid
|
||||
// * @return bool
|
||||
// */
|
||||
// public function validGatewayLimits($cg, $amount) : bool
|
||||
// {
|
||||
// if (isset($cg->fees_and_limits)) {
|
||||
// $fees_and_limits = $cg->fees_and_limits->{'1'};
|
||||
// } else {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// if ((property_exists($fees_and_limits, 'min_limit')) && $fees_and_limits->min_limit !== null && $amount < $fees_and_limits->min_limit) {
|
||||
// info("amount {$amount} less than ".$fees_and_limits->min_limit);
|
||||
// $passes = false;
|
||||
// } elseif ((property_exists($fees_and_limits, 'max_limit')) && $fees_and_limits->max_limit !== null && $amount > $fees_and_limits->max_limit) {
|
||||
// info("amount {$amount} greater than ".$fees_and_limits->max_limit);
|
||||
// $passes = false;
|
||||
// } else {
|
||||
// $passes = true;
|
||||
// }
|
||||
|
||||
// return $passes;
|
||||
// }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user