diff --git a/app/Jobs/Ninja/RefundCancelledAccount.php b/app/Jobs/Ninja/RefundCancelledAccount.php index 63cf508d0452..a9d86fce04cb 100644 --- a/app/Jobs/Ninja/RefundCancelledAccount.php +++ b/app/Jobs/Ninja/RefundCancelledAccount.php @@ -37,7 +37,7 @@ class RefundCancelledAccount implements ShouldQueue if(Ninja::isSelfHost() || $this->account->isFreeHostedClient()) return; - $plan_details = $account->getPlanDetails(); + $plan_details = $this->account->getPlanDetails(); /* Trial user cancelling early.... */ if($plan_details['trial_active']) diff --git a/app/Listeners/Invoice/CreateInvoiceActivity.php b/app/Listeners/Invoice/CreateInvoiceActivity.php index dc4af0a69171..18cfe2f0601e 100644 --- a/app/Listeners/Invoice/CreateInvoiceActivity.php +++ b/app/Listeners/Invoice/CreateInvoiceActivity.php @@ -48,6 +48,6 @@ class CreateInvoiceActivity implements ShouldQueue $fields->company_id = $event->invoice->company_id; $fields->activity_type_id = Activity::CREATE_INVOICE; - $this->activity_repo->save($fields, $event->invoice); + $this->activity_repo->save($fields, $event->invoice, $event->invoice->company->db); } } diff --git a/app/Repositories/ActivityRepository.php b/app/Repositories/ActivityRepository.php index 27e6eb6e85ad..311d22e7147d 100644 --- a/app/Repositories/ActivityRepository.php +++ b/app/Repositories/ActivityRepository.php @@ -11,6 +11,7 @@ namespace App\Repositories; +use App\Libraries\MultiDB; use App\Models\Activity; use App\Models\Backup; use App\Models\Client; @@ -31,8 +32,11 @@ class ActivityRepository extends BaseRepository * @param stdClass $fields The fields * @param Collection $entity The entity that you wish to have backed up (typically Invoice, Quote etc etc rather than Payment) */ - public function save($fields, $entity) + public function save($fields, $entity, $db = null) { + if($db) + MultiDB::setDB($db); + $activity = new Activity(); $activity->is_system = app()->runningInConsole(); diff --git a/composer.json b/composer.json index e15f1be0d9d7..39a99a6e92c5 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,6 @@ "livewire/livewire": "^1.0", "maennchen/zipstream-php": "^1.2", "nwidart/laravel-modules": "^6.0", - "omnipay/authorizenet": "3.x@dev", "omnipay/paypal": "^3.0", "omnipay/stripe": "^3.0", "predis/predis": "^1.1", diff --git a/routes/web.php b/routes/web.php index 715474d059a9..76310915a83e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -33,3 +33,5 @@ Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('passw Route::group(['middleware' => ['url_db']], function () { Route::get('/user/confirm/{confirmation_code}', 'UserController@confirm'); }); + +Route::post('payment_webhook/{company_key}/{$gateway_id}'); \ No newline at end of file