Please ensure you include your name and invoice number.

<script src="https://js.stripe.com/v3/"></script>


<html>
  <head>
    <title>Buy cool new product</title>
    <script src="https://js.stripe.com/v3/"></script>
  </head>
  <body>
    <button id="checkout-button">Checkout</button>
  </body>
</html>

<html>
  <head><title>Thanks for your payment!</title></head>
  <body>
    <h1>Thanks for your payment!</h1>
    <p>
      We appreciate your business!
      If you have any questions, please email
      <a href="mailto:info@westboro.ie>info@westboro.ie</a>.
    </p>
  </body>
</html>
Stripe.api_key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"

# This example sets up an endpoint using the Sinatra framework.
# Watch this video to get started: https://youtu.be/8aA9Enb8NVc.

require 'json'
require 'sinatra'

post '/create-checkout-session' do
  session = Stripe::Checkout::Session.create({
    payment_method_types: ['card'],
    line_items: [{
      price_data: {
        currency: 'eur',
        product_data: {
          name: 'T-shirt',
        },
        unit_amount: 2000,
      },
      quantity: 1,
    }],
    mode: 'payment',
    success_url: 'https://yoursite.com/success.html',
    cancel_url: 'https://example.com/cancel.html',
  })

  { id: session.id }.to_json
end