#primodirective_api

1 messages ¡ Page 1 of 1 (latest)

graceful islandBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1219986867152359466

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

sinful phoenixBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

rose hearth
#

req_6bx2hoZQly5NIB
What is the issue you are facing exactly ?

#

this request is a successful one.

lavish bloom
#

Apologies. I am finding it difficult to explain it in the format of the template you guys have. I was already working with this on Discord last week. I have been pointed in a direction but unsure exactly what to do. Here is my problem:

I currently take payments from customers on my web site using Stripe and it works fine. I am using Stripe Elements, so fairly high level and simple to do.

What I am now trying to do is to record those payments on a third party site (guesty.com). My site rents out corporate accommodation and guesty.com provide an API to get availability and prices for properties and I use the API to populate the property searches on my site. So now I want to use their API to record the properties which I have rented. To do that, I need to create a customer object on their site and then add a 'payment method' to that customer. Then I POST the property rental details to the API and it is now recorded on their system and we get to do nice reports and stuff like that. However, my problem is that when I try to post the payment method to the API it errors, and tells me that the payment method id has already been used against a customer. I will post here, the answer I got from their API support which might shed some light on the problem...

#

Here is the reply from Guesty help:
Thank you for raising this!

Seems like you are creating a guest in Stripe and you should create the guest in Guesty:
https://open-api-docs.guesty.com/reference/guestsopenapicontroller_createguest

This is because you are checking the card and trying to charge it with the payment method you created to ensure it is valid:
POST /v1/payment_intents/pi_000000000000000/confirm

This creates a Stripe customer that gets attached to the payment method you created and then Guesty receives an error.

The options you have to implement it are the following:

Omit the pre-charge and subscribe to payment.failed webhook to monitor failed payments on the reservations. (recommended)
Tokenize the card again after you have done the check and send Guesty a fresh pm_token that has not been used before.

Let me know if this helps!

Guesty Open API

Create guest

#

So, how do I create a Stripe payment method, without actually attaching it to a customer, perhaps without even taking the payment (so that Guesty can do it from their API)

rose hearth
#

when I try to post the payment method to the API it errors, and tells me that the payment method id has already been used against a customer.
Is this happening on Stripe API or Guesty API ?

#

We don't know Guesty here unfortunately.

sinful phoenixBOT
lavish bloom
#

Sorry, that is what the Guesty API tells me. Basically, is it possible for me to make a payment intent and get a payment method, without actually charging a card? I think what the Guesty API needs is a payment method that hasn't been used already (if that is even possible). The Guesty system has our Stripe key so that it can take payments if I give them the payment method... I hope that makes sense..

ember robin
#

We have this guide for saving the payment method without charging it: https://docs.stripe.com/payments/save-and-reuse

However, I'd strongly recommend double checking with Guesty folks about this. They should be the ones providing exact steps on how you need to tokenize the payment method here.

The reason I say that is because there are different ways to integrate with Stripe. Since Guesty is a third-party platform, we don't have any insights into how they use our APIs. They might be expecting a different flow on their side.