NOW POLYGON / MINING POLYGON
FULL INSTALLATION DOCUMENTATION
========================================

PROJECT INFORMATION
-------------------

Project name: Mining POLYGON
Domain example: nowpolygon.xyz
Main payment provider: Nipay.io
Future provider: FaucetPay soon

Website footer:

Powered by Nipay.io · FaucetPay provider soon 🔜


1. REQUIRED PROJECT FILES
-------------------------

Upload these files to your domain public_html folder:

index.php
config.php
ajax.php
payment-callback.php
logo.php
logo.png
.htaccess

Example Ubuntu project folder:

/domains/nowpolygon.xyz/public_html/

The final public_html folder should contain:

/domains/nowpolygon.xyz/public_html/index.php
/domains/nowpolygon.xyz/public_html/config.php
/domains/nowpolygon.xyz/public_html/ajax.php
/domains/nowpolygon.xyz/public_html/payment-callback.php
/domains/nowpolygon.xyz/public_html/logo.php
/domains/nowpolygon.xyz/public_html/logo.png
/domains/nowpolygon.xyz/public_html/.htaccess

Do not rename logo.png unless you also change the logo path inside the PHP code.


2. SERVER REQUIREMENTS
----------------------

Recommended server:

Ubuntu Linux
Apache 2
PHP 8.1 or newer
MySQL or MariaDB
HTTPS / SSL certificate

Required PHP extensions:

pdo_mysql
curl
openssl
mbstring
json
session

Check PHP version:

php -v

Check PHP modules:

php -m

Enable common Apache modules:

sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod expires
sudo systemctl restart apache2


3. APACHE VIRTUAL HOST CONFIGURATION
------------------------------------

Apache must allow .htaccess rules.

Your Apache domain configuration should include:

<Directory /domains/nowpolygon.xyz/public_html>
    AllowOverride All
    Require all granted
</Directory>

After changing Apache configuration, restart Apache:

sudo systemctl restart apache2

The included .htaccess controls:

Clean URLs
Hidden .php extensions
Security headers
Directory listing protection
Private file protection
Image caching


4. UPLOAD THE PROJECT
---------------------

Upload the following files into:

/domains/nowpolygon.xyz/public_html/

Files:

index.php
config.php
ajax.php
payment-callback.php
logo.php
logo.png
.htaccess

The website logo must remain here:

/domains/nowpolygon.xyz/public_html/logo.png

The TapTap / TO MINE button uses:

logo.php

logo.php loads:

logo.png


5. CREATE THE DATABASE
----------------------

Create a MySQL or MariaDB database.

Example database information:

Database name: nowpolygon
Database user: nowpolygon_user
Database password: USE_A_STRONG_PASSWORD

You can create the database using phpMyAdmin or MySQL command line.

Example MySQL commands:

mysql -u root -p

CREATE DATABASE nowpolygon CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

CREATE USER 'nowpolygon_user'@'localhost' IDENTIFIED BY 'USE_A_STRONG_PASSWORD';

GRANT ALL PRIVILEGES ON nowpolygon.* TO 'nowpolygon_user'@'localhost';

FLUSH PRIVILEGES;

EXIT;

Import the project SQL database using phpMyAdmin or command line.

Command-line example:

mysql -u nowpolygon_user -p nowpolygon < database.sql


6. CONFIGURE config.php
-----------------------

Open:

/domains/nowpolygon.xyz/public_html/config.php

Set the website domain:

define('APP_URL', 'https://nowpolygon.xyz');

Set the database details:

define('DB_HOST', 'localhost');
define('DB_NAME', 'nowpolygon');
define('DB_USER', 'nowpolygon_user');
define('DB_PASS', 'YOUR_DATABASE_PASSWORD');

Set the Nipay.io API credentials:

define('NIPAY_API_KEY', 'YOUR_NIPAY_PUBLIC_API_KEY');
define('NIPAY_API_SECRET', 'YOUR_NIPAY_PRIVATE_API_SECRET');

Important rules:

APP_URL must match the real website domain.
Do not add a slash at the end of APP_URL.
Use HTTPS.
Keep NIPAY_API_SECRET private.
Do not place the API secret in JavaScript.
Do not place the API secret in HTML.
Do not publish the API secret on GitHub.

Correct APP_URL:

define('APP_URL', 'https://nowpolygon.xyz');

Incorrect APP_URL:

define('APP_URL', 'https://nowpolygon.xyz/');


7. NIPAY.IO INTEGRATION
-----------------------

The website uses two different Nipay.io systems.

A. FAUCET REWARDS API

Used for automatic withdrawals.

Flow:

Owner Faucet Balance
        ↓
User Nipay.io Wallet

The owner Faucet Balance must contain enough POLYGON for automatic withdrawals.

The Faucet Rewards API is used for:

Automatic withdrawals
Reward payments
Sending POLYGON to registered Nipay.io users

B. MERCHANT CHECKOUT

Used when users buy Mining Speed.

Flow:

User Nipay.io Wallet
        ↓
Owner Nipay.io Wallet
        ↓
Website callback
        ↓
Mining Speed activation

Merchant Checkout is used for:

Buy Mining Speed
Membership payments
Products
Services
Token payments

Do not mix Faucet Rewards API and Merchant Checkout.

Faucet Rewards API sends money from the owner Faucet Balance.

Merchant Checkout deducts money from the user Nipay.io wallet and credits the owner wallet.


8. PAYMENT CALLBACK
-------------------

The payment callback file is:

/domains/nowpolygon.xyz/public_html/payment-callback.php

Use this callback URL:

https://nowpolygon.xyz/payment-callback

The callback automatically:

Verifies the Nipay.io signature
Checks the API key
Finds the pending order
Prevents duplicate payment crediting
Activates Mining Speed
Marks the order as completed
Returns a JSON response

The callback URL must be publicly accessible.

The callback must use the same Nipay.io API secret configured in config.php.


9. WEBSITE URLS
---------------

Main website:

https://nowpolygon.xyz/

Dashboard:

https://nowpolygon.xyz/?page=dashboard

Polygon Claim:

https://nowpolygon.xyz/?page=claim

TapTap Earn / TO MINE:

https://nowpolygon.xyz/?page=tap

Buy Mining Speed:

https://nowpolygon.xyz/?page=buy

Withdraw POLYGON:

https://nowpolygon.xyz/?page=withdraw

User Settings:

https://nowpolygon.xyz/?page=settings

Referral page:

https://nowpolygon.xyz/?page=referral

Private Admin page:

https://nowpolygon.xyz/?page=admin

Payment callback:

https://nowpolygon.xyz/payment-callback


10. FILE PERMISSIONS
--------------------

Recommended permissions:

Folders: 755
PHP files: 644
logo.png: 644
.htaccess: 644
config.php: 640

Ubuntu commands:

cd /domains/nowpolygon.xyz/public_html

find . -type d -exec chmod 755 {} \;

find . -type f -exec chmod 644 {} \;

chmod 640 config.php

chmod 644 .htaccess

chmod 644 logo.png

Make sure Apache can read all required project files.


11. ADMIN LOGIN
---------------

Open:

https://nowpolygon.xyz/?page=admin

Default login:

Email: admin@gmail.com
Password: admin

Change the default admin password immediately after the first login.

Do not show the admin URL in the public website menu.

Admin can manage:

Users
User balances
Total earned
Total withdrawn
Mining Speed
Speed expiration
Claim Locked
TapTap Locked
Withdraw Locked
Blocked users
Custom Claim amount
Custom TO MINE amount
Custom tap daily limit
Custom minimum withdrawal
Website title
Website description
Login text
Dashboard text
Claim text
TapTap text
Withdraw text
Buy Speed text
Referral settings
Ads banners
Speed plans
Withdrawals
Speed orders
Admin email
Admin password


12. USER LOGIN
--------------

Users login using an email registered on Nipay.io.

Login flow:

User enters Nipay.io email
Website sends a server-side request to Nipay.io
Nipay.io checks whether the email is registered
Website creates or updates the local user account
User enters the Dashboard

Only registered Nipay.io emails can use the website.

The user email is also used as the withdrawal destination.


13. DASHBOARD
-------------

The Dashboard shows:

Mining balance
Mining Speed
Total earned
TapTap remaining
Recent activity
Claim button
TapTap button
Buy Speed button
Withdraw button

The Dashboard works on:

Desktop
Laptop
Tablet
Android phone
iPhone


14. POLYGON CLAIM
-----------------

The Claim page allows users to collect POLYGON after the configured cooldown.

Admin can configure:

Claim enabled or disabled
Base Claim amount
Claim cooldown
Claim ready text
Claim Locked text
Custom user Claim amount
Custom user Claim lock time

Mining Speed multiplies the Claim reward.

Example:

Base Claim: 0.00005000 POLYGON
Mining Speed: 5X
User receives: 0.00025000 POLYGON

Claim flow:

User opens Claim page
Website checks Claim status
Website checks Claim cooldown
Website checks Claim Locked
Website checks Mining Speed
Website calculates reward
Website adds reward to user balance
Website records the transaction
Website displays success animation and sound


15. TO MINE / TAPTAP
--------------------

The TapTap page uses:

logo.php

logo.php loads:

logo.png

Admin can configure:

TapTap enabled or disabled
Amount per tap
Daily tap limit
Minimum tap interval
Custom user tap amount
Custom user daily tap limit
TapTap Locked time

Mining Speed multiplies TapTap rewards.

Example:

Base tap reward: 0.00000100 POLYGON
Mining Speed: 10X
User receives per accepted tap: 0.00001000 POLYGON

TapTap flow:

User taps the Polygon logo
Website checks the user session
Website checks CSRF token
Website checks TapTap status
Website checks TapTap Locked
Website checks daily tap limit
Website checks minimum tap interval
Website calculates Mining Speed multiplier
Website adds reward to balance
Website updates taps used
Website returns JSON
Browser displays reward sound and animation


16. BUY MINING SPEED
--------------------

The website includes Mining Speed plans.

Each plan contains:

Plan name
Speed multiplier
Duration in days
POLYGON price

Example plans:

Starter: 2X for 7 days
Pro: 5X for 15 days
Turbo: 10X for 30 days

Admin can change:

Plan name
Plan multiplier
Plan duration
Plan POLYGON price
Buy Speed enabled or disabled

Buy Speed flow:

User chooses a Mining Speed plan
Website creates a pending local order
Website redirects the user to Nipay.io Checkout
User logs in to Nipay.io
User confirms payment
Nipay.io deducts the user wallet
Nipay.io credits the owner wallet
Nipay.io sends the secure callback
Website verifies the callback
Website activates Mining Speed
Website marks the order completed


17. AUTOMATIC WITHDRAWALS
-------------------------

Users withdraw from the Mining POLYGON site balance to their registered Nipay.io email.

Withdrawal flow:

User enters withdrawal amount
Website checks user balance
Website checks minimum withdrawal
Website checks Withdraw Locked
Website deducts the amount temporarily
Website creates a processing transaction
Website calls Nipay.io Faucet Reward API
Nipay.io sends POLYGON to the user wallet
Transaction becomes completed
User total withdrawn is updated

When Nipay.io rejects the withdrawal:

The amount is restored to the user balance
The transaction becomes failed
The Nipay.io error message is saved

When the Nipay.io response is unclear:

The transaction becomes review
The balance remains reserved
Admin checks the transaction
Admin chooses Paid or Refund

Admin Paid action:

Marks the transaction completed
Adds the amount to total withdrawn

Admin Refund action:

Returns the amount to user balance
Marks the transaction refunded


18. REFERRAL SYSTEM
-------------------

Each user receives:

A personal referral code
A personal referral link
Referral statistics
Referral rewards

Example referral link:

https://nowpolygon.xyz/?ref=USERCODE

Referral flow:

Existing user shares referral link
New user opens the referral link
Referral code is saved
New user logs in with Nipay.io email
Website connects the invited user to the referrer
Referral rewards are calculated according to admin settings

Admin can configure:

Referral enabled or disabled
Referral commission percentage
Referrer bonus
New user welcome bonus
Referral title
Referral description
Referral banner
Referral ads

Referral rewards may be earned when the referred user:

Claims POLYGON
Uses TO MINE
Buys Mining Speed

The referral system must prevent:

Self-referral
Duplicate referral linking
Changing the referrer after registration
Duplicate referral reward crediting


19. USER SETTINGS
-----------------

Users can change:

Display name
Preferred page after login

Available preferred pages:

Dashboard
Claim
TapTap
Buy Speed
Withdraw

The user cannot change the Nipay.io email from the website because withdrawals are tied to the verified Nipay.io account.


20. ADS BANNERS
---------------

Admin can paste HTML or JavaScript advertisement code.

Available ad positions:

Top banner on logged-in pages
Dashboard banner
Claim page banner
TapTap page banner
Buy Speed page banner
Withdraw page banner
Referral page banner

Ads appear only on user pages.

Ads do not appear inside the Admin control center.

Admin can enable or disable all ads.


21. WEBSITE SETTINGS
--------------------

Admin can configure:

Website name
Website tagline
Website announcement
Login title
Login description
Dashboard title
Dashboard description
Claim title
Claim ready button text
Claim Locked text
TapTap title
TO MINE button text
Buy Mining Speed title
Buy Mining Speed description
Withdraw title
Referral title
Referral description
Footer text

Admin can enable or disable:

Entire website economy
Polygon Claim
TapTap / TO MINE
Buy Mining Speed
Automatic withdrawals
Referral system
Ads banners


22. FIRST WEBSITE TEST
----------------------

After installation, test the website in this order:

1. Open:

https://nowpolygon.xyz/

2. Login using an email registered on Nipay.io.

3. Confirm the Dashboard opens.

4. Test Polygon Claim.

5. Confirm the Claim reward is added to the balance.

6. Test TO MINE / TapTap.

7. Confirm TapTap rewards update the balance.

8. Open the Referral page.

9. Confirm the referral code and referral link appear.

10. Test sharing the referral link.

11. Open Buy Mining Speed.

12. Create a small test Mining Speed order.

13. Complete the payment using Nipay.io Checkout.

14. Confirm payment-callback.php activates Mining Speed.

15. Test a small automatic withdrawal.

16. Confirm the withdrawal reaches the registered Nipay.io email.

17. Confirm failed withdrawals restore the user balance.

18. Test the website on mobile.

19. Test the website on desktop.

20. Login to Admin and confirm all controls work.


23. COMMON PROBLEMS
-------------------

PROBLEM:

500 Internal Server Error

CHECK:

PHP version
PHP extensions
Database credentials
PHP error log
Apache error log
.htaccess support
File permissions

Apache error log example:

sudo tail -f /var/log/apache2/error.log


PROBLEM:

Clean URLs do not work

CHECK:

Apache mod_rewrite is enabled
AllowOverride All is enabled
.htaccess exists
Apache was restarted

Commands:

sudo a2enmod rewrite
sudo systemctl restart apache2


PROBLEM:

Security token expired

TRY:

Reload the page
Log out
Login again
Clear browser cache
Open the website in a private tab
Confirm PHP sessions are working
Confirm HTTPS is active
Confirm all PHP files are from the same project version
Confirm the browser sends the PHP session cookie


PROBLEM:

Claim does not work

CHECK:

Claim is enabled in Admin
User is not Claim Locked
Claim cooldown is complete
Database connection works
User session is active
CSRF token is valid
index.php reward endpoint returns JSON


PROBLEM:

TapTap does not work

CHECK:

TapTap is enabled
User is not TapTap Locked
Daily tap limit is not reached
Tap interval is valid
logo.php can load logo.png
JavaScript console has no errors
AJAX response is valid JSON


PROBLEM:

Withdrawal failed

CHECK:

Nipay.io API key
Nipay.io API secret
Owner Faucet Balance
User email is registered on Nipay.io
Minimum withdrawal
User balance
Withdraw enabled
User Withdraw Locked status
Nipay.io API response message


PROBLEM:

Mining Speed did not activate

CHECK:

Callback URL
payment-callback.php
Pending local order
Nipay API key
Nipay API secret
Callback signature
Order ID
Database connection
Order status
Callback response


PROBLEM:

Referral reward does not appear

CHECK:

Referral system is enabled
User used the referral link before login
Referrer code exists
User is not referring themselves
Referral percentage is greater than zero
Referral bonus settings are valid
Database referral fields exist


PROBLEM:

logo.png does not appear

CHECK:

logo.png exists in public_html
File name is exactly logo.png
File permission is 644
logo.php exists
Browser cache is cleared


24. PRODUCTION CHECKLIST
------------------------

Before opening the website to users:

[ ] HTTPS is active
[ ] Domain opens correctly
[ ] Apache mod_rewrite is enabled
[ ] AllowOverride All is enabled
[ ] Database is connected
[ ] SQL tables exist
[ ] config.php contains the correct domain
[ ] config.php contains the correct database details
[ ] Nipay.io API key is correct
[ ] Nipay.io API secret is correct
[ ] Default admin password was changed
[ ] Claim works
[ ] TapTap works
[ ] Referral works
[ ] Buy Mining Speed works
[ ] Payment callback works
[ ] Automatic withdrawal works
[ ] Failed withdrawal restores balance
[ ] logo.png appears correctly
[ ] Mobile menu works
[ ] Desktop layout works
[ ] Ads settings work
[ ] User management works
[ ] Mining Speed settings work
[ ] Claim Locked works
[ ] TapTap Locked works
[ ] Withdraw Locked works
[ ] Admin page is not shown in the public menu
[ ] config.php is protected by .htaccess


25. FINAL PUBLIC FILE LIST
--------------------------

The public_html folder should contain:

index.php
config.php
ajax.php
payment-callback.php
logo.php
logo.png
.htaccess


26. FINAL DOMAIN EXAMPLE
------------------------

Website:

https://nowpolygon.xyz/

Admin:

https://nowpolygon.xyz/?page=admin

Callback:

https://nowpolygon.xyz/payment-callback

Claim:

https://nowpolygon.xyz/?page=claim

TapTap:

https://nowpolygon.xyz/?page=tap

Buy Mining Speed:

https://nowpolygon.xyz/?page=buy

Withdraw:

https://nowpolygon.xyz/?page=withdraw

Referral:

https://nowpolygon.xyz/?page=referral


27. FINAL NOTES
---------------

Use HTTPS only.

Keep the Nipay.io API secret private.

Do not place private API credentials in JavaScript.

Do not show the Admin URL in the public menu.

Always create a pending order before redirecting to Nipay.io Checkout.

Always verify the callback signature.

Always prevent duplicate payment crediting.

Always prevent duplicate withdrawal processing.

Always restore the user balance when a withdrawal is clearly rejected.

Always place unclear withdrawals in Admin Review.

Always change the default Admin password after installation.

Keep the owner Nipay.io Faucet Balance funded with enough POLYGON for user withdrawals.


END OF DOCUMENTATION
==================