0.5.2 • Published 9 months ago

wabe-stripe v0.5.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

What is Wabe?

Wabe is an open-source backend that allows you to create your own fully customizable backend in just a few minutes. It handles database access, automatic GraphQL API generation, authentication with various methods (classic or OAuth), permissions, security, and more for you.

Install for wabe-stripe

bun install wabe # On bun
npm install wabe # On npm
yarn add wabe # On yarn

bun install wabe-stripe # On bun
npm install wabe-stripe # On npm
yarn add wabe-stripe # On yarn

Basic example of wabe-resend usage

import { DatabaseEnum, Wabe, PaymentMode, Currency } from "wabe";
import { StripeAdapter } from "wabe-stripe";

const run = async () => {
  // Ensure your database is running before run the file

  const wabe = new Wabe({
    // Root key example (must be long minimal 64 characters, you can generate it online)
    rootKey:
      "0uwFvUxM$ceFuF1aEtTtZMa7DUN2NZudqgY5ve5W*QCyb58cwMj9JeoaV@d#%29v&aJzswuudVU1%nAT+rxS0Bh&OkgBYc0PH18*",
    database: {
      type: DatabaseEnum.Mongo,
      url: "mongodb://127.0.0.1:27045",
      name: "WabeApp",
    },
    payment: {
      adapter: new StripeAdapter('YOU_STRIPE_SECRET_KEY'),
      currency: Currency.USD,
      supportedPaymentMethods: ['card', 'paypal'],
    },
    port: 3000,
  });

  await wabe.start();

  await wabe.controllers.payment.createPayment({
      cancelUrl: 'https://example.com/cancel',
      successUrl: 'https://example.com/success',
      customerEmail: 'john.doe@example.com',
      paymentMode: PaymentMode.Subscription,
      // Compute the taxe automatically or not
      automaticTax: true,
      recurringInterval: 'month',
      products: [{ name: 'MacBook Pro', unitAmount: 100, quantity: 1 }],
  })
};

await run();
0.5.2

9 months ago

0.5.1

10 months ago

0.5.0

10 months ago