Annotation of /com_supacart/trunk/admin_files/classes/payment/ps_nochex.php
Parent Directory
|
Revision Log
Revision 4 - (view) (download)
| 1 : | andphe | 4 | <?php |
| 2 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 3 : | /** | ||
| 4 : | * | ||
| 5 : | * @version $Id: ps_nochex.php 617 2007-01-04 19:43:08Z soeren_nb $ | ||
| 6 : | * @package SupaCart | ||
| 7 : | * @subpackage payment | ||
| 8 : | * See COPYRIGHT.php for copyright notices and details. | ||
| 9 : | * @license GNU/GPL Version 2, see LICENSE.php | ||
| 10 : | * SupaCart is free software, originally derived from Virtuemart. This version may have been modified pursuant | ||
| 11 : | * to the GNU General Public License, and as distributed it includes or | ||
| 12 : | * is derivative of works licensed under the GNU General Public License or | ||
| 13 : | * other free or open source software licenses. | ||
| 14 : | * See /administrator/components/com_supacart/COPYRIGHT.php for copyright notices and details. | ||
| 15 : | * | ||
| 16 : | * http://www.supacart.com | ||
| 17 : | */ | ||
| 18 : | |||
| 19 : | class ps_nochex { | ||
| 20 : | |||
| 21 : | var $classname = "ps_nochex"; | ||
| 22 : | var $payment_code = "NOCHEX"; | ||
| 23 : | |||
| 24 : | /** | ||
| 25 : | * Show all configuration parameters for this payment method | ||
| 26 : | * @returns boolean False when the Payment method has no configration | ||
| 27 : | */ | ||
| 28 : | function show_configuration() { | ||
| 29 : | global $VM_LANG; | ||
| 30 : | $db = new ps_DB(); | ||
| 31 : | |||
| 32 : | /** Read current Configuration ***/ | ||
| 33 : | include_once(CLASSPATH ."payment/".$this->classname.".cfg.php"); | ||
| 34 : | ?> | ||
| 35 : | <table> | ||
| 36 : | <tr> | ||
| 37 : | <td><strong>NoChex Email</strong></td> | ||
| 38 : | <td> | ||
| 39 : | <input type="text" name="NOCHEX_EMAIL" class="inputbox" value="<?php echo NOCHEX_EMAIL ?>" /> | ||
| 40 : | </td> | ||
| 41 : | <td>The Email-Account for your NoChex Payments. | ||
| 42 : | </td> | ||
| 43 : | </tr> | ||
| 44 : | </table> | ||
| 45 : | <?php | ||
| 46 : | } | ||
| 47 : | |||
| 48 : | function has_configuration() { | ||
| 49 : | // return false if there's no configuration | ||
| 50 : | return true; | ||
| 51 : | } | ||
| 52 : | |||
| 53 : | /** | ||
| 54 : | * Returns the "is_writeable" status of the configuration file | ||
| 55 : | * @param void | ||
| 56 : | * @returns boolean True when the configuration file is writeable, false when not | ||
| 57 : | */ | ||
| 58 : | function configfile_writeable() { | ||
| 59 : | return is_writeable( CLASSPATH."payment/".$this->classname.".cfg.php" ); | ||
| 60 : | } | ||
| 61 : | |||
| 62 : | /** | ||
| 63 : | * Returns the "is_readable" status of the configuration file | ||
| 64 : | * @param void | ||
| 65 : | * @returns boolean True when the configuration file is writeable, false when not | ||
| 66 : | */ | ||
| 67 : | function configfile_readable() { | ||
| 68 : | return is_readable( CLASSPATH."payment/".$this->classname.".cfg.php" ); | ||
| 69 : | } | ||
| 70 : | |||
| 71 : | /** | ||
| 72 : | * Writes the configuration file for this payment method | ||
| 73 : | * @param array An array of objects | ||
| 74 : | * @returns boolean True when writing was successful | ||
| 75 : | */ | ||
| 76 : | function write_configuration( &$d ) { | ||
| 77 : | |||
| 78 : | $my_config_array = array("NOCHEX_EMAIL" => $d['NOCHEX_EMAIL']); | ||
| 79 : | $config = "<?php\n"; | ||
| 80 : | $config .= "defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); \n\n"; | ||
| 81 : | foreach( $my_config_array as $key => $value ) { | ||
| 82 : | $config .= "define ('$key', '$value');\n"; | ||
| 83 : | } | ||
| 84 : | |||
| 85 : | $config .= "?>"; | ||
| 86 : | |||
| 87 : | if ($fp = fopen(CLASSPATH ."payment/".$this->classname.".cfg.php", "w")) { | ||
| 88 : | fputs($fp, $config, strlen($config)); | ||
| 89 : | fclose ($fp); | ||
| 90 : | return true; | ||
| 91 : | } | ||
| 92 : | else | ||
| 93 : | return false; | ||
| 94 : | } | ||
| 95 : | |||
| 96 : | /************************************************************************** | ||
| 97 : | ** name: process_payment() | ||
| 98 : | ** returns: | ||
| 99 : | ***************************************************************************/ | ||
| 100 : | function process_payment($order_number, $order_total, &$d) { | ||
| 101 : | return true; | ||
| 102 : | } | ||
| 103 : | |||
| 104 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

