#allan_chan
1 messages · Page 1 of 1 (latest)
Hi there, can you check if you are using the correct webhook secret in your webhook endpoint?
You shouldn't post your key here, discord is a public place and everyone can see it
And yes, this is where you get the key from.
ok, thank you for mind
could you pls check
Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details
acct_1MpA5UAGBn007jGA
OK, can you share with me the code?
I mean your code, not the debug info.
I noticed that there's a 1681097193 prefix in the signedPayload string
Is it something added by your code?
No
I don't see signedPayload in any part of your code.
You can see the first parameter of the handleOrder method
But it's called payInfo.
this parameter was added by you
OK. so you are talking about the signedPayload in the verifyHeader function.
👋 Taking over this thread, catching up now
thank you , could you please check
What is the error message you're facing? Are you manually verifying the signature or using Webhook.constructEvent provided by the stripe-java library?
Firstly, the signature comparison cannot be passed. Secondly, using stripe-java library
Which version do you want to use now?
What is the detailed exception error message?
com.stripe.exception.SignatureVerificationException: No signatures found matching the expected signature for payload
Based on your signature verification code, it's likely that your payload is not in raw, i.e. there might be some modifications to the payload while constructing payInfo
No problem! Happy to help 😄
Stripe uses the timestamp in the header and payload in the body to compute the signature of the event that will be used to compare with the signature in the header
I use the HttpServletRequest stream to retrieve data, while Stripe uses Spark to retrieve data
Let me find the right way to retrieve request body with HttpServletRequest
Can you try setting the request.getInputStream() with setting it to UTF_8 using IOUtils.toString as described in https://github.com/stripe/stripe-java/issues/1371
More specifically:
String json = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8);
Event event = Webhook.constructEvent(json, header, endpointSecret);
I try it