mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for trials in subscriptions
This commit is contained in:
parent
e682017cf4
commit
9db0159b06
@ -425,8 +425,8 @@ class BillingPortalPurchase extends Component
|
|||||||
return $this->subscription->service()->startTrial([
|
return $this->subscription->service()->startTrial([
|
||||||
'email' => $this->email ?? $this->contact->email,
|
'email' => $this->email ?? $this->contact->email,
|
||||||
'quantity' => $this->quantity,
|
'quantity' => $this->quantity,
|
||||||
'contact_id' => $this->contact->id,
|
'contact_id' => $this->contact->hashed_id,
|
||||||
'client_id' => $this->contact->client->id,
|
'client_id' => $this->contact->client->hashed_id,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,9 +230,9 @@ class SubscriptionService
|
|||||||
- we then return the user to either a predefined user endpoint, OR we return the user to the recurring invoice page.
|
- we then return the user to either a predefined user endpoint, OR we return the user to the recurring invoice page.
|
||||||
*/
|
*/
|
||||||
public function startTrial(array $data)
|
public function startTrial(array $data)
|
||||||
{nlog($data);
|
{
|
||||||
// Redirects from here work just fine. Livewire will respect it.
|
// Redirects from here work just fine. Livewire will respect it.
|
||||||
$client_contact = ClientContact::find($data['contact_id']);
|
$client_contact = ClientContact::find($this->decodePrimaryKey($data['contact_id']));
|
||||||
|
|
||||||
if (!$this->subscription->trial_enabled) {
|
if (!$this->subscription->trial_enabled) {
|
||||||
return new \Exception("Trials are disabled for this product");
|
return new \Exception("Trials are disabled for this product");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user