Skip to content

NevinhaJS/crypto-master

Repository files navigation

Crypto Master

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

yarn dev

Open http://localhost:3000 with your browser to see the result.

Testing Stripe Integration

Prerequisites

  1. A Stripe account (create one at stripe.com)
  2. The Stripe CLI installed (installation guide)

Setup

  1. Login to your Stripe account in the CLI:
stripe login
  1. Start the webhook listener:
stripe listen --forward-to localhost:3000/api/webhooks/stripe
  1. Copy the webhook signing secret shown in the CLI and add it to your .env:
STRIPE_WEBHOOK_SECRET=whsec_xxxxx
STRIPE_SECRET_KEY=sk_test_xxxxx
NEXT_PUBLIC_APP_URL=http://localhost:3000

Testing Webhooks

In a new terminal, you can trigger test events:

# Test successful subscription
stripe trigger checkout.session.completed

# Test subscription cancellation
stripe trigger customer.subscription.deleted

Test Cards

Use these cards in test mode:

  • Success: 4242 4242 4242 4242
  • Decline: 4000 0000 0000 0002
  • 3D Secure: 4000 0000 0000 3220

Learn More

To learn more about Next.js, take a look at the following resources:

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published