mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 08:04:40 -04:00
Passing data about campaign into billing components
This commit is contained in:
parent
c7739e64ec
commit
f64b0b3d19
@ -162,6 +162,13 @@ class BillingPortalPurchase extends Component
|
|||||||
*/
|
*/
|
||||||
public $passwordless_login_btn = false;
|
public $passwordless_login_btn = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Campaign reference.
|
||||||
|
*
|
||||||
|
* @var string|null
|
||||||
|
*/
|
||||||
|
public $campaign;
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
$this->price = $this->subscription->price;
|
$this->price = $this->subscription->price;
|
||||||
@ -332,7 +339,7 @@ class BillingPortalPurchase extends Component
|
|||||||
|
|
||||||
$is_eligible = $this->subscription->service()->isEligible($this->contact);
|
$is_eligible = $this->subscription->service()->isEligible($this->contact);
|
||||||
|
|
||||||
if ($is_eligible['exception']['message'] != 'Success') {
|
if (is_array($is_eligible) && $is_eligible['exception']['message'] != 'Success') {
|
||||||
$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['exception']['message'];
|
||||||
$this->steps['show_loading_bar'] = false;
|
$this->steps['show_loading_bar'] = false;
|
||||||
@ -346,8 +353,8 @@ class BillingPortalPurchase extends Component
|
|||||||
'client_id' => $this->contact->client->id,
|
'client_id' => $this->contact->client->id,
|
||||||
'invoice_id' => $this->invoice->id,
|
'invoice_id' => $this->invoice->id,
|
||||||
'context' => 'purchase',
|
'context' => 'purchase',
|
||||||
now()->addMinutes(60)]
|
'campaign' => $this->campaign,
|
||||||
);
|
], now()->addMinutes(60));
|
||||||
|
|
||||||
$this->emit('beforePaymentEventsCompleted');
|
$this->emit('beforePaymentEventsCompleted');
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
@section('meta_title', ctrans('texts.purchase'))
|
@section('meta_title', ctrans('texts.purchase'))
|
||||||
|
|
||||||
@section('body')
|
@section('body')
|
||||||
@livewire('billing-portal-purchase', ['subscription' => $subscription, 'contact' => auth('contact')->user(), 'hash' => $hash, 'request_data' => $request_data])
|
@livewire('billing-portal-purchase', ['subscription' => $subscription, 'contact' => auth('contact')->user(), 'hash' => $hash, 'request_data' => $request_data, 'campaign' => request()->query('campaign') ?? null])
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
@push('footer')
|
@push('footer')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user