Skip to content

Commit

Permalink
Merge pull request #15 from AndreasHeiberg/patch-2
Browse files Browse the repository at this point in the history
FatalErrorException for wrong billing_ids.
  • Loading branch information
mmanos committed Apr 25, 2015
2 parents 457fbf4 + 948a709 commit 442a755
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Mmanos/Billing/Gateways/Stripe/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,13 @@ public function create($plan, array $properties = array())
// This feature is coming in a future relase, however.
// Currently you can only specify a card token and the same card is used for all
// customer subscriptions.

$stripe_subscription = $this->stripe_customer->subscriptions->create(array(
$stripe_subscriptions = $this->stripe_customer->subscriptions;

if ( ! $stripe_subscriptions) {
throw new \Exception("Stripe Customer does not exist.");
}

$stripe_subscription = $stripe_subscriptions->create(array(
'plan' => $plan,
'quantity' => Arr::get($properties, 'quantity') ? Arr::get($properties, 'quantity') : null,
'trial_end' => $trial_end,
Expand Down

0 comments on commit 442a755

Please sign in to comment.