Payment Gateway Forwarder is a lightweight PHP script that forwards HTTP requests to a target URL. It supports both GET and POST requests, including JSON payloads, and can be used to simplify interactions with payment gateways or any external HTTP service.
This script handles:
- GET requests by redirecting to the target URL.
- POST requests with form data by automatically submitting an HTML form.
- POST requests with JSON payloads by sending them directly via cURL.
- Clone this repository or download the
index.phpfile:
git clone https://github.com/BaseMax/payment-gateway-forwarder.git-
Place
index.phpin your web server directory. -
Make sure your server supports PHP 7.4+ (or higher) and cURL.
GET /index.php?url=https%3A%2F%2Fexample.com%2FtargetThis will redirect the client directly to the target URL.
- Form submission (application/x-www-form-urlencoded):
Send a POST request to index.php with a url parameter and any form fields. The script will generate a hidden HTML form and automatically submit it to the target.
- JSON submission (application/json):
Send a POST request with Content-Type: application/json:
curl -X POST "https://yourdomain.com/index.php?url=https%3A%2F%2Fexample.com%2Ftarget" \
-H "Content-Type: application/json" \
-d '{"amount":100,"currency":"USD"}'The script will forward the JSON payload to the target URL and return the response with the correct HTTP status code.
- Ensure the
urlparameter is validated before use in production. - Avoid exposing this script publicly without access control to prevent misuse.
- Only forward requests to trusted endpoints.
This project is licensed under the MIT License. See the LICENSE file for details.
Author: Seyyed Ali Mohammadiyeh (Max Base)
License: MIT
Copyright: 2025
Happy forwarding! 🚀