#凱文

1 messages · Page 1 of 1 (latest)

dire pondBOT
prime siren
pastel kettle
#

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

prime siren
#

for every request to Stripe you'll have a requestId. you can find it in the header response of the API call

pastel kettle
#

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

prime siren
#

No that's not the requestId, that's a PaymentIntent Id.

#

I found a requestId:
req_QzjggH2tKmZ3Y7

#

The expires_at timestamp must be at least 30 minutes from Checkout Session creation.

pastel kettle
#

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!

dire pondBOT
pastel kettle
#

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?

velvet schooner
#

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.

pastel kettle
#

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

velvet schooner
#

Yes you need to wait 30 minutes if you want to test this.

pastel kettle
#

Okay, thank you very much for your help, thank you very much

velvet schooner
#

Happy to help 🙂