#formstack-t-chambers_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1237789506023849994
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I should note the above request ID is not from my account, it's our customer's Stripe account (which I do not have access to).
Hello! The request you made specified an existing Payment Method, but that Payment Method was already used and can't be used again. If you want to save a Payment Method for future reuse you need to set it up by using a Setup Intent or a Payment Intent with setup_future_usage. Can you tell me more about your payment flow? What happens initially, when a customer provides new payment info, and what happens later, when you want to reuse the payment info they previously provided?
That is the thing.. It's not technically our payment flow.. It's our customer's payment flow. We provide Oneline form creation and submission collection services. Our customers create a form with our software and we host that form. Data comes in and we store it for them. With the incoming data we can send it to any number of places. In our customer's case (and with several of our customers), we integrate with Stripe to collect payments on behalf of the customer. So the customer provides us their Stripe credentials (we actually use OAuth2 for Stripe), with the purchase comes in (when the end-user completes the form with payment information), we pass that information to Stripe and Stripe does it's magic and sends an update to use regarding that transaction.
I believe setting setup_future_usage to on_session is the best option... However, I am not sure how that will impact our other customers.. Also, I am unsure how to test it. I can submit purchases using any one of Stripe's test credit card number but I didn't see one for this specific error message.
To clarify, are you involved in the process when the customer initially provides their payment info, or only after that?
Our software is the process when the customer initially makes the sale. However, we don't really store "customer" information so it won't be possible to associate the customer with future purches or credit card usage. For us, its a one-time thing. However the same customer may come back and make a another purchase cause the error.. We have no way to detect if that is a repeat customer (or paymethod).
That's going to be a problem. In order for a Payment Method to be reused it needs to be attached to a Customer in Stripe, and for another payment to be made with that Payment Method both the Payment Method and the Customer need to be specified.
I'm not sure I understand, though. If you can't detect a repeat customer, how are you getting the ID of an already-existing Payment Method?
"how are you getting the ID of an already-existing Payment Method?" We are not getting that id. We present a form, the end-user completes the form with credit card details.. We don't store the credit card details.. For this conversation we don't really store customer information.. The first transaction, to us, looks the same as the 10th transaction.
So for all ten transactions the customer has to input their payment details from scratch every time?
That is correct
In that case I'm not sure I understand the issue... you would only be using the Payment Method once, so it should work fine. Are you trying to create more than one transaction with the same Payment Method?
Going back to your original API request that threw the error, you had already used that Payment Method previously for a different Payment Intent in this request: req_xmqsHD8wqaelrj. That used it up, so it couldn't be used again, which is why you got the error on request req_8DbKUl1DSD88OY.
Why did you try to use the same Payment Method twice?
"Why did you try to use the same Payment Method twice?" - we didn't.. We simply collect the data and pass it to Stripe. The end-user later decided to make a another purchase using the same card, which is we got the error.
Here is an example form
https://terarychambers.formstack.com/forms/form_1900_stripe_test_repeat_credit_card_number_use
That is just a test form, I am not sure its integrated with Stripe right or not. But its public facing, no log-in required. The end-user can fill-out that form as many times as you want. We do not store the user details in any meaningful wayfor future reference (we store the data but to us its just data, often times encrypted such that we can not encrypted, only our customers can decrypt the the end-user details).
Formstack Form - FORM-1900_stripe_test_repeat_credit_card_number_use
Let's back up a bit. Are you able to open both of those requests in the Dashboard and look at them side by side in two windows/tabs?
Nope. I am not able to open those requests. As I said previously, that request ID is from our mutual customer and I do not have access to their Stripe account. Our mutual customer provided me that request id to research the error.
I am not able to recreate the error (part of my inquiry now).
Both of those requests are to create and confirm a Payment Intent. The details provided are identical for each request, including the same Payment Method ID. The first one succeeded, the second one failed because the Payment Method was used up by the first request.
If you can't see these requests in the Dashboard it's going to be very difficult for your to debug and investigate the issue.
I have my own test account but I am not sure how to create that error using the Stripe provided Credit Card numbers
I think there's a misunderstanding. Why do you think you could recreate the error by using a particular test card number?
My question is... How can I recreate the error?
You need to use the same Payment Method twice without attaching it to a Customer.
Does that help? Are you able to make progress?
I think.. I hadn't thought of that.. I thought I was attaching incorrectly.
Maybe I can better describe the use case as.
We provide form hosting service. Our customers use our forms to collect data. They provide us an public encryption key that we use to encrypt their data. Before we encrypt the data we submit the payment details to Stripe to charge the end-user's credit card. After that transaction is complete we encrypt the customer's data. We have no way to decrypt the customer's data. So the the next time the end-user uses our form we have no way to determine if that is a repeat customer or what card they used.
Given that scenario we should not associate the pay method with the customer within Stripe (through our API calls)?
Sorry, I'm not really sure what all that means. Let's try this another way. Do you have code in your system that creates a Payment Intent?
yes
Okay, in that code are you specifying a Payment Method?
Yes. We set the payment_method form the Payment Method that Stripe provides us because we use the Stripe Libraries https://www.npmjs.com/package/stripe and https://www.npmjs.com/package/react-stripe-js
Okay, so what's happen is that code seems to have been called twice with the same Payment Method ID.
That's what led to the error.
You should put a check in place to make sure you never use the same Payment Method ID twice, since you're not setting them up for reuse.
Can you tell me the time difference between the two transactions? Was it seconds apart or longer?
They were days apart.
So, Stripe provided the two Paymethod Ids.. I assume they did that because the same person with the same card tried a second, legitimate transaction.
No.
That's not how Stripe works.
If someone enters payment info we generate a Payment Method ID representing that payment info. If they then provide the same payment info again we generate a completely different Payment Method ID even though it's the same payment info.
We do not store the payment method IDs.. It wouldn't be possible for us to re-use the same Id.. How would we get the same paymentId twice?
And, I want to be very clear, the requests show your system is trying to do almost the exact same thing in both instances. Same amount, same description, mostly the same metadata, etc. The only difference is the submissionId.
I can't say, I don't know how your system works.
It would be much clearer and easier if you could see these requests in the Dashboard. Can you ask whomever has access to the Dashboard to give you screenshots of these two requests?
To clarify, you don't have access to the Formstack Stripe Dashboard?
The request being nearly identical makes sense. Our forms are simple so there wont be much variance form one transaction to another. We're not Amazon :). In most cases our customers only have a few product offerings.
Can you look up the submission ID in your system?
I surely can