#ndbtss_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/1435172843175542898
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, status being "succeeded" is the source of truth to confirm that a PaymentIntent is paid successfully. You can also consider setting up a webhook, and listen for the payment_intent.succeeded event: https://docs.stripe.com/api/events/types#event_types-payment_intent.succeeded
ok but when i m not in the webhook, when i m using api in backend(java) and i m waiting for the response i want something else that status in string
Hey! Taking over for my colleague. Why the status isn't enough for you ?
Can you share more details please ?
because all my logic is based on that "succeeded" string
if one day stripe decides to change the name of the status, all my payments will fail becaus i always compare teh paymentIntent.getStatus() with "succeeded"
Like in this code for exemple:
public final String STRIPE_STATUS_SUCCEED = "succeeded";
if(!STRIPE_STATUS_SUCCEED.equalsIgnoreCase(paymentIntent.getStatus())) {
tp.setInternalPaymentStatus(InternalPaymentStatus.ERROR.getId());
tp.setErrMsg("ERR Stripe - Payment - " + paymentIntent.getStatus());
}
else {
tp.setInternalPaymentStatus(InternalPaymentStatus.SUCCESS.getId());
}
if stripe decides to change to "successfull" it will enter the "if" clause
if this change, it will lead to a breaking change. So if you don't change your API version, that status will never change
So you can rely on it
thank you