#nizar.nasani
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- nizar.nasani, 1 day ago, 55 messages
- nizar.nasani, 5 days ago, 5 messages
- nizar.nasani, 5 days ago, 4 messages
hi there!
are you creating the Subscription with Chekcout Session or the Payment Element?
I'm creating subscription using subscription service
I'm not using Chekcout Session nor the Payment Intent
it will trigger paymentintent.success which i can't retrieve the subscription id
If it's a payment for a Subscripton, then the PaymentIntent obejct will have aninvoiceproperty, and the Invoice will contain thesubscription.
I'm not using Chekcout Session nor the Payment Intent
so what are you using exactly to create the Subscription?
I'm creating the subscription before creating the payment element
yes that's expected
did my previous message answer your question?
If it's a payment for a Subscripton, then the PaymentIntent object will have an
invoiceproperty, and the Invoice will contain thesubscription.
another question, I'm creating the subscription whether the customer is completing the payment or not, I idea how can I delete that subscription if it doesn't change status to Active ?
you can't delete a Subscription, but you cancancelone if needed: https://stripe.com/docs/api/subscriptions/cancel
is there a way to know that the client left the subscription and won't pay so I can cancel it
if they didn't pay, the subscription will be in incomplete status, then 24 hours later will automatically move in incomplete_expired status. so there's nothing really to do on your end.
that's great thank you
happy to help 🙂
one mre question
I can't seem to retrieve the meta data in the event paymentIntent.success
because I added those to the subscription options
then you need to check the metadata on the Susbcription itself, not the PaymentIntent
yes but in the subscrption event I'm getting the error I mentioned above
which error?
the invoice property is coming as null, any idea why?
can you share an Event ID (evt_xxx) with this issue?
the schedule subscription it's triggering back the customerSubscription.updated event
is it this one evt_1Oh9E3D0qVXB4JczjDg6yt1O ?
the invoice property is coming as null, any idea why?
the event you shared is for an Invoice, so what do you mean by "null"?
I see the full Invoice object in the payload of the event you just shared
can you share the Event ID (evt_xxx) with this issue?
you didn't share a payment_intent.succeeded event earlier
there you go evt_3Oh9GAD0qVXB4Jcz1o95TKrp
I'm gettng the invoice Id in the payment intent object but not the invoice object
id there a way to check the event that the subscription status is active and then I can schedule a subscription to change the price?
I do see "invoice": "in_1Oh9GAD0qVXB4Jcz4NbGlEsA" in the payload
yes you can
and then it's up to you to retrieve the full Invoice object
that's how Stripe works: you just get the ID, and then you need to make an extra API call to retrieve the full obejct if needed
?
id there a way to check the event that the subscription status is active and then I can schedule a subscription to change the price?
Sure: retrieve the corresponding Subscription and check it's status
in which subsciption event ?
that's up to you. maybe customer.subscription.udpated or invoice.paid
you can learn more about Subscriptions and webhook events here: https://stripe.com/docs/billing/subscriptions/webhooks