diff --git a/functions/stripe.ts b/functions/stripe.ts deleted file mode 100644 index 0d9dcd4..0000000 --- a/functions/stripe.ts +++ /dev/null @@ -1,23 +0,0 @@ -const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY); - -exports.handler = async (event: any, context: any) => { - const { amount, currency } = JSON.parse(event.body); - - try { - const paymentIntent = await stripe.paymentIntents.create({ - amount: parseInt(amount), - currency: currency || 'eur', - payment_method_types: ['card'], - }); - - return { - statusCode: 200, - body: JSON.stringify({ ...paymentIntent }), - }; - } catch (error) { - return { - statusCode: 500, - body: JSON.stringify({ error }), - }; - } -}; diff --git a/netlify.toml b/netlify.toml index 8359c40..3768647 100644 --- a/netlify.toml +++ b/netlify.toml @@ -4,12 +4,6 @@ [build] command = "nuxi generate" - functions = "functions" - -[[redirects]] - from = '/api/*' - to = '/.netlify/functions/:splat' - status = 200 [[headers]] for = "/*.js" diff --git a/woonuxt_base/components/shopElements/StripeElement.vue b/woonuxt_base/components/shopElements/StripeElement.vue index ec3ce6d..ba3aaf1 100644 --- a/woonuxt_base/components/shopElements/StripeElement.vue +++ b/woonuxt_base/components/shopElements/StripeElement.vue @@ -1,22 +1,14 @@