SecurePay Bridge Documentation

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

  1. Upload woocommerce-rest-a folder to wp-content/plugins/ on Site A.
  2. 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

  1. Customer selects SecurePay Bridge and places an order.
  2. Order details are collected and URL encoded.
  3. 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

  1. Upload woocommerce-rest-b folder to wp-content/plugins/ on Site B.
  2. 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

  1. Redirect: User hits paynow-checkout.php and is forwarded to / with GET data.
  2. Cart Setup: Data stored in cookies, dummy product added, billing fields filled, redirect to checkout.
  3. Price Override: Adjusted before checkout to match original amount.
  4. Order Creation: Saves Site A’s original order data as metadata.
  5. Status Sync: Sends REST POST back to Site A on order status change.
  6. Final Redirect: If license valid, sends user back to Site A’s thank you page, otherwise shows error.

3. Customer Journey Summary

  1. Customer orders on Site A using SecurePay Bridge.
  2. Redirected to Site B with order data.
  3. Site B processes mock product with correct amount.
  4. Customer pays using Site B’s gateways.
  5. Site B updates Site A via REST API.
  6. Customer redirected back to Site A.
  7. Further updates sent if order status changes in Site B.
Shopping Cart