-
Notifications
You must be signed in to change notification settings - Fork 69
Bug when using automatic_payment_methods parameter #218
Copy link
Copy link
Open
Description
{
"message": "Invalid boolean: 1",
"exception": "Cartalyst\\Stripe\\Exception\\MissingParameterException",
"file": "/www/vendor/cartalyst/stripe/src/Exception/Handler.php",
"line": 125,
"trace": [
{
"file": "/www/vendor/cartalyst/stripe/src/Exception/Handler.php",
"line": 93,
"function": "handleException",
"class": "Cartalyst\\Stripe\\Exception\\Handler",
"type": "->"
},
{
"file": "/www/vendor/cartalyst/stripe/src/Api/Api.php",
"line": 178,
"function": "__construct",
"class": "Cartalyst\\Stripe\\Exception\\Handler",
"type": "->"
},
{
"file": "/www/vendor/cartalyst/stripe/src/Api/Api.php",
"line": 155,
"function": "execute",
"class": "Cartalyst\\Stripe\\Api\\Api",
"type": "->"
},
{
"file": "/www/vendor/cartalyst/stripe/src/Api/PaymentIntents.php",
"line": 33,
"function": "_post",
"class": "Cartalyst\\Stripe\\Api\\Api",
"type": "->"
},
^ I'm getting this error when running the code below:
$paymentIntent = $stripe->paymentIntents->create([
'amount' => $order->amount,
'currency' => 'usd',
'automatic_payment_methods' => [
'enabled' => true, // <------ boolean
],
] );
It took me an hour to figure out what the problem was. This code works:
$paymentIntent = $stripe->paymentIntents->create([
'amount' => $order->amount,
'currency' => 'usd',
'automatic_payment_methods' => [
'enabled' => 'true', // <------ string
],
] );
Could you please fix this bug? Stripe API expects boolean, this error is really confusing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels