# WooCommerce (/en/plugins/woocommerce)

Install XPay for WooCommerce, connect your account and accept payments at checkout.

XPay for WooCommerce adds XPay to your WooCommerce checkout. Customers pay in secure payment fields on your own checkout page, and paid orders update on their own. Get it from [WordPress.org](https://wordpress.org/plugins/xpay-for-woocommerce/).

## What you can do [#what-you-can-do]

<Cards>
  <Card icon="<Wallet />" title="Accept your account's methods">
    Cards, ValU, Fawry and Apple Pay, as each one is available on your XPay account.
  </Card>

  <Card icon="<LayoutList />" title="Any checkout">
    Works on the classic checkout, the Cart and Checkout blocks, and the order payment page.
  </Card>

  <Card icon="<Undo2 />" title="Refund from WooCommerce">
    Full and partial refunds from the order screen.
  </Card>

  <Card icon="<Languages />" title="Arabic and English">
    The plugin and its payment fields follow your store's language.
  </Card>
</Cards>

You need WordPress 6.2 or later, WooCommerce 8.3 or later, PHP 7.4 or later, and your store served over HTTPS.

## Install and connect [#install-and-connect]

<Steps>
  <Step>
    ### Install the plugin [#install-the-plugin]

    In WordPress, go to **Plugins** → **Add New Plugin** and search for `XPay for WooCommerce`. Click **Install Now**, then **Activate**.
  </Step>

  <Step>
    ### Connect your XPay account [#connect-your-xpay-account]

    Go to **WooCommerce** → **Settings** → **Payments** → **XPay** and click **Connect with XPay**. Sign in to XPay, pick your business and approve. You come back to WooCommerce connected to your test account, with the webhook already set up.
  </Step>

  <Step>
    ### Choose your payment methods [#choose-your-payment-methods]

    Open the **Payment Methods** tab. It lists the methods your account accepts in your store's currency. Tick the ones to show at checkout and click **Save changes**. To change their order, click **Change display order**, drag the methods, then click **Save display order**.
  </Step>

  <Step>
    ### Place a test order [#place-a-test-order]

    Buy something from your store with a [test card](/get-started/test-mode). The order shows as paid in WooCommerce once the payment succeeds. Test mode never charges real money.
  </Step>
</Steps>

When XPay turns on a new payment method for your account, open the **Payment methods** menu (⋮) and click **Refresh payment methods**, then tick it.

## Go live [#go-live]

Your XPay account must be [approved for live payments](/get-started/onboarding) first.

<Steps>
  <Step>
    ### Connect your live account [#connect-your-live-account]

    On the **Settings** tab, click **Connect your live account** under **Enable test mode**. Click **Connect live account** and approve on XPay. Your live account gets its own keys and webhook; the test connection stays as it is.
  </Step>

  <Step>
    ### Turn off test mode [#turn-off-test-mode]

    Untick **Enable test mode** and click **Save changes**. Place a small real order and check that its status updates in WooCommerce.
  </Step>
</Steps>

To switch back to testing, tick **Enable test mode** again. To change or remove a connection, open the menu (⋮) on the account card and click **Configure connection** or **Disconnect**.

## Apple Pay [#apple-pay]

Apple Pay shows in the **Payment Methods** tab when it's on for your XPay account. Customers pay on your own website, so Apple needs to know your store first. The plugin keeps Apple Pay off until two steps show as done in its Apple Pay row: **XPay dashboard setup** and **Domain verification file**.

<Steps>
  <Step>
    ### Add your certificates in the XPay dashboard [#add-your-certificates-in-the-xpay-dashboard]

    Follow the first three steps of [Set up Apple Pay for your website](/features/checkout-customization/apple-pay#set-up-apple-pay-for-your-website): your Apple Merchant ID and both certificates. Back in WooCommerce, click **Save changes**. **XPay dashboard setup** reads **Complete**.
  </Step>

  <Step>
    ### Register your store's domain with Apple [#register-your-stores-domain-with-apple]

    In your Apple Developer account, open your Merchant ID and add your store's domain, for example `shop.example.com`. Download the domain verification file Apple gives you. Don't click **Verify** yet.
  </Step>

  <Step>
    ### Upload the file to the plugin [#upload-the-file-to-the-plugin]

    In the Apple Pay row, click **Upload the file**, choose the file you downloaded, then click **Save changes**. The plugin serves it at `https://your-domain/.well-known/apple-developer-merchantid-domain-association.txt`, and **Domain verification file** reads **Found**.
  </Step>

  <Step>
    ### Verify the domain with Apple [#verify-the-domain-with-apple]

    Back in Apple Developer, click **Verify** next to your domain. Apple fetches the file from your store and marks the domain as verified.
  </Step>

  <Step>
    ### Turn on Apple Pay [#turn-on-apple-pay]

    Tick **Apple Pay** in the **Payment Methods** tab and click **Save changes**. Apple Pay now appears at checkout as its own payment method.
  </Step>
</Steps>

If **Domain verification file** stays **Not found**, your server or a security plugin is blocking the `.well-known` path, or WordPress runs in a subfolder. Apple needs the file at the root of your domain. Fix that, then click **Save changes** to check again.

## Refunds [#refunds]

Open the order in WooCommerce, click **Refund**, enter the amount and confirm the refund through XPay. You can refund the full amount or part of it. ValU payments can't be refunded through XPay.

## When something isn't working [#when-something-isnt-working]

| What you see                                     | What it means                                                    | What you do                                                                                                                  |
| ------------------------------------------------ | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| XPay is missing at checkout                      | No method is ticked, or none supports the store currency.        | Tick a method in **Payment Methods**. ValU and Fawry need EGP.                                                               |
| The payment fields don't load                    | A script optimizer, consent tool or security policy blocks XPay. | Allow scripts and frames from `https://checkout.xpay.app`, and exclude the checkout page from page caching.                  |
| The customer paid but the order is still pending | XPay can't reach your store's webhook.                           | Open **Configure connection** and click **Reconfigure webhook**.                                                             |
| Apple Pay can't be ticked                        | One of the two Apple Pay steps isn't done.                       | Follow [Apple Pay](#apple-pay) until both read **Complete** and **Found**.                                                   |
| You need more detail                             | The plugin can log every step.                                   | Turn on **Diagnostic logging** in **Settings**, then open **WooCommerce** → **Status** → **Logs** and pick the `xpayeg` log. |

Logs never include keys, card details or customer personal data.

## Where to next [#where-to-next]

<Cards>
  <Card icon="<Puzzle />" title="Plugins" href="/plugins">
    What every XPay plugin does for you, and where to get it.
  </Card>

  <Card icon="<Wallet />" title="Apple Pay" href="/features/checkout-customization/apple-pay">
    How Apple Pay works with XPay, and the dashboard setup in full.
  </Card>

  <Card icon="<FlaskConical />" title="Test mode" href="/get-started/test-mode">
    Test cards for every payment outcome.
  </Card>

  <Card icon="<OdooIcon />" title="Odoo" href="/plugins/odoo">
    Run an Odoo store too? Connect it the same way.
  </Card>
</Cards>