#secSeNige-payment-element
1 messages ยท Page 1 of 1 (latest)
hi
Double checking to make sure ๐
thank you
there are multiple questions so I'll try to answer them one by one
Am i right in thinking the users email is required to load the paymentIntent for the payment element?
It may be important to your app's flow but a user's email is NOT required to create a payment intent for the payment element
also am i right in thinking there is currently no method of calling a function only if the payment has succeeded on the client side?
You can put functions behind a conditional to check if the payment has succeeded or failed and then call the appropriate function
in the stripe docs for the example regarding using the payment element with subscriptions, the subscription is created before the payment element is rendered.
this makes sense because this is the information i use to provision access to my application once i have received confirmation of payment via webhooks.
I'm just wondering if there is an example of a registration flow available that doesn't require any user details to receive payment and provision access to my platform.
it feels a bit strange registering a user before i confirm payment, if i can't confirm payment before then i also need to design a whole solution purely for users who dont have the money or decide to delay.
You can implement webhooks and listen for events when the payment succeeds or fails and decide to either persist or delete the user accordingly.
ok that makes sense
it does feel strange when added to my current application flow, i guess a more or less complete redesign of that will be needed to incorporate the payment element
Hmm can you tell me what platform you're building your integration on?
sorry you can disregard this as it's very long winded but if i could just ask one more question
sure thing
when implementing your suggestion above where the user is registered and deleted if they fail to pay
is there a time limit on payment intents, and if so could you tell me the webhook i need to listen to in order to invoke deletion of the user
in other words, how would you determine whether a user has failed payment, decided not to proceed and someone who is just taking a long time with their payment
You can listen for invoice.payment_failed event on your webhook which will notify you if the payment for the subscription invoice has failed
Here's the guide that explains various usecase while working with subscriptions and webhooks: https://stripe.com/docs/billing/subscriptions/webhooks#payment-failures