1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00
This commit is contained in:
Benjamin Beganović 2021-03-20 23:15:26 +01:00
parent ada49ca083
commit fdd1601120
2 changed files with 7 additions and 1 deletions

View File

@ -133,6 +133,7 @@ class BillingPortalPurchase extends Component
'client_contact_id' => $this->contact->hashed_id,
]],
'user_input_promo_code' => $this->coupon,
'coupon' => $this->coupon,
'quantity' => 1, // Option to increase quantity
];
@ -144,6 +145,7 @@ class BillingPortalPurchase extends Component
->save();
Cache::put($this->hash, [
'billing_subscription_id' => $this->billing_subscription->id,
'email' => $this->email ?? $this->contact->email,
'client_id' => $this->contact->client->id,
'invoice_id' => $this->invoice->id],

View File

@ -241,7 +241,11 @@ class BaseDriver extends AbstractPaymentDriver
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));
(new BillingSubscriptionService)->completePurchase($this->payment_hash);
// if (property_exists($this->payment_hash->data, 'billing_context')) {
// $billing_subscription = \App\Models\BillingSubscription::find($this->payment_hash->data->billing_context->billing_subscription_id);
//
// (new BillingSubscriptionService($billing_subscription))->completePurchase($this->payment_hash);
// }
return $payment->service()->applyNumber()->save();
}