Skip to main content
WooCommerce’s payment gateway API lets you plug in any payment provider by extending the WC_Payment_Gateway class. This guide walks you through building a custom plugin that collects card details at checkout and processes them through the Accelebit API server-to-server, including 3D Secure redirects, refunds, and asynchronous webhook updates.

Architecture

The sequence below shows how WooCommerce, your plugin, and Accelebit interact during a checkout.

Prerequisites

Before you start, make sure you have:
  • An Accelebit account with API keys
  • WordPress with WooCommerce 8.0+ installed
  • PHP 8.0+
  • An SSL certificate on your WordPress site (required for handling card data)

Plugin structure

Create the following files in wp-content/plugins/accelebit-gateway/:
1

Plugin bootstrap

The main plugin file registers the gateway class with WooCommerce and hooks up the webhook listener.
2

Payment gateway class

The gateway class handles the settings form, renders the card fields at checkout, submits payments to Accelebit, and processes refunds. The key methods are shown below.
3

Webhook handler

The webhook handler listens for Accelebit events and updates WooCommerce order statuses asynchronously. This is especially important for 3DS payments, where the final status arrives after the customer has left the checkout page.
4

Configure the plugin in WooCommerce admin

After uploading the plugin files:
  1. Activate the plugin in WordPress Admin > Plugins.
  2. Go to WooCommerce > Settings > Payments > Accelebit.
  3. Enable the gateway and enter your Accelebit secret key.
  4. Set your webhook URL in the Accelebit Dashboard:
  5. Copy the webhook signing secret from the Dashboard into the Webhook Secret field in the plugin settings.

Testing

Before taking live payments, verify your integration end-to-end:
  1. Use your Accelebit test secret key (smtgw_sk_test_...).
  2. Place a test order using card number 4111111111111111.
  3. Confirm the order status updates to “Processing” after payment.
  4. Issue a refund from WooCommerce and verify it processes through Accelebit.