Updating subscriptions

This commit is contained in:
David Bomba 2021-07-15 14:35:22 +10:00
parent 97885557bd
commit 7c83f9d04e
3 changed files with 173 additions and 13491 deletions

View File

@ -97,8 +97,6 @@ class SubscriptionService
$response = $this->triggerWebhook($context); $response = $this->triggerWebhook($context);
// nlog($response);
$this->handleRedirect('/client/recurring_invoices/'.$recurring_invoice->hashed_id); $this->handleRedirect('/client/recurring_invoices/'.$recurring_invoice->hashed_id);
} }
@ -523,7 +521,8 @@ class SubscriptionService
*/ */
private function handlePlanChange($payment_hash) private function handlePlanChange($payment_hash)
{ {
nlog("handle plan change"); nlog("handle plan change");
$old_recurring_invoice = RecurringInvoice::find($payment_hash->data->billing_context->recurring_invoice); $old_recurring_invoice = RecurringInvoice::find($payment_hash->data->billing_context->recurring_invoice);
$recurring_invoice = $this->createNewRecurringInvoice($old_recurring_invoice); $recurring_invoice = $this->createNewRecurringInvoice($old_recurring_invoice);
@ -916,10 +915,8 @@ nlog("handle plan change");
public function planPaid($invoice) public function planPaid($invoice)
{ {
nlog("this is a plan that has been paid");
$recurring_invoice_hashed_id = $invoice->recurring_invoice()->exists() ? $invoice->recurring_invoice->hashed_id : null; $recurring_invoice_hashed_id = $invoice->recurring_invoice()->exists() ? $invoice->recurring_invoice->hashed_id : null;
$context = [ $context = [
'context' => 'plan_paid', 'context' => 'plan_paid',
'subscription' => $this->subscription->hashed_id, 'subscription' => $this->subscription->hashed_id,
@ -928,12 +925,8 @@ nlog("handle plan change");
'contact' => $invoice->client->primary_contact()->first()->hashed_id, 'contact' => $invoice->client->primary_contact()->first()->hashed_id,
]; ];
nlog($context);
$response = $this->triggerWebhook($context); $response = $this->triggerWebhook($context);
nlog($response);
return true; return true;
} }
} }

13643
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,9 +11,9 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/compat-data": "7.9.0", "@babel/compat-data": "7.9.0",
"@babel/plugin-proposal-class-properties": "^7.13.0", "@babel/plugin-proposal-class-properties": "^7.14.5",
"laravel-mix-purgecss": "^5.0.0", "laravel-mix-purgecss": "^5.0.0",
"vue-template-compiler": "^2.6.12" "vue-template-compiler": "^2.6.14"
}, },
"dependencies": { "dependencies": {
"@tailwindcss/ui": "^0.7", "@tailwindcss/ui": "^0.7",
@ -25,8 +25,8 @@
"laravel-mix": "^5.0.9", "laravel-mix": "^5.0.9",
"linkify-urls": "^3.1.1", "linkify-urls": "^3.1.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"resolve-url-loader": "^3.1.3", "resolve-url-loader": "^3.1.4",
"sass": "^1.32.13", "sass": "^1.35.2",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"tailwindcss": "^1.9.6" "tailwindcss": "^1.9.6"
} }