1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 17:01:33 +02:00

Merge pull request #5910 from turbo124/v5-develop

Fixes for subscriptions
This commit is contained in:
David Bomba 2021-06-04 07:44:06 +10:00 committed by GitHub
commit f94dbb9534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 15 deletions

View File

@ -389,12 +389,9 @@ class BillingPortalPurchase extends Component
$is_eligible = $this->subscription->service()->isEligible($this->contact); $is_eligible = $this->subscription->service()->isEligible($this->contact);
if($is_eligible){ if ($is_eligible['status_code'] != 200) {
}
elseif ($is_eligible['status_code'] != 200) {
$this->steps['not_eligible'] = true; $this->steps['not_eligible'] = true;
$this->steps['not_eligible_message'] = $is_eligible['exception']['message']; $this->steps['not_eligible_message'] = $is_eligible['message'];
$this->steps['show_loading_bar'] = false; $this->steps['show_loading_bar'] = false;
return; return;

View File

@ -44,7 +44,7 @@ class SchedulerCheck implements ShouldQueue
{ {
try { try {
Artisan::call('migrate', ['--force' => 'true']); Artisan::call('migrate', ['--force' => true]);
} catch (\Exception $e) { } catch (\Exception $e) {
nlog("I wasn't able to migrate the data."); nlog("I wasn't able to migrate the data.");
nlog($e->getMessage()); nlog($e->getMessage());

View File

@ -57,9 +57,9 @@ class UpdateUserLastLogin implements ShouldQueue
if($user->ip != $ip) if($user->ip != $ip)
{ {
$nmo = new NinjaMailerObject; $nmo = new NinjaMailerObject;
$nmo->mailable = new UserLoggedIn($user, $user->account->companies()->first(), $ip); $nmo->mailable = new UserLoggedIn($user, $user->account->companies->first(), $ip);
$nmo->company = $user->account->companies()->first(); $nmo->company = $user->account->companies->first();
$nmo->settings = $user->account->companies()->first()->settings; $nmo->settings = $user->account->companies->first()->settings;
$nmo->to_user = $user; $nmo->to_user = $user;
NinjaMailerJob::dispatch($nmo); NinjaMailerJob::dispatch($nmo);

View File

@ -133,7 +133,7 @@ class Company extends BaseModel
public function all_documents() public function all_documents()
{ {
return $this->HasMany(Document::class); return $this->hasMany(Document::class);
} }
public function getEntityType() public function getEntityType()

View File

@ -631,7 +631,7 @@ class SubscriptionService
public function triggerWebhook($context) public function triggerWebhook($context)
{ {
if (empty($this->subscription->webhook_configuration['post_purchase_url']) || empty($this->subscription->webhook_configuration['post_purchase_rest_method'])) { if (empty($this->subscription->webhook_configuration['post_purchase_url']) || empty($this->subscription->webhook_configuration['post_purchase_rest_method'])) {
return ['status_code' => 200]; return ["message" => "Success", "status_code" => 200];
} }
$response = false; $response = false;
@ -652,10 +652,7 @@ class SubscriptionService
} }
else { else {
$status = $response->getStatusCode(); $body = $response->getStatusCode();
//$response_body = $response->getReasonPhrase();
//$body = array_merge($body, ['status' => $status, 'response_body' => $response_body]);
} }