GiselaMD / e-otimiza

Home Page:e-otimiza.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

E-Otimiza App (v1)

E-Otimiza is a POS using TypeScript, Nextjs, and react-stripe-js

Included

How to run the project

Install the dependencies and start the development server.

yarn
yarn dev

To run tests you can run:

yarn test

Required configuration to use Stripe

Copy the .env.local.example file into a file named .env.local in the root directory of this project:

cp .env.local.example .env.local

You will need a Stripe account (register) to run this sample. Go to the Stripe developer dashboard to find your API keys and replace them in the .env.local file.

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=<replace-with-your-publishable-key>
STRIPE_SECRET_KEY=<replace-with-your-secret-key>

Forward webhooks to your local dev server

First install the CLI and link your Stripe account.

Next, start the webhook forwarding:

stripe listen --forward-to localhost:3000/api/webhooks

The CLI will print a webhook secret key to the console. Set STRIPE_WEBHOOK_SECRET to this value in your .env.local file.

Setting up a live webhook endpoint

After deploying, copy the deployment URL with the webhook path (https://your-url.now.sh/api/webhooks) and create a live webhook endpoint in your Stripe dashboard.

Once created, you can click to reveal your webhook's signing secret. Copy the webhook secret (whsec_***) and add it as a new environment variable in your Vercel Dashboard:

  • Select your newly created project.
  • Navigate to the Settings tab.
  • In the general settings scroll to the "Environment Variables" section.

After adding an environment variable you will need to rebuild your project for it to become within your code. Within your project Dashboard, navigate to the "Deployments" tab, select the most recent deployment, click the overflow menu button (next to the "Visit" button) and select "Redeploy".

Demo data

The demo is running in test mode -- use 4242424242424242 as a test card number with any CVC + future expiration date.

Use the 4000000000003220 test card number to trigger a 3D Secure challenge flow.

Read more about testing on Stripe at https://stripe.com/docs/testing.

About

e-otimiza.vercel.app


Languages

Language:TypeScript 98.9%Language:JavaScript 1.1%