mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 23:44: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';
|
||||
}
|
||||
|
||||
$utm = isset($this->request_data['utm']) ? $this->request_data['utm'] : null;
|
||||
|
||||
Cache::put($this->hash, [
|
||||
'subscription_id' => $this->subscription->hashed_id,
|
||||
'email' => $this->email ?? $this->contact->email,
|
||||
@ -412,6 +414,7 @@ class BillingPortalPurchase extends Component
|
||||
'invoice_id' => $this->invoice->hashed_id,
|
||||
'context' => $context,
|
||||
'campaign' => $this->campaign,
|
||||
'utm' => $utm,
|
||||
], now()->addMinutes(60));
|
||||
|
||||
$this->emit('beforePaymentEventsCompleted');
|
||||
|
@ -381,7 +381,6 @@ class BaseDriver extends AbstractPaymentDriver
|
||||
* When a successful payment is made, we need to append the gateway fee
|
||||
* to an invoice.
|
||||
*
|
||||
* @param PaymentResponseRequest $request The incoming payment request
|
||||
* @return void Success/Failure
|
||||
*/
|
||||
public function confirmGatewayFee() :void
|
||||
@ -395,7 +394,7 @@ class BaseDriver extends AbstractPaymentDriver
|
||||
/*Hydrate invoices*/
|
||||
$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')) {
|
||||
$invoice->service()->toggleFeesPaid()->save();
|
||||
}
|
||||
@ -421,7 +420,6 @@ class BaseDriver extends AbstractPaymentDriver
|
||||
/**
|
||||
* Return the contact if possible.
|
||||
*
|
||||
* @return ClientContact The ClientContact object
|
||||
*/
|
||||
public function getContact()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user