#davemerritt-invoice
1 messages · Page 1 of 1 (latest)
evt_3LMNwxBhctil7qKd0Ec973u5
Customer did not pay the first creation invoice of subscription (sub_1LMNwxBhctil7qKdN68lGCjH) [0] within 23 hours [1]. Its invoice and payment method under the hook are voided and cancelled.
[0] https://dashboard.stripe.com/subscriptions/sub_1LMNwxBhctil7qKdN68lGCjH
[1] https://stripe.com/docs/billing/subscriptions/overview#payment-window
This should all be happening in one flow so I'm confused as to when this would happen for the user. We provide the web view stripe integration and it pops up the "enter CC and pay" view or via apple pay. That should be the only step. When would this have been cancelled? Is this the credit card declining the payment after they hit submit?
I don't believe this is from the management portal we provide the user after they submit.
This can be possible if customer decides to quit or stop at payment page that leaves the subscription unpaid.
we create a payment intent to generate the payment window, but then the subscription is not created until they hit submit so I'm confused how they can stop?
and in these cases we are receiving paymentResult === PaymentSheetEventsEnum.Completed as true in the client.
How do you generate a payment intent now?
The mobile client makes an XHR request to our backend servers which generate the payment intent and respond with the paymentIntent.clientSecret
We are using the capacitor plugin in the client which I believe wraps the native client integrations
I see! Each subscription also creates its own payment intent under initial invoice creation. You should not create a payment intent yourself, but using the payment intent from the subscription: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription
In this case we get this event first: https://dashboard.stripe.com/events/evt_1LMNwkBhctil7qKd1PNLc6hQ
Have you referred to this doc for subscription integration? https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
Yes I believe we are doing this alraedy
subscription = stripe.Subscription.create(
customer=customer.id,
items=[
{
"price": price_id,
}
],
payment_behavior="default_incomplete",
expand=["latest_invoice.payment_intent"],
)
data = {
"subscription_id": subscription.id,
"client_secret": subscription.latest_invoice.payment_intent.client_secret,
}
return Response(data, status=status.HTTP_200_OK)
we return the client secret of the payment intent of the subscription
It's indeed that the subscription is created at this point alongside with payment intent creation
So, it's possible that customer decides to quit or stop at payment page that leaves the subscription unpaid since subscription is created at this point
After you pass the payment intent to the frontend for payment collection, customer stops/quits and does not complete the checkout process
okay - makes sense, I must be handling the webhooks wrong
I set it up to receive subscription.updated (which should be the payment goes through?) and subscription.cancelled but I'm somehow registered it as paid in my system
but I don't see either event for that user
Let me take a look at that subscription again
Stripe sent customer.subscription.updated event in evt_1LMjUiBhctil7qKdNSKiAEMA [0] that the subscription is incomplete_expired and invoice.voided event in evt_1LMjUhBhctil7qKd0ovVSvdl [1] as the customer didn't make the payment within 23 hours [2].
[0] https://dashboard.stripe.com/events/evt_1LMjUiBhctil7qKdNSKiAEMA
[1] https://dashboard.stripe.com/events/evt_1LMjUhBhctil7qKd0ovVSvdl
[2] https://stripe.com/docs/billing/subscriptions/overview#payment-window
incomplete_expired: The initial payment on the subscription failed and no successful payment was made within 23 hours of creating the subscription. These subscriptions don’t bill customers. This status exists so you can track customers that failed to activate their subscriptions.
Source: https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses
oooh got it, I wasn't looking for that status in the customer.subscription.updated event
thank you that explains the issue
Appreciate the help!
No problem! Happy to help 🙂