Create a custom captive portal

Hi everyone, if i came here its because i need help from you :
i want to create a custom captive portal with paypal etc.
So i made this setup :
https':'//s31'.'postimg'.'cc/6pdzrul3f/Sans_titre_-_Copie'.'png
if it doesn't work
https':'//imgur'.'com/a/whdeBzZ

I have created the side of the other computer (it contains a dashboard for user, for the admin, etc)
to create an account user can click on register and they will be redirected to the other computer where they can make payment for each devices etc
for the untangle side i want to create a basic python script like :
1 - store and sync with the other computer the credentials and their devices'mac address of each user to grant them an access to the internet when they connect in untangle captive page
2 - when a user connect from untangle captive page his mac address must belong to his account and if not it can't pass
3 - automatically redirect to a error page saying that his plan need to be renewed a mac address when a plan for his device of this user has expired or he didn't pay

so i know how to send the credentials etc from other computer to untangle but how to link a mac address of a user to his account in untangle, i mean how to store the mac address because it need to read the credentials in the local directory and read if there are any mac address that is exactly the same that the one trying to connect so if its the same he can pass otherwise not.
and to redirect a mac address to a web page how i can do that ?