#FacuTerrens
1 messages · Page 1 of 1 (latest)
Hello
Hi!
Let's use this thread
Going to move your messages into the thread
$checkout_session = \Stripe\Checkout\Session::create([
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => 'price_1MP5AKCelbZ8ISVz6FrO5c5D',
'quantity' => 1,
]],
'mode' => 'payment',
'success_url' => $YOUR_DOMAIN . '?success=true',
'cancel_url' => $YOUR_DOMAIN . '?canceled=true',
]);
This works```
'line_items' => [[
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
'price' => $id_stipe,
'quantity' => 1,
]],
'mode' => 'payment',
'success_url' => $YOUR_DOMAIN . '?success=true',
'cancel_url' => $YOUR_DOMAIN . '?canceled=true',
]);
but this no```
thanks
What error are you seeing?
Have you logged out $id_stipe?
And are you sure that isn't a typo and should be $id_stripe?
When I replace the value of price that is between '', by the variable $id_stripe, I get an error
$id_stripe = $_GET['id_stripe'];
I send it from here: header('Location: ../admin/stripe-check.php?id_stripe='.$id_stripe);
Okay so you likely aren't actually getting the Price there
You need to add a log to check on that variable after you initialize it
And how do you do that?
Well there are various ways, sometimes I use something like error_log in PHP but this is something that you as a developer need to handle. I can't walk you through writing logs.
For example, it works for me here, here I create the products and services
but here no
So you can also look in your Dashboard logs for the specific error and what post params you are actively passing: https://support.stripe.com/questions/finding-the-id-for-an-api-request
It is already fixed, the error was that it was as 'payment' and I had to put it as 'subscription'
thanks!
Glad you figured it out!