Open ogawa5773 opened 1 year ago
Not sure, but since this comment, the readme uses a different env variable; here's my version
// ./api/src/lib/stripe.js
import Stripe from 'stripe'
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY)
export const handleStripeWebhooks = (event, context, webhooksObj) => {
let stripeEvent
try {
const sig = event.headers['stripe-signature']
stripeEvent = stripe.webhooks.constructEvent(
event.body,
sig,
process.env.STRIPE_WEBHOOK_SK
)
let results = null
if (typeof webhooksObj[stripeEvent.type] !== 'undefined') {
results = webhooksObj[stripeEvent.type](event, context)
}
return results
} catch (error) {
console.log(error)
throw error
}
}
What is happening
Follow the README and in the step "3. Seeding your Stripe account" I got an error like below
My Solution
I was able to proceed without any problems by revert the following commit
Question
Is this an intentional file deletion or a bug?