#mp_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/1290571079219150860
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
cus_QuONDLiMSUIopT
When a payment method is not attached to a customer, it can only be used once. In this case, when pm_1Q2ZbgJqE5f9ucQhLoxzy736 was created (https://dashboard.stripe.com/logs/req_YrEiRjSDyVe6bU), it was not attached to a customer and was used to complete a payment (https://dashboard.stripe.com/logs/req_UMUAZ0PsvnTqRS). If you would like to re-use a payment method, you will need to attach it to a customer first.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
How did that happen?
I believe it was used only once?
Looking at the customer, they have tried three times to make a payment and the above was the first one?
Looking at the customer, they have tried three times to make a payment and the above was the first one?
Can you share the payment intents for the 3 attempts?
-
pi_3Q2ZazJqE5f9ucQh1tVw3SQB
-
pi_3Q2Zb6JqE5f9ucQh1yQoLg3a
-
pi_3Q2ZfFJqE5f9ucQh0LZT8prf
I am only interested in pi_3Q2ZazJqE5f9ucQh1tVw3SQB as thatg was the first payment made
Usually you create a customer first and then attach a payment right? I am clueless how did the above happen
The payment method was first confirmed for pi_3Q2Zb6JqE5f9ucQh1yQoLg3a (https://dashboard.stripe.com/logs/req_UMUAZ0PsvnTqRS, 2024-09-24 14:20:49 UTC). Because it was confirmed once, it is considered to be consumed. The confirmation for pi_3Q2ZazJqE5f9ucQh1tVw3SQB happened later (https://dashboard.stripe.com/logs/req_Zb3FYGzQItWweA, 2024-09-24 14:20:53 UTC), hence you got the message that it needs to be attached to a customer.
Yes, you will need to create a customer first before attaching a payment method to them. You can use SetupIntent (https://docs.stripe.com/api/setup_intents/create) and pass the customer ID (https://docs.stripe.com/api/setup_intents/create#create_setup_intent-customer) so that the payment method that is created will be automatically attached to the customer.
What is usually the process like?
which process?
I mean how does a payment get attached before creating a customer
it depends on the exact integration you're using. You mention"paying for a subscription", usually the way that works is you confirm the PaymentIntent of the first Invoice on the frontend (https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements) and that will automatically attach the payment method as well as charge it at the same time.
or in other integration approaches, the payment method is attached when confirming a SetupIntent
Sorry for the back and forth.
We have been using the same process so I don't know why the above issue happened
looks to me like maybe you have a bug where you create two different subscriptions and then the problem which leads to confusion/complication
you probably want to make sure the user can not double click the button that you use to submit the request to your backend to create a Subscription and set it as disabled while that request is loading.
you can see you submitted two identical requests very close together, which is usually a bug/double-clicking not being handled
https://dashboard.stripe.com/logs/req_IQDi28pzEnhc9v
https://dashboard.stripe.com/logs/req_fFKV98K1GT2UPT
How do you know it is two identical requests? Both links have the same request id
https://dashboard.stripe.com/logs/req_fFKV98K1GT2UPT I mean that one sorry