#ggmghoul

1 messages · Page 1 of 1 (latest)

zenith sedgeBOT
neon glen
#

is there a way to retreive the product or the price from the webhook request ?

misty gale
#

Hi! Let me help you with this.

#

What webhook event are you looking at?

neon glen
#

i'm sorry internet problems

#

payment_intent.succeeded for instance

#

i want to retreive the price so i can create a paymentlink with that price to be precise

misty gale
#

Payment Intents don't have products or prices, unless they are linked to a Checkout Session or a Subscription.

#

I am not sure I totally get your flow. You want to create a new payment link after the payment was successfully completed?

neon glen
#

no i want to create a payment link after the payment fails

jade maple
#

can you explain in more detail an example of how this would work? How do you integrate today, which APIs are you using?

neon glen
#

okay sure thing

#

i have a payment of type sepa_mandate

#

when this payement fails for some reason

jade maple
#

there's no such thing, do you mean sepa_debit?

neon glen
#

yes sepa_debit

#

so when the payment fails i want to create a payement link for the customer to pay with card

#

although i can only create a payement link from the api with the price id

#

i'm wondering if i can retreive that id when receiving a request from the webhook

jade maple
#

you might be able! how do you do the SEPA payment, what APIs are you using for that?

neon glen
#

i create a payment intent

jade maple
#

then there is no Price object.

neon glen
#

exactly

jade maple
#

so you'd have to for example look at the amount of the PaymentIntent you created and create some Price that matches that, and use that with the PaymentLink

neon glen
#

okay ! is it the only option ?

jade maple
#

there are lots of other options. If you just want to accept a card payment you can do that in many ways. Like instead of creating a PaymentLink you could contact the user and send them to your site, and create a PaymentIntent there for cards. Or you could attempt to charge a saved card that customer might already have. It's hard to say as there are lots of options and it really depends on context like what you have already and what experience you're looking for

neon glen
#

well my path is as i mentionned earlier in case the payement fails i need to generate a payment link so i can send it in an email

#

btw how long would it take to receive a response from a sepa_debit payintent

#

cause as far as i noticed it takes always about 3 days whether if it's a fail or success in production mode

jade maple
neon glen
#

seems that my thinking was fine cause i tried to bloc the user instantly if the payment intent fails but i found that the status is always processing until further notice which is 3 days later