mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Working on tests
This commit is contained in:
parent
bff526ade2
commit
9b9a27a38b
@ -254,13 +254,17 @@ class BasePaymentDriver
|
||||
|
||||
protected function gateway()
|
||||
{
|
||||
\Log::info('gateway...');
|
||||
if ($this->gateway) {
|
||||
\Log::info('g1');
|
||||
return $this->gateway;
|
||||
}
|
||||
|
||||
\Log::info('g2: ' . $this->accountGateway->gateway->provider);
|
||||
$this->gateway = Omnipay::create($this->accountGateway->gateway->provider);
|
||||
\Log::info('g3');
|
||||
$this->gateway->initialize((array) $this->accountGateway->getConfig());
|
||||
|
||||
\Log::info('g4');
|
||||
return $this->gateway;
|
||||
}
|
||||
|
||||
@ -269,13 +273,10 @@ class BasePaymentDriver
|
||||
\Log::info('completeOnsitePurchase...');
|
||||
$this->input = count($input) ? $input : false;
|
||||
$gateway = $this->gateway();
|
||||
\Log::info('CP: 1');
|
||||
|
||||
if ($input) {
|
||||
\Log::info('CP: 2');
|
||||
$this->updateClient();
|
||||
\Log::info('CP: 3');
|
||||
}
|
||||
\Log::info('CP: 4');
|
||||
|
||||
// load or create token
|
||||
if ($this->isGatewayType(GATEWAY_TYPE_TOKEN)) {
|
||||
|
@ -32,6 +32,10 @@ class AccountRepository
|
||||
public function create($firstName = '', $lastName = '', $email = '', $password = '', $company = false)
|
||||
{
|
||||
if (! $company) {
|
||||
if (Utils::isNinja()) {
|
||||
$this->checkForSpammer();
|
||||
}
|
||||
|
||||
$company = new Company();
|
||||
$company->utm_source = Input::get('utm_source');
|
||||
$company->utm_medium = Input::get('utm_medium');
|
||||
@ -122,6 +126,15 @@ class AccountRepository
|
||||
return $account;
|
||||
}
|
||||
|
||||
private function checkForSpammer()
|
||||
{
|
||||
$count = Account::whereIp(Request::getClientIp())->count();
|
||||
|
||||
if ($count > 1) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getSearchData($user)
|
||||
{
|
||||
$data = $this->getAccountSearchData($user);
|
||||
|
@ -137,9 +137,10 @@ class PaymentService extends BaseService
|
||||
try {
|
||||
return $paymentDriver->completeOnsitePurchase(false, $paymentMethod);
|
||||
} catch (Exception $exception) {
|
||||
if (! Auth::check()) {
|
||||
$subject = trans('texts.auto_bill_failed', ['invoice_number' => $invoice->invoice_number]);
|
||||
$message = sprintf('%s: %s', ucwords($paymentDriver->providerName()), $exception->getMessage());
|
||||
Utils::logError($message, 'PHP', true);
|
||||
if (! Auth::check()) {
|
||||
$mailer = app('App\Ninja\Mailers\UserMailer');
|
||||
$mailer->sendMessage($invoice->user, $subject, $message, [
|
||||
'invoice' => $invoice
|
||||
|
Loading…
Reference in New Issue
Block a user