Payment plugins

[TOC]

Manage Payment Plugins

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:

  • Website owner can only get money when user upgrade their properties from Standard to Featured
  • OS Property only supports Paypal payment gateway, which also reduces the degree of component flexibility.
    Understanding this limitation, after a period of development and testing, the developer team has made new improvement and from now:
  • Site owner may earn money from user when they post their real estate in both Standard and Featured.
  • With this new version, other payment gateways are added, such as Offline, Stripe, Authorize.net. All the payment gateways can be managed from Administrator side through tool: Manage Payment Plugins.
  • With this tool, you can Publish / Unpublish the Payment plugins you want to use on the site, and in the future, when OS Property supports new more Payment plugins, you'll be able to install them via this management tool.
    Each Payment Plugin will have:
    Title
    Title of Payment Plugin
    Author
    Developer of Payment Plugin
    Description
    Description of Payment Plugin, it will be shown at front-end of OS Property
    Published
    Published status of Payment plugin
    Payment Plugin parameters

Develop Payment Plugins

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.