#harcon_api
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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
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
Yeah but why don't you have access to them?
because the response from open_payment sheet only returns an image string and the last 4, no ID
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
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?
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
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
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
I do have the payment intent id yes
Yeah you should be able to retrieve it via the api to get payment method then