debug
This commit is contained in:
parent
0cf6daf434
commit
a8964793af
|
@ -8,6 +8,8 @@ const stripe = new Stripe(env.stripeSecretKey, {
|
|||
});
|
||||
|
||||
const paymentRouter = express.Router();
|
||||
const endpointSecret = env.stripeWebhookSecret;
|
||||
console.log({ endpointSecret });
|
||||
|
||||
paymentRouter.post(
|
||||
'/webhook',
|
||||
|
@ -18,12 +20,13 @@ paymentRouter.post(
|
|||
// If you are testing with the CLI, find the secret by running 'stripe listen'
|
||||
// If you are using an endpoint defined with the API or dashboard, look in your webhook settings
|
||||
// at https://dashboard.stripe.com/webhooks
|
||||
const endpointSecret = env.stripeWebhookSecret;
|
||||
// Only verify the event if you have an endpoint secret defined.
|
||||
// Otherwise use the basic event deserialized with JSON.parse
|
||||
if (endpointSecret) {
|
||||
// Get the signature sent by Stripe
|
||||
const signature = request.headers['stripe-signature'] || "";
|
||||
console.log(request.headers);
|
||||
console.log({ signature, endpointSecret });
|
||||
try {
|
||||
event = stripe.webhooks.constructEvent(
|
||||
request.body,
|
||||
|
|
Loading…
Reference in New Issue