mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-21 00:41:34 +02:00
wip
This commit is contained in:
parent
ada49ca083
commit
fdd1601120
@ -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],
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user