From 83c636aa55eb141256b45d8a7dc03efe8f535deb Mon Sep 17 00:00:00 2001 From: = Date: Sat, 27 Mar 2021 09:05:37 +1100 Subject: [PATCH] update todos --- .../Subscription/SubscriptionService.php | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index dd0f8be3fac4..66d9c2f5b5a6 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -51,13 +51,8 @@ class SubscriptionService throw new \Exception("Illegal entrypoint into method, payload must contain billing context"); } - // At this point we have some state carried from the billing page - // to this, available as $payment_hash->data->billing_context. Make something awesome ⭐ - - // create client subscription record - // - // create recurring invoice if is_recurring - // + // if we have a recurring product - then generate a recurring invoice + // if trial is enabled, generate the recurring invoice to fire when the trial ends. } @@ -166,30 +161,31 @@ class SubscriptionService // } + //@todo - need refactor public function triggerWebhook() { //hit the webhook to after a successful onboarding - $body = [ - 'subscription' => $this->subscription, - 'client_subscription' => $this->client_subscription, - 'client' => $this->client_subscription->client->toArray(), - ]; + // $body = [ + // 'subscription' => $this->subscription, + // 'client_subscription' => $this->client_subscription, + // 'client' => $this->client_subscription->client->toArray(), + // ]; - $client = new \GuzzleHttp\Client(['headers' => $this->subscription->webhook_configuration->post_purchase_headers]); + // $client = new \GuzzleHttp\Client(['headers' => $this->subscription->webhook_configuration->post_purchase_headers]); - $response = $client->{$this->subscription->webhook_configuration->post_purchase_rest_method}($this->subscription->post_purchase_url,[ - RequestOptions::JSON => ['body' => $body] - ]); + // $response = $client->{$this->subscription->webhook_configuration->post_purchase_rest_method}($this->subscription->post_purchase_url,[ + // RequestOptions::JSON => ['body' => $body] + // ]); - SystemLogger::dispatch( - $body, - SystemLog::CATEGORY_WEBHOOK, - SystemLog::EVENT_WEBHOOK_RESPONSE, - SystemLog::TYPE_WEBHOOK_RESPONSE, - $this->client_subscription->client, - ); + // SystemLogger::dispatch( + // $body, + // SystemLog::CATEGORY_WEBHOOK, + // SystemLog::EVENT_WEBHOOK_RESPONSE, + // SystemLog::TYPE_WEBHOOK_RESPONSE, + // $this->client_subscription->client, + // ); }