Skip to content

Commit

Permalink
[14.x] Add ability to set a description on "one-off" charge checkouts (
Browse files Browse the repository at this point in the history
…#1525)

* Update PerformsCharges.php

* Update PerformsCharges.php

* Update PerformsCharges.php

---------

Co-authored-by: Dries Vints <dries@vints.be>
  • Loading branch information
AmrAb-05 and driesvints authored Apr 13, 2023
1 parent eccba6f commit afc4fd2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Concerns/PerformsCharges.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ public function checkout($items, array $sessionOptions = [], array $customerOpti
* @param int $quantity
* @param array $sessionOptions
* @param array $customerOptions
* @param array $productData
* @return \Laravel\Cashier\Checkout
*/
public function checkoutCharge($amount, $name, $quantity = 1, array $sessionOptions = [], array $customerOptions = [])
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.');
Expand All @@ -159,9 +160,9 @@ public function checkoutCharge($amount, $name, $quantity = 1, array $sessionOpti
return $this->checkout([[
'price_data' => [
'currency' => $this->preferredCurrency(),
'product_data' => [
'product_data' => array_merge($productData, [
'name' => $name,
],
]),
'unit_amount' => $amount,
],
'quantity' => $quantity,
Expand Down

0 comments on commit afc4fd2

Please sign in to comment.