[TOC]
Since version 2.9.2, OS Property is "extend" with an important feature that allows the website owner can earn money from users when they post real estate properties into OS Property system.
As we all know, every property in the OS Property will belong Standard or Featured states. In the previous version, users can post their properties without having to pay fees, and when they want those properties are highlighted in the list, then they may pay to upgrade those properties to Featured. There are some shortcomings in this way:
OS Property supports multiple payment plugins. After being installed, the payment plugins are stored in the folder components/com_osproperty/plugins
Following are steps to create a payment plugin for OS Property:
Step 1: Create a .xml file to define the plugin package (example os_paypal.xml) with the structure as following:
Step 2: Create a .php file to put the code to process the payment (example os_paypal.php):
// Each payment plugin is defined as a class which is extended from parent class os_payment class os_paymentname extends os_payment {
Constructor functions, init some parameters which are used in the payment method *
- @param object $config to include parameters are defined in the xml file */ public function os_paymentname ($params) { // Put the code here
}/**
- This function to process payment
- @param array $data include all of information of processing order as an array
*/ public function processPayment($data) { // Put the code here }/**
- This function to verify payment
*/ public function verifyPayment() { // Put the code here } }
Step 3: Make a zip package include 2 above files, then login to the back-end of your site, go to OS Property -> Manage Payment plugins to choose the zip package of payment plugin and install it from there.
Notice: To develop your own payment plugin easily, you should based on the source code of the default payment plugins in OS Property.