#Bentley-setup-intent

1 messages ยท Page 1 of 1 (latest)

snow shore
#

Hi there ๐Ÿ‘‹ What's your question?

wet verge
#

Thank you. I didn't see a way to create a thread lol.

#

My question is about feasibility. Is it simply a matter of passing back the data gathered by the Stripe elements to the backend? The reason we're facing this is because we're allowing the user to save an associated nickname with the payment method and we need to enforce uniqueness in the backend before we commit the intent.

snow shore
#

Stripe Elements is intended to pass raw info (e.g. PANs and PII) directly to Stripe from the client. Once your client receives a response from Stripe, then you can pass that response data to the back-end.

#

In terms of enforcing uniqueness, you may want to wait until after the payment method is created

wet verge
#

We intended to include it in the metadata, but then ran into the unique constraint issue.

#

If we handle the confirmation in the backend will we run into any issues with requires_action or will those actions have already been resolved when we get the response from Stripe?

snow shore
#

I'm not sure I understand the question. The requires_action is on the Payment Intent or Setup Intent objects, but up until now we've only been talking about the Payment Method object

#

Also, are you using webhooks to manage the lifecycle of a payment/customer?

wet verge
#

That was our plan, but we're second guessing that.

#

Sorry, I know I'm mixing concerns. To us the payment method is an inherit child of the SetupIntent, so I'm not doing a good job of separating them in my head.

snow shore
#

I would absolutely use webhooks if you're intending to handle transitioning the state of the payment intent on your own. I wouldn't treat them as parent/child, as they exist separately and can be used with other products and objects.

wet verge
#

Okay, so if I'm understanding this correctly if we confirm the SetupIntent in our backend we run the risk of running into status = requires_action in the response?

snow shore
#

That is a possibility, yes. Because confirmation could fail for a variety of reasons

#

That's not a problem necessarily. The Payment Element will show an error if confirmation fails and essentially "wait" for the customer to try again