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"
CREATE TABLE idempotency_keys (
id BIGSERIAL PRIMARY KEY,
idempotency_key TEXT NOT NULL,
request_path TEXT NOT NULL,
request_fingerprint TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'in_progress',
import uuid
from django.db import models
class Cart(models.Model):
OPEN = "open"
import type { Redis } from "ioredis";
export interface StoredResponse {
status: "pending" | "completed";
fingerprint: string;
httpStatus?: number;
<?php
namespace App\Payment;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
<?php
namespace App\Controller;
use App\Message\ProcessStripeEvent;
use App\Webhook\StripeSignatureVerifier;
const express = require('express');
const webhookRouter = require('./webhookRouter');
const apiRouter = require('./apiRouter');
const app = express();
@Entity
@Table(name = "idempotency_records",
uniqueConstraints = @UniqueConstraint(columnNames = "idempotency_key"))
public class IdempotencyRecord {
public enum Status { IN_PROGRESS, COMPLETED }