#ggmghoul

1 messages ยท Page 1 of 1 (latest)

swift terraceBOT
prime knot
#

๐Ÿ‘‹ @elfin cedar How can we help?

elfin cedar
#

hello

#

i'm having a little issue with events in the webhook

prime knot
#

What's the issue you're facing?

elfin cedar
#

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 ?

prime knot
#

Could you share why you need payment intent events for these two scenarios? For any changes to subscription, customer.subscription.* events should be sufficient

elfin cedar
#

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

prime knot
#

Why can't you create a yearly subscription then since it's paid for whole year?

elfin cedar
#

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

prime knot
elfin cedar
#

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

prime knot
#

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

elfin cedar
#

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

prime knot
#

No problem! Happy to help ๐Ÿ˜„

elfin cedar
#

may ask you for another thing ?

#

may i *

prime knot
#

Sure! Please go ahead

elfin cedar
#

during a dirst payement intent is there an url for external payement like in invoices ?

#

direct*

prime knot
#

Only payment receipt, but not payment link or invoice

elfin cedar
#

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 ?

prime knot
#

invoices have a link tho right ?
Yes

elfin cedar
#

okay i'll check that out

#

thank you

prime knot
#

No problem! Happy to help ๐Ÿ˜„