Configuration
After installing the plugin, configure it in WooCommerce → Settings → KhaimePay.
Required Settings
| Setting | Description | Example |
|---|
| Environment | Sandbox for testing, Live for production | Sandbox |
| API Key | Your Partner API key | pk_sandbox_bff301... |
| Webhook Secret | For verifying webhook signatures | whsec_abc123... |
Auto-Detected Settings
When you save your API key or click Test Connection, the plugin automatically detects:
| Setting | Source |
|---|
| Merchant ID | Retrieved from the Khaime API using your API key |
| Baseline Currency | Your 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:
| Setting | Default | Description |
|---|
| Enable/Disable | Disabled | Toggle 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 Type | Default |
|---|
| Home / Front Page | Enabled |
| Shop / Archive Pages | Enabled |
| Single Product Pages | Enabled |
| Cart | Enabled |
| Checkout | Disabled |
| All Other Pages | Enabled |
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:
- Cookie — wins if set by the currency switcher
- WooCommerce session
- IP geolocation
- 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.