Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.khaime.com/llms.txt

Use this file to discover all available pages before exploring further.

Configuration

After installing the plugin, configure it in WooCommerce → Settings → KhaimePay.

Required Settings

SettingDescriptionExample
EnvironmentSandbox for testing, Live for productionSandbox
API KeyYour Partner API keypk_sandbox_bff301...
Webhook SecretFor verifying webhook signatureswhsec_abc123...
Get your API key and webhook secret from app.khaime.com → Settings → API.

Auto-Detected Settings

When you save your API key or click Test Connection, the plugin automatically detects:
SettingSource
Merchant IDRetrieved from the Khaime API using your API key
Baseline CurrencyYour store’s base currency configured in your Khaime dashboard
These are fetched from your account and stored automatically. The baseline currency is also synced to WooCommerce’s store currency setting.

Payment Gateway Settings

Go to WooCommerce → Settings → Payments → KhaimePay → Manage:
SettingDefaultDescription
Enable/DisableDisabledToggle the payment method on/off
Title”KhaimePay”Shown to customers at checkout
Description”Pay securely with your local currency.”Shown below the title
The payment method displays small icons for supported payment methods (Visa, Mastercard, Amex, Apple Pay, Google Pay, Paystack) at checkout.

Webhook Setup

The plugin automatically registers a webhook endpoint:
https://yourstore.com/wp-json/khaime/v1/webhook
Copy this URL and add it to your Khaime Dashboard → Settings → API → Webhook URL.

Custom API URL

For development/testing with a local backend, set the Custom API URL:
http://localhost:3025/api/v1
This overrides the default API endpoints:
  • Live: https://api.khaime.com/api/v1
  • Sandbox: https://api.khaimedev.com/api/v1

Testing the Connection

After entering your credentials, click Test Connection on the settings page. A successful test confirms:
  • API key is valid
  • Backend is reachable
  • Merchant account is active
  • Merchant ID and baseline currency are auto-detected and synced

Currency Switcher Display

Control which pages show the floating currency switcher using checkboxes:
Page TypeDefault
Home / Front PageEnabled
Shop / Archive PagesEnabled
Single Product PagesEnabled
CartEnabled
CheckoutDisabled
All Other PagesEnabled
Checkout is disabled by default to prevent currency changes during the payment flow.
The switcher can also be placed manually using:
  • Shortcode: [khaime_currency_switcher] or [khaime_currency_switcher style="buttons"]
  • Widget: Appearance → Widgets → Khaime Currency Switcher (supports dropdown or button style)

Theme Color Inheritance

The floating switcher automatically inherits your theme’s primary color. It works out of the box with popular themes like Woodmart and WordPress block themes. If your theme doesn’t use standard CSS custom properties, the switcher falls back to KhaimePay’s default accent color.

Custom Price Selectors

If your theme or third-party plugins render prices outside of WooCommerce’s standard price elements, add their CSS selectors in the Custom Price Selectors textarea (one per line):
.my-theme-price
.custom-total-amount
The client-side price converter will scan and convert prices inside those elements automatically.

Diagnostics Panel

The settings page includes a live diagnostics panel for debugging currency issues.

Geolocation Detection

Shows the detected client IP, whether the geolocation API responded, the detected country and currency, and whether the result is cached.

Active Currency Resolution

Displays the priority chain and highlights which source determined the customer’s currency:
  1. Cookie — wins if set by the currency switcher
  2. WooCommerce session
  3. IP geolocation
  4. Baseline currency (fallback)

Exchange Rates

Lists a test rate between your baseline and a target currency, plus all active currency rates with their current values.

Simulate Currency

Set a test currency cookie to preview how the store looks for visitors from another country. Open the frontend in a new tab to see the effect.

Flush All Caches

Clears all cached exchange rates, geolocation data, and product price caches. Use if prices seem stale after changing settings.