# WooCommerce

### Overview

GitHub: <https://github.com/dukenukemall/fungies-wp-plugin>

```
  ┌─────────────────────┐         ┌─────────────────────┐
  │   WooCommerce Store │         │    Fungies.io        │
  │                     │         │                      │
  │  ┌───────────────┐  │  Sync   │  ┌────────────────┐ │
  │  │   Products    │◄─┼─────────┼──│   Products     │ │
  │  └───────────────┘  │         │  └────────────────┘ │
  │                     │         │                      │
  │  ┌───────────────┐  │ Webhook │  ┌────────────────┐ │
  │  │    Orders     │◄─┼─────────┼──│   Payments     │ │
  │  └───────────────┘  │         │  └────────────────┘ │
  │                     │         │                      │
  │  ┌───────────────┐  │Redirect │  ┌────────────────┐ │
  │  │   Customer    │──┼─────────┼─►│ Hosted Chkout  │ │
  │  └───────────────┘  │         │  └────────────────┘ │
  └─────────────────────┘         └─────────────────────┘
```

Fungies acts as your **Merchant of Record** — handling payments, taxes, and compliance. WooCommerce is your **storefront**. This plugin bridges them seamlessly.

<figure><img src="/files/bEWNI96Q3NNGGInhXz7R" alt=""><figcaption><p>Fungies Checkout as one of the checkout options in WooCommerce</p></figcaption></figure>

### Features

| Feature                | Description                                                                                                           |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------- |
| API Key Management     | Production + Staging keys in WC Settings                                                                              |
| Sandbox / Staging Mode | Routes to `api.stage.fungies.net`                                                                                     |
| Product Sync           | OneTimePayment offers → WooCommerce products (other product types like Digital Downloads, Subscriptions are excluded) |
| Hosted Checkout        | Redirect to Fungies checkout page                                                                                     |
| Webhook Integration    | Real-time order sync                                                                                                  |
| Order Creation         | Auto from payment webhooks                                                                                            |
| Refund Handling        | Auto status updates                                                                                                   |
| Subscription Support   | Create / Renew / Cancel                                                                                               |
| Post-Purchase Redirect | Returns customer to WC order page                                                                                     |
| WooCommerce Logging    | Full audit trail                                                                                                      |

### How It Works

1. **Configure** — Paste your Fungies API keys and Store URL in WooCommerce → Settings → Fungies
2. **Sync Products** — Click "Sync Now" or let the hourly cron pull OneTimePayment products automatically
3. **Customer Shops** — Customers browse your WC store and proceed to checkout
4. **Fungies Checkout** — Customer is redirected to Fungies hosted checkout to pay
5. **Payment Complete** — Fungies redirects customer back to your WooCommerce thank-you page
6. **Webhook Sync** — Fungies sends `payment_success` → plugin completes the WC order

### Requirements

| Requirement     | Version                        |
| --------------- | ------------------------------ |
| WordPress       | ≥ 5.8                          |
| WooCommerce     | ≥ 6.0                          |
| PHP             | ≥ 7.4                          |
| Fungies Account | [Sign up](https://fungies.io/) |

### Installation

#### Manual Upload

1. Download the plugin `.zip` from the [latest release](https://github.com/dukenukemall/fungies-wp-plugin/releases)
2. Go to **WordPress Admin → Plugins → Add New → Upload Plugin**
3. Upload the zip and click **Activate**

#### From Source

```
cd wp-content/plugins/
git clone https://github.com/dukenukemall/fungies-wp-plugin.git
```

Then activate via **WordPress Admin → Plugins**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.fungies.io/integrations/woocommerce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
