mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:04:30 -04:00
Add UTM to billing portal purchase
This commit is contained in:
parent
3e46aad567
commit
d05b41e452
@ -405,6 +405,8 @@ class BillingPortalPurchase extends Component
|
|||||||
$context = 'whitelabel';
|
$context = 'whitelabel';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$utm = isset($this->request_data['utm']) ? $this->request_data['utm'] : null;
|
||||||
|
|
||||||
Cache::put($this->hash, [
|
Cache::put($this->hash, [
|
||||||
'subscription_id' => $this->subscription->hashed_id,
|
'subscription_id' => $this->subscription->hashed_id,
|
||||||
'email' => $this->email ?? $this->contact->email,
|
'email' => $this->email ?? $this->contact->email,
|
||||||
@ -412,6 +414,7 @@ class BillingPortalPurchase extends Component
|
|||||||
'invoice_id' => $this->invoice->hashed_id,
|
'invoice_id' => $this->invoice->hashed_id,
|
||||||
'context' => $context,
|
'context' => $context,
|
||||||
'campaign' => $this->campaign,
|
'campaign' => $this->campaign,
|
||||||
|
'utm' => $utm,
|
||||||
], now()->addMinutes(60));
|
], now()->addMinutes(60));
|
||||||
|
|
||||||
$this->emit('beforePaymentEventsCompleted');
|
$this->emit('beforePaymentEventsCompleted');
|
||||||
|
@ -381,7 +381,6 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
* When a successful payment is made, we need to append the gateway fee
|
* When a successful payment is made, we need to append the gateway fee
|
||||||
* to an invoice.
|
* to an invoice.
|
||||||
*
|
*
|
||||||
* @param PaymentResponseRequest $request The incoming payment request
|
|
||||||
* @return void Success/Failure
|
* @return void Success/Failure
|
||||||
*/
|
*/
|
||||||
public function confirmGatewayFee() :void
|
public function confirmGatewayFee() :void
|
||||||
@ -395,7 +394,7 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
/*Hydrate invoices*/
|
/*Hydrate invoices*/
|
||||||
$invoices = Invoice::whereIn('id', $this->transformKeys(array_column($payment_invoices, 'invoice_id')))->withTrashed()->get();
|
$invoices = Invoice::whereIn('id', $this->transformKeys(array_column($payment_invoices, 'invoice_id')))->withTrashed()->get();
|
||||||
|
|
||||||
$invoices->each(function ($invoice) use ($fee_total) {
|
$invoices->each(function ($invoice) {
|
||||||
if (collect($invoice->line_items)->contains('type_id', '3')) {
|
if (collect($invoice->line_items)->contains('type_id', '3')) {
|
||||||
$invoice->service()->toggleFeesPaid()->save();
|
$invoice->service()->toggleFeesPaid()->save();
|
||||||
}
|
}
|
||||||
@ -421,7 +420,6 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
/**
|
/**
|
||||||
* Return the contact if possible.
|
* Return the contact if possible.
|
||||||
*
|
*
|
||||||
* @return ClientContact The ClientContact object
|
|
||||||
*/
|
*/
|
||||||
public function getContact()
|
public function getContact()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user