Skip to content

Commit

Permalink
fix : added a condition whether create billing from subscription help…
Browse files Browse the repository at this point in the history
…er was successful or not.
  • Loading branch information
otnansirk committed Feb 23, 2024
1 parent 51f0ec3 commit c24b181
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Traits/PayPalAPI/Subscriptions/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ protected function addBillingPlan(string $name, string $description, array $bill
],
];

$this->billing_plan = $this->createPlan($plan_params, $request_id);
$billingPlan = $this->createPlan($plan_params, $request_id);
if ($error = data_get($billingPlan, 'error', false)) {
throw new \RuntimeException(data_get($error, 'details.0.description', 'Failed to add billing plan'));
}
$this->billing_plan = $billingPlan;
}

/**
Expand Down

0 comments on commit c24b181

Please sign in to comment.