OnCharge

WooCommerce Plugin

The OnCharge plugin adds a “Credit / Debit Card” payment method to your WooCommerce checkout. It supports both the classic shortcode checkout and the newer Blocks checkout.

Installation

  1. Download the plugin from your OnCharge dashboard or copy the woo-plugin/ directory to wp-content/plugins/oncharge-gateway/
  2. Go to WordPress Admin > Plugins and activate OnCharge Secure Checkout
  3. Navigate to WooCommerce > Settings > Payments > OnCharge Secure Checkout

Configuration

Enter the following values from your OnCharge dashboard:

SettingDescription
Store IDYour OnCharge Store UUID
API KeyStarts with oc_key_...
API SecretStarts with oc_sec_... (never shared publicly)
API Base URLhttps://api.oncharge.io (default)
Pay Iframe URLhttps://pay.oncharge.io (default)

Classic Checkout

The plugin renders an iframe container in the payment method area. When the customer clicks “Place Order”, the plugin sends a postMessage to the OnCharge iframe which submits the payment via the PSP Drop-in component.

Blocks Checkout

The plugin registers with the WooCommerce Blocks payment method registry. The same iframe and postMessage flow works automatically. No additional configuration needed.

Callbacks

OnCharge sends payment status updates to your site at:

https://yoursite.com/?wc-api=oncharge_callback

The callback payload is HMAC-signed with your store’s secret. The plugin verifies the signature and updates the WooCommerce order status accordingly.

Troubleshooting

Iframe not loading

  • CSP blocking: If your site has a Content-Security-Policy header, add pay.oncharge.io to the frame-src directive.
  • Ad blockers: Some ad blockers may interfere. Test with blockers disabled.
  • HTTPS required: The iframe will not load over HTTP. Ensure your site uses HTTPS.

Callback not arriving

  • Verify the URL ?wc-api=oncharge_callback is accessible from the internet.
  • Check that your firewall or security plugin is not blocking POST requests to the callback URL.
  • Verify your SSL certificate is valid.

Signature mismatch

  • Ensure the API Secret in WooCommerce settings matches the one from the OnCharge dashboard exactly.
  • Check your server clock — timestamps must be within 5 minutes.