From 69a837c38e9d0ce5b0cab432ec93c2654e405dd2 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 24 Jun 2021 15:54:34 +0200 Subject: [PATCH] Fix collecting tax ids --- src/Concerns/PerformsCharges.php | 4 +++- src/SubscriptionBuilder.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Concerns/PerformsCharges.php b/src/Concerns/PerformsCharges.php index b88a2bcf..6bbadf92 100644 --- a/src/Concerns/PerformsCharges.php +++ b/src/Concerns/PerformsCharges.php @@ -85,7 +85,9 @@ public function checkout($items, array $sessionOptions = [], array $customerOpti return $item; })->values()->all(), - 'tax_id_collection' => Cashier::$calculatesTaxes ?: $this->collectTaxIds, + 'tax_id_collection' => [ + 'enabled' => Cashier::$calculatesTaxes ?: $this->collectTaxIds, + ], ]); return Checkout::create($this, array_merge($payload, $sessionOptions), $customerOptions); diff --git a/src/SubscriptionBuilder.php b/src/SubscriptionBuilder.php index f776bf43..8699d3ea 100644 --- a/src/SubscriptionBuilder.php +++ b/src/SubscriptionBuilder.php @@ -333,7 +333,9 @@ public function checkout(array $sessionOptions = [], array $customerOptions = [] 'trial_end' => $trialEnd ? $trialEnd->getTimestamp() : null, 'metadata' => array_merge($this->metadata, ['name' => $this->name]), ]), - 'tax_id_collection' => Cashier::$calculatesTaxes ?: $this->collectTaxIds, + 'tax_id_collection' => [ + 'enabled' => Cashier::$calculatesTaxes ?: $this->collectTaxIds, + ], ]); return Checkout::create($this->owner, array_merge($payload, $sessionOptions), $customerOptions);