Back to projects
Jun 26, 2024
3 min read

Stripe & Flutterflow Pricing

A customizable Next.js 14 pricing component with Stripe (USD) and FlutterFlow (NGN) integration. Built with Shadcn.

This component is for developers who want to add an easy-to-use and adaptable pricing page quickly to their Next.js apps. It includes payment processing through Stripe and FlutterFlow.

Features

  • Dynamic Pricing Cards: Includes three pricing tiers—Basic, Popular, and Advance.
  • Customizable Tabs: Switch between monthly, weekly, and yearly pricing options.
  • Currency Dropdown: Toggle between USD and NGN currencies.
  • Stripe Integration: Handles payments in USD.
  • FlutterFlow Integration: Manages payments in NGN.
  • Shadcn Components: Utilizes Shadcn for a seamless and stylish UI.
  • Fully Customizable: Easily adjust pricing plans, currency options, and design elements.

Technologies

  • Next.js: A React framework for server-rendered and statically generated web applications.
  • TypeScript: For adding static type definitions.
  • Shadcn UI: A collection of components for building UI.
  • Stripe: Handles payments and transactions in USD.
  • Flutterwave-react-v3: Manages payments and currency conversion in NGN.

Installation

Clone & Run Locally:

  • Clone this repository.
  • Install Dependencies: npm install
  • Run npm run dev to start
  • You can access the the application at http://localhost:3000

Import In Your Project:

  • Make sure you have initialized Shadcn UI in your project

  • Use your package manager to install the required dependencies:

npm install @stripe/stripe-js stripe flutterwave-react-v3
  • Copy the following components into your project:
app/components/pricing.tsx
app/components/PaymentComponent.tsx
app/components/CurrencyDropdown.tsx
  • Copy the page into your project:
app/page.tsx
  • Copy Route Handler in your project:
app/api/create-checkout-session
  • Define your pricing data in a data.ts file. Here’s an example of the data format:
PropertyTypeExample Value
titlestring”G-Basic”
monthlyPricenumber60
quarterlyPricenumber18
yearlyPricenumber72
yearlyPriceNgnnumber65294
quarterlyPriceNgnnumber15000
monthlyPriceNgnnumber5000
monthlySavePercentnumber0
quarterlySavePercentnumber5
yearlySavePercentnumber15
descriptionstring”Upgrade today for amazing exclusive offers.”
featuresarray[{ text: “Infinite Chatting”, includedMonthly: true, includedQuarterly: true, includedYearly: true }]
actionLabelstring”Choose Plan”
popularbooleantrue

How It Can Be Improved

  • Real-time Currency Updates: Implement dynamic pricing changes based on real-time currency exchange rates by integrating a real-time currency API. This will ensure that pricing remains accurate and up-to-date across different currencies.