Skip to content

Latest commit

 

History

History
76 lines (58 loc) · 2.02 KB

File metadata and controls

76 lines (58 loc) · 2.02 KB

@paymesh/stripe

Stripe for Paymesh, with a normalized API on top.

Keep Stripe’s reach and ecosystem, but expose it to your app through the same Paymesh client and event model you can use everywhere else.

Installation · Usage · What you get · Why use it


Installation

npm install paymesh @paymesh/stripe

Usage

import { createClient } from "paymesh";
import { stripe } from "@paymesh/stripe";

const paymesh = createClient({
  provider: stripe({
    secret: process.env.STRIPE_API_KEY!,
    webhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
  }),
});

const checkout = await paymesh.payments.create({
  amount: 4900,
  currency: "USD",
  description: "Growth plan",
  customer: {
    email: "team@example.com",
    externalId: "org_42",
  },
  successUrl: "https://example.com/success",
  cancelUrl: "https://example.com/cancel",
});

const customer = await paymesh.customers.upsert({
  email: "team@example.com",
  externalId: "org_42",
  name: "Acme Inc.",
});

console.log(checkout.id, checkout.checkoutUrl, customer.id);

What You Get

@paymesh/stripe implements checkout creation, native PIX creation and lookup, customers, provider catalog sync, webhook verification, and normalized Stripe event handling through the standard Paymesh contracts.

Why Use It

@paymesh/stripe turns Stripe into a clean provider implementation instead of an application-wide dependency. You keep Stripe checkout, customers, refunds, subscriptions, and webhook verification, while your product code talks to one stable contract.

That makes Stripe easier to adopt today and easier to swap or complement tomorrow.