Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.x] Remove limitation from checkoutCharge #1690

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 must include "price_data" in the provided options array.'
);
}

$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