#凱文
1 messages · Page 1 of 1 (latest)
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
I probably don't have an API ID I'm in Java Session.create(params); and it reports a Gson error
SessionCreateParams.builder()
.setCustomerEmail(email) // 帶入電子信箱
.addPaymentMethodType(SessionCreateParams.PaymentMethodType.CARD)
.setMode(SessionCreateParams.Mode.PAYMENT) // 一次性付款
.setSuccessUrl(rootURL + successUrl)
.setCancelUrl(rootURL + cancelUrl) // domain name + 路徑
.setExpiresAt(expirationTime)
Just adding the setExpiresAt
for every request to Stripe you'll have a requestId. you can find it in the header response of the API call
Wait for me, I'll take off the expired time setting, resend it, and check the logs to see if there is an occurrence record.
After I removed the expiration time setting, there was a successful creation and navigation to the payment page, and only then did the log show the request ID:pi_3N7xCAIRY7Sj6EEr1k7MkdMh
If there should be a record for each request, it means that adding the expiration time failed when using Stripe.jre Session.create(params); this method
No that's not the requestId, that's a PaymentIntent Id.
I found a requestId:
req_QzjggH2tKmZ3Y7
The
expires_attimestamp must be at least 30 minutes from Checkout Session creation.
expire_at must be between 30min and 24 hours from Checkout Creation:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-expires_at
Oh! I'm sorry, I gave the wrong ID, thank you so much for helping me find the problem, I will immediately adjust the time to 30 minutes after the test again!
I've changed it to 30 minutes after a successful call to the API, but if I need to test it, would my test be to wait 30 minutes and see what happens?
Hi! I'm taking over this thread.
What do you want to test exactly? That the Checkout Session expired as expected? Then you would need to wait 30 minutes.
hi soma
I need to add an expiration time to the checkout function on my checkout page, currently set to 30 minutes, I am waiting for 30 minutes if I pay or refresh the page to see the result
Yes you need to wait 30 minutes if you want to test this.
Okay, thank you very much for your help, thank you very much
Happy to help 🙂