Skip to content

Commit

Permalink
Remove limitation from checkoutCharge
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Jul 4, 2024
1 parent 98fa78e commit 7abe227
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/Concerns/ManagesInvoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ trait ManagesInvoices
public function tab($description, $amount, array $options = [])
{
if ($this->isAutomaticTaxEnabled() && ! array_key_exists('price_data', $options)) {
throw new LogicException('When using automatic tax calculation, you need to define the "price_data" in the options.');
throw new LogicException(
'When using automatic tax calculation, you need to define the "price_data" in the options.'
);
}

$this->assertCustomerExists();
Expand Down
5 changes: 0 additions & 5 deletions src/Concerns/PerformsCharges.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Laravel\Cashier\Checkout;
use Laravel\Cashier\Payment;
use LogicException;
use Stripe\Exception\InvalidRequestException as StripeInvalidRequestException;

trait PerformsCharges
Expand Down Expand Up @@ -153,10 +152,6 @@ public function checkout($items, array $sessionOptions = [], array $customerOpti
*/
public function checkoutCharge($amount, $name, $quantity = 1, array $sessionOptions = [], array $customerOptions = [], array $productData = [])
{
if ($this->isAutomaticTaxEnabled()) {
throw new LogicException('For now, you cannot use checkout charges in combination with automatic tax calculation.');
}

return $this->checkout([[
'price_data' => [
'currency' => $this->preferredCurrency(),
Expand Down

0 comments on commit 7abe227

Please sign in to comment.