When creating a Stripe Session for Checkout using \Stripe\Checkout\Session::create I get an invalid integer when I try to add a line item with an amount of $0 (free). I am using PHP Server side integration.
The total of all the other line items exceeds the minimum charge amount of $0.50 and if I either (i) remove the $0 item all together, or (ii) give the item an amount of $0.01, then all works good and the session is successfully created.
The scenario would be something like this:
Qty 1 x Adult Ticket @ $10.00
Qty 1 x Child Ticket (age 6+) @ $5.00
Qty 1 x Child Ticket (under age 6) @ $0.00 (FREE)
Since the TOTAL of ALL line items in this case would be $15.00, which is greater than the minimum charge amount of $0.50, all three of these line items should show up on the checkout page, including the FREE item at $0.00.
Is this a limitation on Stripe's part, not allowing a $0 item, or am I missing something?
\Stripe\Checkout\Session::create([
'customer_email' => '[email protected]',
'success_url' => 'https://example.com/success',
'cancel_url' => 'https://example.com/cancel',
'payment_method_types' => ['card'],
'line_items' = [
["name"=>"Adult Ticket", "description"=>"Full price Adult Ticket", "amount"=>"1000", "currency"=>"usd", "quantity"=>"1" ],
[ "name"=>"Child Ticket (age 6+)", "description"=>"Full price Child Ticket", "amount"=>"500", "currency"=>"usd", "quantity"=>"1" ],
[ "name"=>"Child Ticket (under age 6)", "description"=>"FREE Child Ticket", "amount"=>"0", "currency"=>"usd", "quantity"=>"1" ]
]
])
So as it stands right now, according to Stripe, they do not allow $0 line items in a Checkout Session.
I have made a feature request for them to add this functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With