Skip to content

morpheusadam/TopUpBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# 🎮 Top Up Bridge — WooCommerce Game Recharge API Bridge ### A WordPress + WooCommerce plugin that connects your store to an external game-recharge merchant REST API — syncing products and auto-submitting top-up orders, with logging and SMTP email notifications.

License Stars Forks Last commit Repo size

WordPress PHP WooCommerce REST API SMTP


📖 Overview

GameToy is a WordPress plugin that integrates your WooCommerce store with an external game-recharge merchant REST API. It bridges two systems: it pulls the merchant's goods catalog into WooCommerce as products, and — when a customer's order is completed — it automatically submits a corresponding top-up/recharge order back to the merchant API, then notifies the customer by email.

The plugin handles the full lifecycle: authenticated API requests (client ID, signed requests with timestamp + nonce), product synchronization into WooCommerce, order submission on woocommerce_order_status_completed, activity logging (account and debug logs), and transactional email via a bundled SMTP/mailer with an admin settings page. An admin dashboard page lets you configure credentials and inspect API responses, while account and log pages give visibility into syncs and submitted orders.

It is built for store owners and developers running a WooCommerce-based digital game top-up / recharge shop who need a reliable connector to a merchant fulfillment API.

🔎 Keywords: WooCommerce game recharge, WordPress merchant API integration, game top-up plugin, WooCommerce REST API client, product sync plugin, order submission automation, SMTP email WordPress, digital recharge store, game credit plugin.


✨ Features

  • 🔗 Merchant REST API integration — authenticated requests (ClientId + signed AuthSign with timestamp and nonce) to the external recharge merchant API.
  • 🛒 Product sync into WooCommerce — fetches the merchant goods list and creates/updates WooCommerce products (matched by SKU).
  • ⚙️ Automatic order submission — on completed WooCommerce orders, submits the matching recharge order to the merchant API.
  • 🆔 Order helpers — generates unique merchant order IDs, player IDs, and random values for each submission.
  • 📧 SMTP email notifications — bundled mailer and email templates to notify customers, configurable from settings.
  • 🧾 Logging — account and debug logs (logs/account.log, logs/debug.log) for syncs, submissions, and errors.
  • 🖥️ Admin dashboard — settings page for credentials, plus pages to display API responses, product cards, and account/order logs.
  • 🧩 WooCommerce hooks — clean integration via WooCommerce order-status actions.

🛠️ Tech Stack

Layer Technology
Platform WordPress (plugin)
Commerce WooCommerce
Language PHP 7+
Networking cURL REST client (signed requests)
Email SMTP / custom mailer
Front-end JavaScript, CSS

Tech stack


🚀 Getting Started

Prerequisites

  • WordPress 5.0+
  • PHP 7.0+
  • WooCommerce installed and active
  • Valid merchant API credentials (client ID / secret)

Installation

  1. Download the plugin (clone or grab a ZIP of this repository).
  2. In your WordPress admin, go to Plugins → Add New → Upload Plugin.
  3. Upload the archive and click Install Now.
  4. Activate the plugin from the Plugins menu.
git clone https://github.com/morpheusadam/TopUpBridge.git

⚙️ Configuration & Usage

  1. Open the GameToy settings page in the WordPress admin and enter your merchant API credentials and SMTP details.
  2. Trigger a goods-list sync to import merchant products into WooCommerce (matched and upserted by SKU).
  3. Sell as usual — when an order reaches the Completed status, GameToy automatically submits the recharge order to the merchant API and emails the customer.
  4. Review the API response, account, and log pages in the admin to monitor syncs and submissions.

🗂️ Project Structure

gametoy/
├── gametoy.php                       # main plugin bootstrap (includes)
├── admin/
│   └── gametoy-admin-page.php        # admin dashboard page
├── includes/
│   ├── class-gametoy-api.php         # merchant API client + product import
│   ├── class-gametoy-sync.php        # product synchronization
│   ├── class-gametoy-submitorder.php # submit recharge order to merchant API
│   ├── woocommerce-hooks.php         # order-status integration
│   ├── class_smtp.php                # SMTP mailer
│   ├── settings-page.php             # plugin settings
│   ├── log.php · logs-page.php       # logging + log viewer
│   ├── account-logs-page.php         # account activity logs
│   └── enqueue-scripts.php           # assets
├── assets/                          # css · js
└── logs/                            # account.log · debug.log

🤝 Contributing

Contributions are welcome! Open an issue or submit a pull request with new integrations, improvements, or fixes.

⚠️ Security note: do not commit real API credentials or secrets. Keep merchant keys in configuration/environment, not in source.

📜 License

Distributed under the MIT License (or see LICENSE if present).


👤 Author — Morpheus Adam

Web developer & cheerful hacker · PHP · Laravel · Go

GitHub Website Email

If GameToy powered your store, consider giving it a star!


⭐ Star History

gametoy — Star History Chart

If this project helps you, please give it a ⭐

A star helps other developers discover gametoy and supports continued development.

About

WordPress + WooCommerce plugin connecting your store to external game-recharge merchants for automated top-up sales.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors