#andrewl1030
1 messages · Page 1 of 1 (latest)
No, i am trying to verify the signature of a request from my app UI, not a webhook
Ah, okay same error message
I ran into something similar in my Flask back-end for a test Stripe App. Here's the code snippet I used to create the payload to verify the signatures
payload = json.dumps(
{'user_id': data['user_id'], 'account_id': data['account_id']},
separators=(',', ':')
)
header_kwargs = {'payload': payload,
'header': sig_header, 'secret': APP_SECRET}
try:
stripe.WebhookSignature.verify_header(**header_kwargs)
that worked! The separators piece was what I needed, thank you!