#_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/1329097757603922013
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
PaymentIntentCreateParams.Builder createParams = PaymentIntentCreateParams.builder()
.setAmount(total)
.setDescription(description)
.setConfirm(true)
.setCurrency(currency.getCurrencyCode())
.setPaymentMethod(paymentMethodId)
.setReturnUrl(returnUrl)
this is the paymentintent i use
the return url is well formatted also
๐
According to the requestid you've shared, your integration isn't sending any params.
You need to set return_url
.setReturnUrl(returnUrl)
don't set a return_url?
i'm usiing java to create the payment intennt
Then how are you using the createParams? Have you had a chance to debug and see if you are pssing it correctly to the API call.
Here is an example in Java
https://docs.stripe.com/api/payment_intents/confirm?lang=java
PaymentIntentConfirmParams params =
PaymentIntentConfirmParams.builder()
.setPaymentMethod("pm_card_visa")
.setReturnUrl("https://www.example.com")
.build();
PaymentIntent paymentIntent = resource.confirm(params);
yea i build the param
i need to pass the params to the confirm? isn't creating the payment intent with the
PaymentIntentCreateParams.Builder createParams = PaymentIntentCreateParams.builder()
.setAmount(total)
.setDescription(description)
.setConfirm(true)
.setCurrency(currency.getCurrencyCode())
.setPaymentMethod(paymentMethodId)
.setReturnUrl(returnUrl)
PaymentIntent.create(intentCreateParams); enough?
Ah I see what's happening.
You were creating the PaymentIntent with confirm:true and a return_url already.
The PaymentIntent status is in requires_action and the Customer needs to complete the 3ds action in order to proceed. You don't need to call confirm API.
i check if its in requires_action before i confirm
if (intent.getStatus().equals("requires_action") && intent.getNextAction().getType().equals("use_stripe_sdk")) {
throw new ThreeDSecureRequiredException(intent);
}
PaymentIntentCreateParams.Builder createParams = PaymentIntentCreateParams.builder()
.setAmount(total)
.setDescription(description)
.setConfirm(true)
.setCurrency(currency.getCurrencyCode())
.setPaymentMethod(paymentMethodId)
.setReturnUrl(returnUrl)
.setConfirmationMethod(PaymentIntentCreateParams.ConfirmationMethod.MANUAL).build
this is the full list of params
if thats would help
No, according to the requestId you've shared req_qPQOx93BaZdIcH you are confirming the PaymentIntent despite it's in a requires_action
The next_action is redirect_to_url not use_stripe_sdk, so this if block check isn't hit
oh thanks @unique berry any idea why the next action is redirect_to_url? my integration with stripe is in page iframe
It's beacuse you pass return_url
This is documented here: https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-redirect
well if i don't pass a return_url it will fail saying it needs a return_url
Yeah because you have redirect based payemnt methods enabled. Is the goal to disable redirect based payment methods?