#matheuscp - bill instantly
1 messages · Page 1 of 1 (latest)
Good question. You can manually make the finalize call before the hour is up. https://stripe.com/docs/api/invoices/finalize
I will check in to if there is a way to configure that kind of behavior
the subscription is active, but it is not charged at the time. i'm using laravel
Like this:
$pagamento = $stripe->subscriptionSchedules->create([
'customer' => $user_stripe_id,
'start_date' => 'now',
'end_behavior' => 'cancel',
'phases' => [
[
'items' => [
[
'price' => $plan->stripe_id,
'quantity' => 1,
],
],
// 'coupon' => $request->cupom_id,
'iterations' => 12,
],
],
]);
my client may have the impression that something is wrong when signing because it takes 1 hour to be charged
In that case, please reach out to Laravel's support. Stripe doesn't make the Laravel API so unfortunately I do not have much insight in to how to use it.
Ok, but stripe have PHP documentation in his site
this code i saw in stripe documentation
and not in laravel
Oh I see, I was confusing that with the Laravel Cashier API
So yes, I am looking in to how to bill sooner right now
I think I understand your problem. Invoices have a draft period of one hour and you would like to skip that.
It looks like there isn't a way to configure around that. I think you will want to create a webhook endpoint that listens for the invoice.created event.
Exactly. The subscription is active, but the charge does not appear on the invoice immediately
When your server receives that event, you can make the finalize call, at which point the Invoice will try to make payment. https://stripe.com/docs/api/invoices/finalize
Any of it, or some specific part? I am happy to explain any part of that again
So,I will try to explain my second doubt
when I sign a client, does the stripe return this "id" that is being passed in the function?
$stripe->invoices->finalizeInvoice(
'in_1KelpPFjoquTQj7kXO1X6v9q',
[]
);
the solution to skip this 1 hour time, would be to call this "$stripe->invoices->finalizeInvoice". Eight?
Right*
Yes, subscriptions charge your customers through Invoices. Every time an invoice is created either from the user signing up or from the subscription cycle renewing, we will send you a invoice.created event.
And if you make that finalize call, the invoice's status will transition from draft to open and we will attempt to charge your customer.