#chiayi
1 messages · Page 1 of 1 (latest)
sig_header = request.headers.get("stripe-signature")
try:
event = stripe.WebhookSignature.verify_header(
await request.body(), sig_header, endpoint_secret
)
except stripe.error.SignatureVerificationError as e:
return {"message": f"Webhook signature verification failed. {e}"}
nope because i am not trying to build a webhook
What do you mean by this?
i am trying to verify whether the request my backend server is receiving is coming from my stripe app
is there a way to do this?
What's other request could come from Stripe if not webhook notification?
i am following this doc https://stripe.com/docs/stripe-apps/build-backend#send-a-signed-request
and my appSecret mentioned here
// Find your app's secret in your app settings page in the Developers Dashboard.
const appSecret = 'absec_...';
doesn't work, i suspect its because my stripe app is running on local development server instead of live mode
let me reframe what i am trying to do - my stripe app is trying to get a response from one of my backend server api
the api returns a boolean value on whether the user has previously registered an account on our company website
Oh, it is about Stripe Apps. Sorry, I completely misunderstood.
Where did you get the Live mode key?
i got it here
In Test mode?
yes, forgot to mention its the same signing secret whether it is in test mode or live mode
when i run stripe app on local development server it triggers SignatureVerificationError
i am just thinking whether if i can only test verify_header on test/live mode unless there is a way to get signing secret for testing on local development server