#ggmghoul
1 messages ยท Page 1 of 1 (latest)
๐ @elfin cedar How can we help?
What's the issue you're facing?
how can i know the difference between a payment intent and a payment intent made by a schedule ?
i used to filter them by the description
which was a subscription creation for the first payment and later it's subscription update
is there a better way ?
Could you share why you need payment intent events for these two scenarios? For any changes to subscription, customer.subscription.* events should be sufficient
okay i'll tell you the whole senario
i'm working on a project i did do what's needed but i don't like the how
so the customer is choosing to pay for let's say a whole year but on 12 months
so that's a subscription
what i do is i create the first payment as a payement intent
and i create a schedule of 11 months
when the event is triggered i need to change infos in my database
Why can't you create a yearly subscription then since it's paid for whole year?
the payement needs to be automatic
each month
it i got you right
i made the first payement intent on its own cause in the test mode i get the answer instantly but later i discovered that in reality it can take up to 14 days it happened on the production version
to be precise if this helps i need to change status in database based on if the payement has succeeded or failed
Sorry, I don't quite understand what you mean. If the payment is like a installment for a year and to be charged monthly, then it can be done with subscription schedule: https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#installment-plans
If you want to monitor whether the payment has been paid for each cycle, you should use invoice.paid or invoice.payment_failed to determine the payment status instead of using payment_intent.* events
that's lovely i think this is what i'm looking for
i can find this even in payement intents ?
i'm talking about the invoice .paid
is it triggered by a payment intent if it succeeded ?
from what i checked now a direct payement intent does have invoice:null so if i want to check the payement status of a payment intent i need to listen to payement intent events and for subscriptions the invoice ?
although even if a subscription payement is made there is a payementintent.succeeded even triggeres
triggered
i'm sorry if it's not as clear as you can understand xD i'm doing my best i'm still learning about stripe
No worries! For each payment regardless it's a direct Payment Intent or via Subscription, Stripe will send payment_intent.* related events for the payment outcome.
If you wish to identify whether the Payment Intent is a direct or using invoice with subscription, you may check the invoice field. When a Payment Intent is not created with Invoice from Subscription, invoice field will be null.
The recommended way to determine the Subscription payment outcome is to listen to invoice.paid and invoice.payment_failed events
okay that's what i thought i only needed to comfirm so i don't make a mess xD thank you so much this solves more than 50% of my problems
i'm already in production so i need to make the minimum changes and adapt with what already have that's why i'm focusing only on the webhook functions and not the main functions in the app
thanks again
No problem! Happy to help ๐
Sure! Please go ahead
during a dirst payement intent is there an url for external payement like in invoices ?
direct*
If receipt_email is set in Payment Intent creation request and Email customers about successful payment is enabled in https://dashboard.stripe.com/settings/emails, Stripe offers to send payment receipt after successful payment. For more details, you may refer to https://stripe.com/docs/receipts
Only payment receipt, but not payment link or invoice
okay in that case i will generate a payment link for the first one i can work with that
invoices have a link tho right ?
Alternatively, you can use Checkout Session for a payment link on Stripe hosted page: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout
invoices have a link tho right ?
Yes
No problem! Happy to help ๐