-
Notifications
You must be signed in to change notification settings - Fork 682
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
[13.x] Implement new calculateTaxes call #1198
Conversation
@@ -23,7 +24,6 @@ trait PerformsCharges | |||
public function charge($amount, $paymentMethod, array $options = []) | |||
{ | |||
$options = array_merge([ | |||
'automatic_tax' => $this->automaticTaxPayload(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this because it's not possible to use automatic tax with payment intents atm it seems.
@@ -791,7 +789,6 @@ protected function mergeItemsThatShouldBeDeletedDuringSwap(Collection $items) | |||
protected function getSwapOptions(Collection $items, array $options = []) | |||
{ | |||
$payload = [ | |||
'automatic_tax' => $this->automaticTaxPayload(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this because disabling automatic taxes during a swap is unlikely to happen. People can still do this by passing options explicitly if they want.
@@ -1132,7 +1129,6 @@ public function latestInvoice() | |||
public function upcomingInvoice(array $options = []) | |||
{ | |||
return $this->owner->upcomingInvoice(array_merge([ | |||
'automatic_tax' => $this->automaticTaxPayload(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this because the underlying upcomingInvoice
already adds this.
This implements a new
Cashier::calculateTaxes()
static method that'll allow you enable automatic tax calculation on all relevant Stripe calls. By default it follows Stripe's behavior and is set tofalse
. Additionally, the previouswithTax
method is now deprecated as it is not needed anymore. You can now use your code as regularly without the need of using extra methods. This method call goes into the boot method of yourApServiceProvider
.Also, the
tax_id_collection
is now enabled by default when the calculation of taxes is enabled. This PR also fixes a typo for an forgotten rename ofcollectsTaxIds
.I'll send in a PR to the docs when this one is accepted.