Super Admin's Panel

How to use the Module Code Generation Feature on FHBRS for Super Admins

 

 

The module code is the engine behind auto product creation, suspension, un suspension, upgrade & renew. Since FHBRS is very dynamic and flexible, we have made it possible for anyone to be able to write their own Module even if they aren’t programmers. You first need to read about Modules and how it works from Here https://doc.fhbrs.com/index.php/knowledgebase/how-to-create-your-own-module-on-fhbrs/

 

From the previous Modules page, you would understand that there are 5 types of calls. NEW, RENEW, UPGRADE, SUSPEND & UN-SUSPEND. So the module generation code also focuses on these call types. The boxes on this page shall be explained one after the other.

 

  • Process Type: This is already chosen for you.
  • Category: Select the category of the product you are generating this module for.
  • Curl Method: Here there are several options, just select the one that applies to your destination API.
  • URL Destination: Here, you should enter the URL for the API call as seen by your API structure you are connecting to. Here you should include only the URL without any additional value. Most PI URL would end with ? Make sure you don’t add this!
  • Success Return Variable: This is the return value that must be true before FHBRS would mark the order as processed. Example; if your api is returning Success when the API has been processed and Error when there is an error. Here, you should simply just append this like this

$resp[‘Success’]

So FHBRS would wait until your API returns that, if you don’t enter this correctly your script won’t work correctly. If your array is stored inside something called data. Then your variable should be something like $resp[‘data’][‘Success’]

Please contact us via Ticket to help you determine what your success API says it would return.

  • Addons (Names & Values): We have helped to simply the process into addons. So here example, if your API is a Get or Post with the following parameters;

user=frank&sender=test&message=hello

You should create an addon and add col as user and then val as frank just like that for all your parameters. So, here on this page, you can then select them into this API structure.

Note: Whatever you select would send to your API as either GET or POST depending on what you have selected.

For Get it becomes http://your-url?col1=val1&col2=val2 just like that. So when creating an addon you would want to use the same name as it appears on your API so that you can just select them on this page.

 

So if there are several privileges you would need to set them from your addons and then attach them to the product. So that when an order is made, it will check the addon’s configuration to connect to your API.

  • Activity Name: Here is the recent activity the user would see on his dashboard. You would want to place something that relates to what the user has just done; also you can use the available tags on that page.

Example; your purchase for {order-name} was successful.

Please check the allowed tags for this script at the top of this page.

 

  • Email Subject: This is the subject of the email that would be sent after the process has been completed. You can use the allowed tags here
  • Email Body: This is the body of the email that would be sent after the process has been completed. You can use the allowed tags here
Related Articles