#lord-checkout-invoice
1 messages ยท Page 1 of 1 (latest)
@hybrid silo Yes our Invoices API works without Subscription. What's the problem you have?
Thanks for fast response, i'm using Stripe Lib in PHP for my case, and when i'm using the checkout to pay, it works well but invoice.paid and invoice.finalized webhook are not called, it does only when using a subscription mode
doing it to redirect to the checkout for unit amount price
Do you have an example I can look at in Test mode that I can double check?
(we're both developers, please share real code as text not a picture)
lord-checkout-invoice
Yes, sorry, here is my code which redirects to the Stripe checkout system
public function checkout(array $options): string
{
try {
$session = Session::create(
array_merge(
[
'customer' => $this->createOrGetStripeCustomer(),
'success_url' => config('app.client_url'),
'cancel_url' => config('app.client_url'),
],
$options
)
);
if (is_null($session->url)) {
abort(404, 'unable to redirect to stripe');
}
return $session->url;
} catch (ApiErrorException $e) {
abort(400, $e->getMessage());
}
}
$url = $user->checkout([
'mode' => 'payment',
'line_items' => [
[
'quantity' => 1,
'price_data' => [
'currency' => 'EUR',
'product_data' => [
'name' => 'Achat unitaire'
],
'unit_amount' => $request->validated('amount')
]
]
]
]);
and of course, invoice.finalized and invoice.paid webhooks are both enabled in my Stripe dashboard
So that code never did anything about Invoices right?
This code works for the redirection to the checkout, it calls the checkout.session.completed webhook afterwards but does not call invoice.paid or invoice.finalized webhook, maybe this is normal?
https://stripe.com/docs/receipts?payment-ui=checkout#paid-invoices you want to read this
my god, I will try this
yeah sory took me a lot longer than needed to find this too
had to look up in our codebase to get there ๐ but it seems to be exactly what you want
Thanks a lot, it seems to work, I searched everywhere for hours
Yess thanks ๐
yeah I just yelled internally to get this doc somewhere discoverable
there are so many docs and features, it's hard to make sure everything is easy to find ๐ฆ
Yes I understand well, starting Stripe, I admit to getting a little lost in the documentation
yeah it's tough to find the right balance ๐ฆ
In any case, thank you a lot, I won't bother you any longer