SecurePay Bridge Documentation
Introduction
SecurePay Bridge is a dual-plugin system for WooCommerce that enables a "High-Risk" store (Site A) to process payments through a "Low-Risk" store (Site B). It redirects the customer and order data seamlessly from Site A to Site B for payment, then redirects the customer back while syncing the order status between the sites.
Requirements
- Two WordPress sites with WooCommerce installed.
- Correct plugin installed and activated on each site.
- Valid SecurePay Bridge license (entered in Site B settings).
1. Site A Plugin (SecurePay Bridge – High Risk Site)
1.1 Overview
Acts as a custom payment gateway. It collects order info and redirects customers to Site B for payment, then listens for status updates via REST API.
1.2 Installation
- Upload
woocommerce-rest-a
folder towp-content/plugins/
on Site A. - Activate from WordPress Plugins page.
1.3 Settings
- Enable/Disable: Toggle the payment method.
- Title: Shown to users during checkout (e.g., "Credit Card").
- Description: Text under the title.
- Low Risk Shop URL: Full URL of Site B (e.g., https://lowriskshop.com).
1.4 Workflow
- Customer selects SecurePay Bridge and places an order.
- Order details are collected and URL encoded.
- Customer is redirected to Site B's
paynow-checkout.php
.
1.5 REST API Endpoints
Receives status updates from Site B. Accepts order_id via POST body to update:
- completed, refunded, cancelled, processing, on-hold, pending, failed, draft, gateway-processing
2. Site B Plugin (SecurePay Bridge – Low Risk Site)
2.1 Overview
Receives traffic from Site A, creates a mock product for payment, processes it via Site B gateways, then updates Site A and redirects customer.
2.2 Installation
- Upload
woocommerce-rest-b
folder towp-content/plugins/
on Site B. - Activate from WordPress Plugins page.
2.3 Settings
- License Key & Token: Required for redirect to work.
- Product Selection Logic: Choose method to select dummy product (Random, Price Range, Specific Products/Categories).
- Redirect Path: Optional relative path to return to Site A’s thank-you page.
2.4 Workflow
- Redirect: User hits
paynow-checkout.php
and is forwarded to/
with GET data. - Cart Setup: Data stored in cookies, dummy product added, billing fields filled, redirect to checkout.
- Price Override: Adjusted before checkout to match original amount.
- Order Creation: Saves Site A’s original order data as metadata.
- Status Sync: Sends REST POST back to Site A on order status change.
- Final Redirect: If license valid, sends user back to Site A’s thank you page, otherwise shows error.
3. Customer Journey Summary
- Customer orders on Site A using SecurePay Bridge.
- Redirected to Site B with order data.
- Site B processes mock product with correct amount.
- Customer pays using Site B’s gateways.
- Site B updates Site A via REST API.
- Customer redirected back to Site A.
- Further updates sent if order status changes in Site B.