require 'sinatra/base'
require 'json'
require_relative 'signature_verifier'
class WebhookApp < Sinatra::Base
configure do
class CreateStripeEvents < ActiveRecord::Migration[7.1]
def change
create_table :stripe_events do |t|
t.string :stripe_event_id, null: false
t.string :event_type, null: false
t.string :status, null: false, default: "received"
import hashlib
import hmac
import time
class SignatureError(Exception):
class CreateWebhookEvents < ActiveRecord::Migration[7.1]
def change
create_table :webhook_events do |t|
t.string :event_id, null: false
t.string :source, null: false, default: "stripe"
t.string :event_type, null: false
const express = require('express');
const webhookRouter = require('./webhookRouter');
const apiRouter = require('./apiRouter');
const app = express();
<?php
namespace App\Jobs;
use App\Models\Invoice;
use App\Services\StripeGateway;
package webhook
import (
"encoding/json"
"io"
"net/http"
import hmac
import hashlib
import time
from fastapi import Request, HTTPException, status