#harcon_api

1 messages ยท Page 1 of 1 (latest)

signal wraithBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1255894107608449024

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

little marten
#

Since refactoring to use the PaymentSheet, we no longer have access to the payment methods.
What do you mean by this? Payment Methods are still created

foggy pawn
#

I mean we no longer have access to the IDs

#

so we can't pass them into the payment intent

#

basically I don't want to have to go through the usual Payment/Setup intent flow when I want to set up a renewal. I want to use the same card they used for the main reservation.

#

Rather than have to show the payment sheet again

little marten
#

Yeah but why don't you have access to them?

foggy pawn
#

because the response from open_payment sheet only returns an image string and the last 4, no ID

little marten
#

Oh you should be handling this on your backend anyway

#

Via webhook events

#

relying on the client to store these id's isn't super reliable

foggy pawn
#

So at the moment, I have a 'confirm_reservation' endpoint that gets called when the payment resolves. This endpoint is what creates the record for the renewal. Is it possible to send the payment method ID this way at all or do I need to use webhooks?

little marten
#

What is passed to that endpoint? i really recommend using webhooks though in case there's a client-side issue or network issue with the customer paying and that endpoint isn't reached

foggy pawn
#

At the moment only data surrounding the reservation, nothing to do with payment methods. Ideally i'd like to grab the payment_method_id from the payment method that was used and forward that on as we were doing previously.

#

It just doesn't seem like there's a way to get access to that ID from the payment sheet

little marten
#

Do you have the payment intent id at that endpoint?

#

Really I recommend relying on payment_intent.succeeded to be delivered to your webhook endpoint

#

For order fulfillment

#

That will also have payment_method id

foggy pawn
#

I do have the payment intent id yes

little marten
foggy pawn
#

ah I see, I will look into the webhooks also but will give this a try first

#

can you point me in the direction of the method to grab the payment method with the intent id?

#

nvm I think I have it ๐Ÿ‘

#

thank you for your help ๐Ÿ™‚