#chiayi

1 messages · Page 1 of 1 (latest)

naive ironBOT
odd grail
#

print (sig) returns

t=xxxxx,v1=xxxxxxx

print(raw_payload) returns

b'{"user_id":"usr_xxxxx","account_id":"acct_xxxxxx"}'
hidden basalt
#

It looks like you need to reconstruct the payload before verification.

// Retrieve user id and account id from the request body
  const payload = JSON.stringify({
    user_id: request.body['user_id'],
    account_id: request.body['account_id']
  });
  try {
    // Verify the payload and signature from the request with the app secret.
    stripe.webhooks.signature.verifyHeader(payload, sig, appSecret);
  } catch (error) {
    response.status(400).send(error.message);
  }
odd grail
#

okay, just wondering if my app_secret should be the string from here?