#anrighiwr_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/1227961113107370035
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
It seems like you're trying to confirm the payment when creating the PaymentIntent: https://dashboard.stripe.com/test/logs/req_mYYiqIDtWYYf2A
That's why you can't do it on the frontend.
You need to remove confirm: true from the initial request.
i am trying, but it gives me back this error, when creating the PaymentIntent server-side: The parameter confirmation_token cannot be passed when creating a PaymentIntent unless confirm is set to true
๐ stepping in
I think there is a misunderstanding here. Instead of creating a PaymentMethod on the frontend you just create a confirmation token, then you pass that to the backend and create/confirm the PaymentIntent in one request. Are you following https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=payment ?
no, i was following this: https://docs.stripe.com/payments/payment-element/migration-ct#conditional-options
Are you planning on confirming server-side or client-side?
we were triggering the confirm method client-side, in order to show the 3DSecure interface, if needed - but i see that stripe.handleNextAction works as well
so i'm going to create the payment intent server-side, with confirm: true
Okay yeah you would only use a Confirmation Token if you are going to confirm server-side.
Otherwise you don't use Confirmation Tokens
i am trying to use the same flow with this subscription: https://dashboard.stripe.com/test/logs/req_ArVhdEkSHW5F6Z
You want to confirm server-side?
but this is the error triggered: Uncaught (in promise) IntegrationError: handleNextAction: The PaymentIntent supplied is not in the requires_action state.
Correct, you don't call handleNextAction() unless you confirm server-side and then 3DS is required.
ok how can i confirm server-side?
when i try to confirm the payment server-side, this is the new error which shows up: Payment details were collected through Stripe Elements using automatic payment methods and cannot be confirmed with a Payment Intent configured with payment_method_types.
Hmm looks like you are passing ```payment_method_types: {
0: "automatic_payment_methods",
},
in your request?
What happens when you remove that?
i added it since it is in the docs: https://docs.stripe.com/api/payment_intents/confirm#confirm_payment_intent-payment_method_types
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah really what you need is automatic_payment_methods.enabled: true: https://docs.stripe.com/api/payment_intents/create#create_payment_intent-automatic_payment_methods but I don't think our confirm API supports this
That is the default on our newer API versions however....
What happens if you try passing that with the confirm API? Can you test that just to check?
Ah actually that won't work.
however, i am not creating a PaymentIntent directly, but while creating a Subscription: https://dashboard.stripe.com/test/logs/req_VXqCvlUuy4Qj52
Okay I remember that this is just a friction point at the moment with using the Subscriptions API.
So yeah what you need to do is actually specify paymentMethodTypes client-side: https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=web&type=payment#additional-options
Let me also check on what the status is on this feedback internally as I know this is an already-discussed rough edge here
Hmm actually
Can you test one more thing?
What happens if you use the 2023-08-16 in that confirmation request?
So try versioning your request to that API version: https://docs.stripe.com/api/versioning
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hmm dang
specifiying card as payment method seems to be working
Client-side?
That should work, it is just a bummer because you lose out on the Automatic Payment Method functionality
i have another issue: in a single PaymentElement implementation, i create two different Subscriptions, to different products - it gives me back this error: The confirmation token has already been used to confirm a previous PaymentIntent
is there any way that i can create two different confirmation token from the same Payment Element? or that i can use twice the same token?
I think what you need to do is create the second subscription, passing in the payment method id that was created as a result of the confirmation token
Recomend testing this out, but I think you need to pass setupFutureUsage in Elements: https://docs.stripe.com/js/elements_object/create_without_intent#stripe_elements_no_intent-options-setupFutureUsage
it works ๐ i just needed to attach it to the customer before
Yeah I think setup future usage allows payment method to automatically attach
i already had that, but it showed me this error: https://dashboard.stripe.com/test/logs/req_pMT7PlkamS2bR5
this was the confirmation token, with setup_future_usage set: https://dashboard.stripe.com/test/logs/req_0nbmzfL48lfCEt