Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/own-pay/OwnPay-Documentation/llms.txt

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

The OwnPay Gateway Plugin for WooCommerce connects your WordPress store to your self-hosted OwnPay instance with no custom code. When a customer checks out, the plugin creates a payment intent via the OwnPay REST API, redirects the customer to OwnPay’s hosted checkout page, and automatically updates WooCommerce order statuses in response to webhook events — all out of the box.

How It Works

Customer Checkout


WooCommerce Order Created


OwnPay Plugin → POST /api/v1/payment-intents


Customer Redirected → OwnPay Checkout Page


Payment Completed / Failed


OwnPay Webhook → WooCommerce Order Status Updated

Prerequisites

Before installing the plugin, confirm the following:
RequirementMinimum Version
WordPress6.0+
WooCommerce8.0+
PHP8.2+
OwnPay instanceSelf-hosted, reachable over HTTPS
You also need an OwnPay API key with write scope. Generate one in OwnPay Admin → Developer Hub → API Keys.

Installation

1
Download the Plugin
2
Download the latest plugin ZIP from the OwnPay WordPress GitHub Releases page. Choose the most recent stable release.
3
Install in WordPress
4
Upload ZIP (Recommended)
  1. In your WordPress admin, navigate to Plugins → Add New → Upload Plugin.
  2. Click Choose File and select the downloaded ZIP.
  3. Click Install Now.
  4. Click Activate Plugin once installation completes.
WP-CLI
If you have WP-CLI access to your server, run:
wp plugin install ownpay-woocommerce --activate
5
Configure the Gateway
6
  • Go to WooCommerce → Settings → Payments.
  • Locate OwnPay in the payment methods list and click Manage.
  • Fill in all required fields:
  • 7
    FieldDescriptionEnable/DisableToggle to show OwnPay at checkoutTitleLabel shown to customers (e.g. Pay with OwnPay)DescriptionShort description on the checkout pageAPI Base URLYour OwnPay instance URL (e.g. https://pay.yourdomain.com)API KeyYour OwnPay API key from Admin → Developer HubBrand IDYour OwnPay brand or store IDWebhook SecretSecret key for verifying incoming webhooks (set this after Step 4)Test ModeEnable to run transactions against the sandbox
    8
  • Click Save Changes.
  • 9
    Configure Webhooks in OwnPay
    10
    The plugin needs to receive webhook events to update order statuses automatically.
    11
  • Log in to your OwnPay admin panel.
  • Navigate to Developer Hub → Webhooks → Add Endpoint.
  • Enter your WooCommerce webhook URL:
  • 12
    https://yourstore.com/?wc-api=ownpay_gateway
    
    13
  • Select the following events:
    • payment.transaction.completed
    • payment.transaction.failed
    • payment.transaction.cancelled
  • Copy the generated Webhook Secret.
  • Paste the secret into WooCommerce → Settings → Payments → OwnPay → Webhook Secret.
  • Click Save Changes.
  • 14
    The Webhook Secret is shown only once. Copy it immediately and store it in a secure location before navigating away.

    Order Status Mapping

    OwnPay payment events are automatically mapped to WooCommerce order statuses:
    OwnPay EventWooCommerce Status
    payment.transaction.completedprocessing (or completed for virtual/downloadable products)
    payment.transaction.failedfailed
    payment.transaction.cancelledcancelled
    payment.intent.expiredcancelled

    Testing Your Integration

    1
    Enable Test Mode
    2
    In WooCommerce → Settings → Payments → OwnPay, toggle Test Mode on and click Save Changes.
    3
    Test mode connects to the OwnPay sandbox environment. Transactions process without real money, but all webhooks and order status transitions fire exactly as in production.
    4
    Place a Test Order
    5
    Add a product to your cart and proceed to checkout. Select OwnPay as the payment method and complete the order. You’ll be redirected to the OwnPay sandbox checkout.
    6
    FieldTest ValueTest API KeyAvailable in OwnPay Admin → Developer Hub → Test KeysTest CheckoutTriggered automatically when Test Mode is enabled
    7
    Verify Webhook Delivery
    8
    After completing a test payment:
    9
  • Check the WooCommerce order — its status should have changed to processing.
  • Go to WooCommerce → Status → Logs and filter by ownpay to see plugin log entries.
  • In OwnPay Admin, check Developer Hub → Webhooks → Delivery Log to confirm a 200 response from your store.
  • 10
    Go Live
    11
    When you’re satisfied with the integration:
    12
  • Disable Test Mode in the plugin settings.
  • Replace the test API key with your production key from OwnPay Admin → Developer Hub → API Keys.
  • Click Save Changes.

  • Customization

    The plugin exposes WordPress filters for advanced customization without modifying plugin files directly.

    Customize the Redirect URL

    Add query parameters or a custom path to the OwnPay checkout redirect:
    add_filter('ownpay_redirect_url', function (string $url, \WC_Order $order): string {
        return add_query_arg('ref', $order->get_order_key(), $url);
    }, 10, 2);
    

    Customize the Payment Intent Payload

    Attach additional metadata to every payment intent — useful for customer segmentation, analytics, or order notes:
    add_filter('ownpay_payment_intent_payload', function (array $payload, \WC_Order $order): array {
        $payload['metadata']['wc_order_id']    = $order->get_id();
        $payload['metadata']['customer_note']  = $order->get_customer_note();
        return $payload;
    }, 10, 2);
    

    Override Completed Order Status

    By default, completed payments set orders to processing. Override this per order type:
    add_filter('ownpay_completed_order_status', function (string $status, \WC_Order $order): string {
        // Mark downloadable orders as completed immediately
        if ($order->has_downloadable_item()) {
            return 'completed';
        }
        return $status;
    }, 10, 2);
    

    Webhook Signature Verification

    The plugin verifies every incoming webhook using HMAC-SHA256 before updating any order. The verification logic the plugin runs internally:
    // Performed automatically by the plugin on every incoming webhook:
    $signature = hash_hmac('sha256', $rawBody, $webhookSecret);
    if (!hash_equals($signature, $_SERVER['HTTP_X_OWNPAY_SIGNATURE'])) {
        status_header(401);
        exit('Invalid signature');
    }
    
    Ensure the Webhook Secret in OwnPay Admin matches the value entered in WooCommerce settings exactly — including no leading or trailing whitespace.

    Troubleshooting

    Webhooks Not Received

    1
    Verify endpoint reachability
    2
    Confirm https://yourstore.com/?wc-api=ownpay_gateway is publicly accessible over the internet (not behind a VPN or local network).
    3
    Check WooCommerce logs
    4
    Go to WooCommerce → Status → Logs and filter by ownpay to see plugin-level error messages.
    5
    Verify the Webhook Secret
    6
    Confirm the secret in WooCommerce → Settings → Payments → OwnPay exactly matches the one shown in OwnPay Admin → Developer Hub → Webhooks.
    7
    Confirm event selection
    8
    In OwnPay Admin, open the webhook endpoint and confirm payment.transaction.completed, payment.transaction.failed, and payment.transaction.cancelled are all selected.

    Orders Stuck in “Pending Payment”

    This typically means the webhook was not delivered. You can manually sync an order’s payment status: Via WooCommerce Admin:
    1. Open the order in the WooCommerce order detail view.
    2. Click OwnPay → Sync Payment Status in the order meta box.
    Via WP-CLI:
    wp ownpay sync-order --order-id=1234
    

    SSL / cURL Errors

    If your OwnPay instance uses a self-signed certificate (common in local development), add this to wp-config.php:
    define('OWNPAY_VERIFY_SSL', false);
    
    Only disable SSL verification in local or development environments. Never use this setting in production — it exposes your store to man-in-the-middle attacks.

    Next Steps

    PHP Integration

    Build a custom PHP integration if you need more control than the plugin provides.

    Node.js Integration

    Integrate OwnPay into a headless or custom Node.js storefront.

    Webhooks Guide

    Understand all webhook events, retry logic, and delivery logs.

    OwnPay Plugin Marketplace

    Browse additional OwnPay plugins and gateway extensions.

    Build docs developers (and LLMs) love