Fixes for subscriptions

This commit is contained in:
David Bomba 2021-06-04 07:43:22 +10:00
parent d6f1caef73
commit fd3993d84e
2 changed files with 4 additions and 10 deletions

View File

@ -389,12 +389,9 @@ class BillingPortalPurchase extends Component
$is_eligible = $this->subscription->service()->isEligible($this->contact); $is_eligible = $this->subscription->service()->isEligible($this->contact);
if($is_eligible){ if ($is_eligible['status_code'] != 200) {
}
elseif ($is_eligible['status_code'] != 200) {
$this->steps['not_eligible'] = true; $this->steps['not_eligible'] = true;
$this->steps['not_eligible_message'] = $is_eligible['exception']['message']; $this->steps['not_eligible_message'] = $is_eligible['message'];
$this->steps['show_loading_bar'] = false; $this->steps['show_loading_bar'] = false;
return; return;

View File

@ -631,7 +631,7 @@ class SubscriptionService
public function triggerWebhook($context) public function triggerWebhook($context)
{ {
if (empty($this->subscription->webhook_configuration['post_purchase_url']) || empty($this->subscription->webhook_configuration['post_purchase_rest_method'])) { if (empty($this->subscription->webhook_configuration['post_purchase_url']) || empty($this->subscription->webhook_configuration['post_purchase_rest_method'])) {
return ['status_code' => 200]; return ["message" => "Success", "status_code" => 200];
} }
$response = false; $response = false;
@ -652,10 +652,7 @@ class SubscriptionService
} }
else { else {
$status = $response->getStatusCode(); $body = $response->getStatusCode();
//$response_body = $response->getReasonPhrase();
//$body = array_merge($body, ['status' => $status, 'response_body' => $response_body]);
} }