/gravityforms-paystation.php

  1. <?php 
  2. /** 
  3. Plugin Name: Gravity Forms Paystation (3 party hosted) 
  4. Plugin URI: http://www.paystation.co.nz/Definitions 
  5. Description: Integrates Gravity Forms with the Paystation 3 party payment gateway allowing end users to purchase goods and services, or make donations, via Gravity Forms. 
  6. Version: 1.4.3 
  7. Author: Paystation Limited 
  8. Author URI: http://www.paystation.co.nz 
  9. License: GPL2 
  10. */ 
  11. /** Copyright 2014 Paystation Limited (email : info@paystation.co.nz) 
  12.   
  13. This program is free software; you can redistribute it and/or modify 
  14. it under the terms of the GNU General Public License, version 2, as  
  15. published by the Free Software Foundation. 
  16.   
  17. This program is distributed in the hope that it will be useful,  
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of 
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  20. GNU General Public License for more details. 
  21.   
  22. You should have received a copy of the GNU General Public License 
  23. along with this program; if not, write to the Free Software 
  24. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 
  25. */ 
  26.  
  27. if (!defined('GFPAYSTATION_PLUGIN_ROOT')) { 
  28. define('GFPAYSTATION_PLUGIN_ROOT', dirname(__FILE__) . '/'); 
  29. define('GFPAYSTATION_PLUGIN_NAME', basename(dirname(__FILE__)) . '/' . basename(__FILE__)); 
  30. define('GFPAYSTATION_PLUGIN_OPTIONS', 'gfpaystation_plugin'); 
  31.  
  32. // ****** REMEMBER TO UPDATE THIS TOO ******* 
  33. define('GFPAYSTATION_PLUGIN_VERSION', '1.4.3'); 
  34.  
  35. // Custom post types 
  36. define('GFPAYSTATION_TYPE_FEED', 'gfpaystation_feed'); 
  37.  
  38. // End point for the Paystation API 
  39. define('GFPAYSTATION_API_URL', 'https://www.paystation.co.nz/direct/paystation.dll'); 
  40.  
  41. // End point for return to website - the redirect after the payment. 
  42. define('GFPAYSTATION_RETURN', 'gfpaystation_return'); 
  43.  
  44. // End point for the postback from paystation to this site with the confirmation of the payment. 
  45. define('GFPAYSTATION_POSTBACK', 'gfpaystation_postback'); 
  46.  
  47. // Name used as cURL user agent 
  48. define('GFPAYSTATION_CURL_USER_AGENT', 'Gravity Forms Paystation (3 party hosted)'); 
  49.  
  50. /** 
  51. * autoload classes as/when needed 
  52. * 
  53. * @param string $class_name name of class to attempt to load 
  54. */ 
  55. function gfpaystation_autoload($class_name) { 
  56. static $classMap = array ( 
  57. 'GFPaystationAdmin' => 'class.GFPaystationAdmin.php',  
  58. 'GFPaystationFeed' => 'class.GFPaystationFeed.php',  
  59. 'GFPaystationFeedAdmin' => 'class.GFPaystationFeedAdmin.php',  
  60. 'GFPaystationFormData' => 'class.GFPaystationFormData.php',  
  61. 'GFPaystationOptionsAdmin' => 'class.GFPaystationOptionsAdmin.php',  
  62. 'GFPaystationPayment' => 'class.GFPaystationPayment.php',  
  63. 'GFPaystationPlugin' => 'class.GFPaystationPlugin.php',  
  64. 'GFPaystationReturnResult' => 'class.GFPaystationReturnResult.php',  
  65. 'GFPaystationPostbackResult' => 'class.GFPaystationPostbackResult.php',  
  66. ); 
  67.  
  68. if (isset($classMap[$class_name])) { 
  69. require GFPAYSTATION_PLUGIN_ROOT . $classMap[$class_name]; 
  70.  
  71. // register a class (static) method for autoloading required classes 
  72. spl_autoload_register('gfpaystation_autoload'); 
  73.  
  74. // instantiate the plug-in 
  75. GFPaystationPlugin::getInstance(); 
.