Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
aba1cd8b EM |
2 | |
3 | /** | |
4 | * Class test_extension_manager_paymenttest | |
5 | */ | |
6a488035 TO |
6 | class test_extension_manager_paymenttest extends CRM_Core_Payment { |
7 | static private $_singleton = NULL; | |
8 | ||
4cbe18b8 EM |
9 | /** |
10 | * singleton function used to manage this object | |
11 | * | |
12 | * @param string $mode the mode of operation: live or test | |
13 | * @param array $paymentProcessor the details of the payment processor being invoked | |
c490a46a | 14 | * @param CRM_Core_Form $paymentForm reference to the form object if available |
4cbe18b8 EM |
15 | * @param boolean $force should we force a reload of this payment object |
16 | * | |
17 | * @return object | |
18 | * @static | |
19 | * | |
20 | */ | |
6a488035 TO |
21 | static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { |
22 | $processorName = $paymentProcessor['name']; | |
23 | if (self::$_singleton[$processorName] === NULL) { | |
24 | self::$_singleton[$processorName] = new test_extension_manager_paymenttest(); | |
25 | } | |
26 | return self::$_singleton[$processorName]; | |
27 | } | |
28 | ||
29 | static $counts = array(); | |
30 | ||
31 | function install() { | |
32 | self::$counts['install'] = 1 + (int) self::$counts['install']; | |
33 | } | |
34 | ||
35 | function uninstall() { | |
36 | self::$counts['uninstall'] = 1 + (int) self::$counts['uninstall']; | |
37 | } | |
38 | ||
39 | function disable() { | |
40 | self::$counts['disable'] = 1 + (int) self::$counts['disable']; | |
41 | } | |
42 | ||
43 | function enable() { | |
44 | self::$counts['enable'] = 1 + (int) self::$counts['enable']; | |
45 | } | |
46 | ||
4cbe18b8 EM |
47 | /** |
48 | * This function collects all the information from a web/api form and invokes | |
49 | * the relevant payment processor specific functions to perform the transaction | |
50 | * | |
51 | * @param array $params assoc array of input parameters for this transaction | |
52 | * | |
53 | * @return array the result in an nice formatted array (or an error object) | |
54 | * @abstract | |
55 | */ | |
6a488035 TO |
56 | function doDirectPayment(&$params) { |
57 | } | |
58 | ||
59 | function checkConfig() { | |
60 | } | |
4cbe18b8 | 61 | } |