Skip to content

Commit

Permalink
Add new metered price methods (#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Jun 3, 2021
1 parent f6d3a89 commit e60d2dd
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,35 @@ public function addPriceAndInvoice($price, $quantity = 1, array $options = [])
return $this->addPrice($price, $quantity, $options);
}

/**
* Add a new Stripe metered price to the subscription.
*
* @param string $price
* @param array $options
* @return $this
*
* @throws \Laravel\Cashier\Exceptions\SubscriptionUpdateFailure
*/
public function addMeteredPrice($price, array $options = [])
{
return $this->addPrice($price, null, $options);
}

/**
* Add a new Stripe metered price to the subscription, and invoice immediately.
*
* @param string $price
* @param array $options
* @return $this
*
* @throws \Laravel\Cashier\Exceptions\IncompletePayment
* @throws \Laravel\Cashier\Exceptions\SubscriptionUpdateFailure
*/
public function addMeteredPriceAndInvoice($price, array $options = [])
{
return $this->addPriceAndInvoice($price, null, $options);
}

/**
* Remove a Stripe price from the subscription.
*
Expand Down

0 comments on commit e60d2dd

Please sign in to comment.