Skip to main content

Overview

OCPay for WooCommerce is a payment gateway plugin that integrates OCPay with your WooCommerce store. Accept secure payments in Algerian Dinars (DZD) with minimal setup.

Easy Installation

Install from plugin ZIP - no coding required

Auto Status Polling

Automatically checks payment status every 20 minutes

WooCommerce Blocks

Works with both classic and block checkout

Sandbox Testing

Test with sandbox mode before going live

Requirements

1

WordPress & WooCommerce

  • WordPress 5.0 or higher
  • WooCommerce 4.0 or higher
  • PHP 7.2 or higher
2

SSL Certificate

SSL/HTTPS enabled on your site (required for payments)
3

OCPay Account

Active merchant account at oneclickdz.com
Complete merchant validation before creating payment links

Quick Setup

1. Install the Plugin

1

Download Plugin

Download the plugin from GitHub
2

Upload to WordPress

  • Go to Plugins → Add New
  • Click Upload Plugin
  • Select the ZIP file
  • Click Install Now
3

Activate

Click Activate Plugin after installation

2. Get Your API Keys

  1. Log in to oneclickdz.com
  2. Go to API Settings
  3. Copy both keys:
    • Sandbox Key: For testing
    • Production Key: For live payments
Never expose API keys in public code or share them via email

3. Configure Plugin

1

Open Settings

Go to WooCommerce → Settings → Payments
2

Select OCPay

Click on OCPay in the payment methods list
3

Enable & Configure

  • Enable/Disable: Check to enable OCPay
  • Title: “OCPay - OneClick Payment” (shown to customers)
  • Description: Payment method description
4

Add API Keys

  • Sandbox API Key: Your sandbox key
  • Production API Key: Your production key
  • API Mode: Select “Sandbox” for testing
5

Configure Options

  • Fee Mode: Choose who pays transaction fees
    • NO_FEE: You absorb fees (best customer experience)
    • SPLIT_FEE: 50/50 split
    • CUSTOMER_FEE: Customer pays all fees
  • Order Status: Choose status after successful payment
    • Completed: For digital products (auto-delivery)
    • Processing: For physical products (requires fulfillment)
6

Save Settings

Click Save changes

Testing in Sandbox

Always test in Sandbox mode before accepting real payments
  1. Set to Sandbox Mode
    • API Mode: Sandbox (Testing)
    • Use your Sandbox API Key
  2. Create Test Order
    • Go to your store
    • Add product to cart
    • Proceed to checkout
    • Select OCPay payment method
    • Complete checkout
  3. Test Payment Flow
    • You’ll be redirected to OCPay payment page
    • Complete the test payment
    • Return to your store
  4. Verify Order Update
    • Check order status in WooCommerce
    • Should update to your configured status
    • Check plugin logs: WooCommerce → OCPay → Activity Logs

Going Live

When ready to accept real payments:
1

Switch to Production

  • Go to WooCommerce → Settings → Payments → OCPay
  • Change API Mode to Production (Live)
  • Save changes
2

Verify SSL

Ensure SSL/HTTPS is properly configured on your site
3

Test Order

Create a small test order to verify everything works

Key Features

Automatic Status Polling

The plugin automatically checks payment status every 20 minutes using WordPress cron:
  • No manual intervention needed
  • Orders automatically update when payment confirms
  • Failed payments marked as “On Hold”

Manual Status Check

Customers can manually check payment status:
  • Available on order page
  • Click “Check Payment Status” button
  • Real-time AJAX update

Fee Modes

ModeDescriptionBest For
NO_FEEYou pay all feesBest customer experience
SPLIT_FEE50/50 splitShared cost
CUSTOMER_FEECustomer paysMaximize profit
Fee Structure: 0% on balance, 1% withdrawal fee only

Troubleshooting

Payment Gateway Not Configured

Problem: Error message when placing order Solution:
  • Verify API key is entered
  • Check API key matches the mode (Sandbox/Production)
  • Test connection in plugin settings

Orders Not Updating

Problem: Orders stay “Pending” after payment Solution:
  1. Check WordPress cron is working
  2. Verify payment reference is saved in order
  3. Enable Debug Mode in plugin settings
  4. Check Activity Logs for errors

SSL/HTTPS Required

Problem: “SSL required” error message Solution:
  • Contact your hosting provider to enable SSL
  • Use free Let’s Encrypt certificate
  • Verify site URL starts with https://

Debug Mode

Enable for troubleshooting:
  1. Go to WooCommerce → Settings → Payments → OCPay
  2. Check Enable Debug Logging
  3. Save changes
  4. View logs at WooCommerce → OCPay → Activity Logs
Disable debug mode in production for better performance

Support & Resources

Next Steps

OCPay Best Practices

Learn production-ready tips and security best practices