Open knufri opened 2 weeks ago
Hi @knufri
Please feel free to use the following example:
use enupal\stripe\Stripe;
...
Stripe::$app->checkout->checkout($lineItems, $metadata);
let met know how it goes!
It works perfectly! You saved my day. Here my code in case someone has the same question:
$lineItems = [
[
'price' => 'price_XYZ123',
'quantity' => 1
]
];
// optional data
$metadata = [
'subcriptionHandle' => 'foo',
'customer' => 'bar',
'email' => 'john@doe.com'
];
$checkoutSession = Stripe::$app->checkout->checkout($lineItems, $metadata);
echo $checkoutSession->url;
Description
Hello, I have a custom controller in Craft and I need to get the checkout session url from the price id and quantity and some custom metadata. I want to use the same logic like the checkout twig tag with php:
How to achieve that?
Additional info