BODYTALK
Wellness with Ease
require 'stripe'
require 'sinatra'
# This is a public sample test API key.
# Don’t submit any personally identifiable information in requests made with this key.
# Sign in to see your own test API key embedded in code samples.
Stripe.api_key = 'sk_test_Ou1w6LVt3zmVipDVJsvMeQsc'
set :static, true
set :port, 4242
YOUR_DOMAIN = 'http://localhost:4242'
post '/create-checkout-session' do
content_type 'application/json'
session = Stripe::Checkout::Session.create({
line_items: [{
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
price: '{{PRICE_ID}}',
quantity: 1,
}],
mode: 'payment',
})
redirect session.url, 303
end
require 'stripe'
require 'sinatra'
# This is a public sample test API key.
# Don’t submit any personally identifiable information in requests made with this key.
# Sign in to see your own test API key embedded in code samples.
Stripe.api_key = 'sk_test_Ou1w6LVt3zmVipDVJsvMeQsc'
set :static, true
set :port, 4242
YOUR_DOMAIN = 'http://localhost:4242'
post '/create-checkout-session' do
content_type 'application/json'
session = Stripe::Checkout::Session.create({
line_items: [{
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
price: '{{PRICE_ID}}',
quantity: 1,
}],
mode: 'payment',
})
redirect session.url, 303
end
npm install --save stripe @stripe/stripe-js next