Skip to content

Instantly share code, notes, and snippets.

@danielschmitz
Created January 7, 2018 11:27
Show Gist options
  • Save danielschmitz/da4e7a42e7ebb64c20ecae5f902a7458 to your computer and use it in GitHub Desktop.
Save danielschmitz/da4e7a42e7ebb64c20ecae5f902a7458 to your computer and use it in GitHub Desktop.
src/main.js
// src/main.js
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
})
@muansang-preo
Copy link

app.post('/create-checkout-session', async (req, res) => {
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [
{
price_data: {
currency: 'usd',
product_data: {
name: 'Product Name',
},
unit_amount: 5000, // Amount in cents
},
quantity: 1,
},
],
mode: 'payment',
success_url: ${YOUR_URL}/success,
cancel_url: ${YOUR_URL}/cancel,
});

res.json({ id: session.id });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment