#Nebojsa

1 messages · Page 1 of 1 (latest)

crude falconBOT
broken brook
dense needle
#

Ah, i see

#

Would I get the paymentmethod id in one of the subsequent webhooks?

broken brook
#

You would have the Payment Method ID before you attach it in this case

dense needle
#

I'm sorry, can you clarify? If I want to offer multiple payment methods how would I access the payment method ID required to attach it to a customer?

broken brook
dense needle
#

Yep, I'm using Element

#

What I'm asking is, how can I attach their payment method after they finish payment?

#

I see that on the intent successful webhook I get the payment method id back. I suppose I can just tie it to the customer then

broken brook
dense needle
#

Awesome. Thank you

dense needle
#

Still not working

#

Here's an excerpt from the paymentIntent create docs

#
ID of the Customer this PaymentIntent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this PaymentIntent.

If present in combination with setup_future_usage, this PaymentIntent’s payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.

Meaning it should automatically attach this payment method, but it does not?

#

I've tried calling the attach function you linked above on a payment method after a succesful payment but I still don't seem to be getting it when I retrieve customer by ID

#

I've made sure to inlcude source in the customer response

honest mica
#

Does the payment method show up?

dense needle
#

Yep!

#

So creating a payment intent, if I want to make it off_session, I need to have confirm set to true and also provide a payment method id?

#

As well as a customer id I suppose

honest mica
#

Yeah that's correct

#

(That assumes the payemnt method is already set up for future use)

dense needle
#

Yep. Taking a look at the dashboard as well, it seems setup_future_use was indeed already saving the payment method. So I don't need to attach it myself at any point

#

Perfect

#

Thanks, this solved my issue