This page provides a detailed description of the payment plug-in structure, the basic steps in creating a VoipNow Automation Payment Plug-in, explaining the logical and physical structure of a plug-in and the way it interacts with the system.
A VoipNow Plug-in consists of three parts that you can find fully described below.
Payment Plug-in Manager
It is a configuration file with which the VoipNow Automation interface generates a setup page for the plug-in. It consists of the
setup/setup.xml file and the language pack files from the
This part of the plug-in is present in the VoipNow Automation store and generates the payment inputs, based on the
file content (which is saved in the database and can be modified) and on the language pack files from the
Gateway Interaction Methods
These methods form a class that enhances the communication between VoipNow Automation and the gateway that needs to be implemented. It will be located in the
A plug-in is composed of one or more files and folders and it is uploaded as an archive in the VoipNow web management interface.
- Each developer may create plug-ins with different structures, but all developers must follow a basic folder structure in order to be registered in the VoipNow;
- Aside from the files and folders represented in the image below, the plug-in may also contain a set of back-end custom files and folders, entirely designed by the developer;
- These files define auxiliary functions that are used internally and serve the purpose of the plug-in's purpose.
The folder structure of a VoipNow Plug-in consists of the following:
The index.php File
- It is mandatory that every plug-in contains an
index.phpfile in the plug-in root;
- This file will contain the main gateway or the payment processor interaction class.
- When a payment request is made, either 4PSA VoipNow Automation or the Automation Store will require this file in order to initiate the class that will handle the communication with the payment processor.
Please find below the structure of the file.
The Language Folder
- This folder contains the language pack files of the plug-in.
- All the output messages must be displayed in the language that the customer has selected from the interface.
The user's language support can be achieved from plug-ins as follows: STEP 1: Create a folder named
in the plug-in root. STEP 2: Create one file for each language defined in VoipNow and place it inside the
STEP 3: Define an array with the language pack messages inside each language file. The structure of the array is: key => value.
STEP 4: Use the OnlinePaymentInterface::translate method described in the Plug-in Methods section to display a message in the current user language.
The setup.xml File
- This file, which is located under the
/setupfolder, will provide configuration information for the plug-in within the 4PSA VoipNow Automation interface;
- Once the plug-in is registered, it must be configured for use;
- The configuration page from 4PSA VoipNow Automation interface will require the
setup.xmlfile in order to generate the setup form;
- The XML syntax for the setup file is presented in the Setup File section .
The requirements.xml File
- For each method that has been used, this file will provide information about the fields that will be displayed under the 4PSA VoipNow Automation store;
- Once the plug-in is configured and in use, if the user will choose to pay with this plug-in, the
requirements. xmlfile will provide details about the required fields specific to each method;
- This file also uses the XML syntax, which is very similar to the syntax
The required_inc.php File
- This file will specify the required inputs for each plug-in method;
- The file contains an array with the names of the plug-in methods as indexes and arrays containing the required fields' names as values;
- The list of input parameters for each plug-in method can be found in the section called Plug-in Methods section .
The License File
This file contains the plug-in license information. If you want to distribute the plug-in under the General Public License (GPL) agreement, include the following paragraph:
The Meta File
Each plug-in must contain a
meta file with standard recognition plug-in information. 4PSA VoipNow does not allow uploading and running plug-ins without the following set of informations:
The file content format is the following:
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.