update stripe and stripe api
This commit is contained in:
@@ -2,7 +2,7 @@ import Stripe from 'stripe';
|
||||
import { AccountService } from '~~/lib/services/account.service';
|
||||
|
||||
const config = useRuntimeConfig();
|
||||
const stripe = new Stripe(config.stripeSecretKey, { apiVersion: '2022-11-15' });
|
||||
const stripe = new Stripe(config.stripeSecretKey, { apiVersion: '2023-10-16' });
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
const stripeSignature = getRequestHeader(event, 'stripe-signature');
|
||||
@@ -36,6 +36,12 @@ export default defineEventHandler(async event => {
|
||||
});
|
||||
}
|
||||
|
||||
if(stripeEvent.type){
|
||||
console.log(`stripeEvent.type=${stripeEvent.type}`)
|
||||
} else {
|
||||
console.log(`wtf no stripe event type ${stripeEvent}`);
|
||||
}
|
||||
|
||||
if (
|
||||
stripeEvent.type &&
|
||||
stripeEvent.type.startsWith('customer.subscription')
|
||||
|
||||
Reference in New Issue
Block a user