Skip to main content

Components

KhaimeCheckout

The main checkout component with order summary and payment form.

Props

string
required
The payment token from your Khaime API. This is an opaque string - pass it directly without parsing.
string
Override the product name shown in the order summary. If not provided, uses the name from the token.
string
Override the product image URL. If not provided, uses the image from the token.
boolean
default:"true"
Whether to show the order summary section above the payment form.
string
Custom text for the submit button. Defaults to “Pay ”.
string
URL to redirect to after 3D Secure authentication (Stripe only). Defaults to current page.
(result: PaymentResult) => void
Called when payment is successful.
(error: PaymentError) => void
Called when payment fails.
() => void
Called when the payment form is ready to accept input.
() => void
Called when user closes the payment popup (Paystack only).

Example with All Props


KhaimePaymentElement

A minimal payment form without the order summary. Use this when you want to build your own checkout UI.

Props

string
required
The payment token from your Khaime API.
string
URL to redirect to after 3D Secure authentication.
string
CSS class name to apply to the container.
(result: PaymentResult) => void
Called when payment is successful.
(error: PaymentError) => void
Called when payment fails.
() => void
Called when the payment form is ready.
() => void
Called when user closes the popup (Paystack only).

Example: Custom Checkout Layout


Types

PaymentResult

Returned in the onSuccess callback.

PaymentError

Returned in the onError callback.

Common Error Codes


Styling

The components come with minimal default styling. You can customize the appearance:

Using className

Using Stripe Appearance API

For Stripe payments, you can customize the payment element appearance:
The appearance prop only affects Stripe payments. Paystack uses its own popup styling.