Skip to main content

Installation

Install the Package

Requirements

  • React 17.0.0 or higher
  • A Khaime merchant account
The package includes Stripe and Paystack as dependencies - you don’t need to install them separately.

Quick Start

1. Create a payment on your backend

Call the Khaime API to create a payment intent and get a token:

2. Pass the token to your frontend

3. Render the checkout component

What Happens Behind the Scenes

When you render <KhaimeCheckout token={...} />:
  1. The component decodes the token
  2. It detects which payment gateway to use (Stripe, Paystack, etc.)
  3. It renders the appropriate UI:
    • Stripe: Embedded payment form with card input
    • Paystack: Button that opens a popup
    • Startbutton: Button that redirects to payment page
  4. When payment completes, onSuccess is called with the result
You don’t need to know which gateway is being used - it’s fully abstracted.

Next Steps

Components Reference

Learn about all available components and their props