> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pesaswap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept payments with WooCommerce

The Pesaswap WooCommerce plugin adds Pesaswap as a payment method at your WooCommerce checkout, so your customers can pay with M-Pesa and Airtel Money. No developer required — install the plugin, paste in your credentials, and mobile money appears at checkout.

## Before you start

* A Pesaswap account with a business profile.
* A WordPress site running **WordPress 5.6+** and **WooCommerce 4.0+**.
* Admin access to that WordPress site.

## Set up the plugin

<Steps>
  <Step title="Download the plugin">
    In the Pesaswap dashboard, go to **Integrations → WooCommerce** and download the plugin `.zip` (version 1.7.0).
  </Step>

  <Step title="Install and enable it on your store">
    These steps happen in your own WordPress admin, not in the Pesaswap dashboard.

    1. Go to **Plugins → Add New → Upload Plugin**, choose the `.zip` you downloaded, then click **Install** and **Activate**.
    2. Go to **WooCommerce → Settings → Payments**, tick **Enable** for Pesaswap, and save.
  </Step>

  <Step title="Add your credentials">
    Copy these from the Pesaswap dashboard into the plugin's settings screen:

    | Credential      | Where to find it           |
    | --------------- | -------------------------- |
    | Merchant ID     | Integrations → WooCommerce |
    | Publishable key | Integrations → WooCommerce |
    | Secret API key  | Developers → API keys      |

    <Note>
      Secret API keys are shown only once — at the moment you create them. If you don't have one saved, create a new key under **Developers → API keys** and copy it straight into the plugin.
    </Note>
  </Step>

  <Step title="Point callbacks at your store">
    The plugin's settings screen shows a webhook URL for your store. In the Pesaswap dashboard, go to **Settings → Business Profiles** and set that URL as your webhook URL. This is how Pesaswap tells your store that a payment succeeded.

    <Warning>
      Without this step, payments will succeed but your WooCommerce orders will stay marked unpaid.
    </Warning>

    The plugin authenticates these callbacks with a few extra settings — a **Consumer Key** (your Merchant ID), a **Callback API Key**, and the callback values configured on your business profile. If you are not sure which format your account uses, leave them blank and the plugin uses its default.
  </Step>
</Steps>

## How it works

A customer checks out on your store and chooses Pesaswap. They receive a mobile-money prompt — M-Pesa or Airtel Money — and approve it on their phone. Pesaswap then sends a callback to your webhook URL, and the WooCommerce order is marked paid.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Orders stay marked pending payment after a successful payment">
    Your callback/webhook URL is not configured. Complete **step 4** — set the plugin's webhook URL under **Settings → Business Profiles**.
  </Accordion>

  <Accordion title="The download link returns a 404">
    The plugin `.zip` has not been published to your dashboard yet. Contact Pesaswap support if it does not resolve.
  </Accordion>

  <Accordion title="Pesaswap does not appear as a payment option at checkout">
    The plugin is installed but not enabled. Go to **WooCommerce → Settings → Payments** and tick **Enable** for Pesaswap.
  </Accordion>
</AccordionGroup>
