#allan_chan

1 messages · Page 1 of 1 (latest)

craggy krakenBOT
odd cove
#

Hi there, can you check if you are using the correct webhook secret in your webhook endpoint?

lilac lake
#

Is the key here

#

right?

odd cove
#

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.

lilac lake
#

ok, thank you for mind

lilac lake
#

could you pls check

odd cove
#

Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details

lilac lake
#

acct_1MpA5UAGBn007jGA

odd cove
#

OK, can you share with me the code?

lilac lake
odd cove
#

I mean your code, not the debug info.

lilac lake
#

Any problems?

#

Have you checked yet?

odd cove
#

I noticed that there's a 1681097193 prefix in the signedPayload string

#

Is it something added by your code?

lilac lake
#

No

odd cove
#

I don't see signedPayload in any part of your code.

lilac lake
#

You can see the first parameter of the handleOrder method

odd cove
#

But it's called payInfo.

lilac lake
#

The parameter namd has been changed

#

ls the version of the java package incorrect?

lilac lake
odd cove
#

OK. so you are talking about the signedPayload in the verifyHeader function.

craggy krakenBOT
lilac lake
#

Signature is this method

#

verify signature is this method

twilit sphinx
#

👋 Taking over this thread, catching up now

lilac lake
#

thank you , could you please check

twilit sphinx
#

What is the error message you're facing? Are you manually verifying the signature or using Webhook.constructEvent provided by the stripe-java library?

lilac lake
#

Firstly, the signature comparison cannot be passed. Secondly, using stripe-java library

#

Which version do you want to use now?

twilit sphinx
#

What is the detailed exception error message?

lilac lake
#

com.stripe.exception.SignatureVerificationException: No signatures found matching the expected signature for payload

twilit sphinx
#

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

lilac lake
#

Let me check

#

ok,thank you

twilit sphinx
#

No problem! Happy to help 😄

lilac lake
#

What are the parameters for participating in signature

twilit sphinx
#

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

lilac lake
#

I use the HttpServletRequest stream to retrieve data, while Stripe uses Spark to retrieve data

twilit sphinx
#

Let me find the right way to retrieve request body with HttpServletRequest

lilac lake
#

Unable to receive data using Spark

twilit sphinx
#

More specifically:

String json = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8);
Event event = Webhook.constructEvent(json, header, endpointSecret);
lilac lake
#

I try it