update stripe and stripe api
This commit is contained in:
14
package-lock.json
generated
14
package-lock.json
generated
@@ -17,7 +17,7 @@
|
|||||||
"generate-password-ts": "^1.6.5",
|
"generate-password-ts": "^1.6.5",
|
||||||
"openai": "^4.28.0",
|
"openai": "^4.28.0",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"stripe": "^11.18.0",
|
"stripe": "^14.17.0",
|
||||||
"superjson": "^2.2.1",
|
"superjson": "^2.2.1",
|
||||||
"trpc-nuxt": "^0.10.19",
|
"trpc-nuxt": "^0.10.19",
|
||||||
"vanilla-cookieconsent": "^2.9.2",
|
"vanilla-cookieconsent": "^2.9.2",
|
||||||
@@ -11820,9 +11820,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/stripe": {
|
"node_modules/stripe": {
|
||||||
"version": "11.18.0",
|
"version": "14.17.0",
|
||||||
"resolved": "https://registry.npmjs.org/stripe/-/stripe-11.18.0.tgz",
|
"resolved": "https://registry.npmjs.org/stripe/-/stripe-14.17.0.tgz",
|
||||||
"integrity": "sha512-OUA32uhNoSoM6wOodyFbV+3IBCoO140uzdXmBArQ0S88D4EbH91xl2v+Ml1sKalcFKUBadHLeHfU/p9AbsOfGw==",
|
"integrity": "sha512-iwV5SKoXuRIQFne4twGwiiczOkVW73eE2CKn6ltUKCacDy4SGHBX6kj1/xCV2bzzzQjcVtsh5F1aAbJTmf3tLw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": ">=8.1.0",
|
"@types/node": ">=8.1.0",
|
||||||
"qs": "^6.11.0"
|
"qs": "^6.11.0"
|
||||||
@@ -22360,9 +22360,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"stripe": {
|
"stripe": {
|
||||||
"version": "11.18.0",
|
"version": "14.17.0",
|
||||||
"resolved": "https://registry.npmjs.org/stripe/-/stripe-11.18.0.tgz",
|
"resolved": "https://registry.npmjs.org/stripe/-/stripe-14.17.0.tgz",
|
||||||
"integrity": "sha512-OUA32uhNoSoM6wOodyFbV+3IBCoO140uzdXmBArQ0S88D4EbH91xl2v+Ml1sKalcFKUBadHLeHfU/p9AbsOfGw==",
|
"integrity": "sha512-iwV5SKoXuRIQFne4twGwiiczOkVW73eE2CKn6ltUKCacDy4SGHBX6kj1/xCV2bzzzQjcVtsh5F1aAbJTmf3tLw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": ">=8.1.0",
|
"@types/node": ">=8.1.0",
|
||||||
"qs": "^6.11.0"
|
"qs": "^6.11.0"
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
"generate-password-ts": "^1.6.5",
|
"generate-password-ts": "^1.6.5",
|
||||||
"openai": "^4.28.0",
|
"openai": "^4.28.0",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"stripe": "^11.18.0",
|
"stripe": "^14.17.0",
|
||||||
"superjson": "^2.2.1",
|
"superjson": "^2.2.1",
|
||||||
"trpc-nuxt": "^0.10.19",
|
"trpc-nuxt": "^0.10.19",
|
||||||
"vanilla-cookieconsent": "^2.9.2",
|
"vanilla-cookieconsent": "^2.9.2",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
const config = useRuntimeConfig();
|
const config = useRuntimeConfig();
|
||||||
const stripe = new Stripe(config.stripeSecretKey, {
|
const stripe = new Stripe(config.stripeSecretKey, {
|
||||||
apiVersion: '2022-11-15'
|
apiVersion: '2023-10-16'
|
||||||
});
|
});
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
let customer: Stripe.Response<Stripe.Customer | Stripe.DeletedCustomer>;
|
let customer: Stripe.Response<Stripe.Customer | Stripe.DeletedCustomer>;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { AccountService } from '~~/lib/services/account.service';
|
|||||||
import type { AccountWithMembers } from '~~/lib/services/service.types';
|
import type { AccountWithMembers } from '~~/lib/services/service.types';
|
||||||
|
|
||||||
const config = useRuntimeConfig();
|
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 => {
|
export default defineEventHandler(async event => {
|
||||||
const body = await readBody(event);
|
const body = await readBody(event);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import Stripe from 'stripe';
|
|||||||
import { AccountService } from '~~/lib/services/account.service';
|
import { AccountService } from '~~/lib/services/account.service';
|
||||||
|
|
||||||
const config = useRuntimeConfig();
|
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 => {
|
export default defineEventHandler(async event => {
|
||||||
const stripeSignature = getRequestHeader(event, 'stripe-signature');
|
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 (
|
if (
|
||||||
stripeEvent.type &&
|
stripeEvent.type &&
|
||||||
stripeEvent.type.startsWith('customer.subscription')
|
stripeEvent.type.startsWith('customer.subscription')
|
||||||
|
|||||||
Reference in New Issue
Block a user