#TheRankinator

1 messages ยท Page 1 of 1 (latest)

wind thunderBOT
coral fjord
#

Hi ๐Ÿ‘‹

Have you tested this flow? I ask because I don't think attaching a PM to a Setup Intent will consume it (that requires a Charge AFAIK).

gentle kelp
#

Hi!

I...think we have? Here's been our flow for cards:

  1. Using a card, create a PaymentMethod without a Customer attached to it
  2. Create a SetupIntent with that PaymentMethod
  3. Create a PaymentIntent with that PaymentMethod and try to charge it
  4. We get back the error "Invalid Stripe request: : The provided PaymentMethod cannot be attached. To reuse a PaymentMethod, you must attach it to a Customer first."
#

We can get it to work for cards just by not creating a SetupIntent, but that won't work for bank accounts since we need the SetupIntent in order to get a mandate

coral fjord
#

Oh wait! I just saw this in another flow. What do you do with the Setup Intent? Can you share a Setup Intent ID?

gentle kelp
#

We don't do anything with the SetupIntent (we thought we needed it to get a mandate for single-use bank tokens) - should we be doing something with it?

#

We just made this SetupIntent:
seti_1MDAIFJnSU1ayTHcWjdwPPGP

#

(This has a PaymentMethod without a Customer attached)

coral fjord
#

Okay but there is no customer here either and no confirmation

#

This would need to be created with a Customer ID and then confirmed to attach the Payment Method

gentle kelp
#

Right, so bismarck said (in that thread I posted in the initial question) that the way to simulate single-use tokens with the SetupIntent API is to just not add a customer

coral fjord
#

Ah, okay

#

The card is validated and not consumed at this point, at least that is what i can see

gentle kelp
#

Right

#

Oh wait, you're saying it's not consumed when we include it in the SetupIntent?

coral fjord
#

The payment method you attached to the Setup Intent you provided. I see it was validated but not consumed

gentle kelp
#

Ah so, we seemed to figure something out

#

The SetupIntent always needs a customer ID included upon creation, but the PaymentMethod can be made single-use or reusable by attaching it to a customer or not (respectively)

#

I think what we were doing wrong was not pasing a Customer ID to the SetupIntent when we wanted single-usage

coral fjord
#

A payment method will always be single use unless it is attached to a Customer.

gentle kelp
#

(Presumably this should work for bank accounts as well, we still need to set up ACH Direct Debit so we can't test it just yet)

coral fjord
#

I think this card is not consumed because it has not been charged

gentle kelp
#

Okay

#

I think we figured out what we needed to

#

Thank you so much for your help!

coral fjord
#

Happy to do it! ๐Ÿ™‚

gentle kelp
#

Much obliged

#

You wouldn't happen to be able to help us activate ACH Direct Debit, would you? ๐Ÿ˜

coral fjord
gentle kelp
#

Haha I figured as much

#

Thanks again!

coral fjord
#

The docs are pretty decent on ACH DD. It's a little more involved with all the mandate stuff and setting up financial connection parameters but is you're using the Payment Element it also "just works"

gentle kelp
#

Ah okay, so we're not using the Payment Element unfortunately

#

Doing all the UI ourselves and using the API on the backend