-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPayment.php
More file actions
76 lines (74 loc) · 1.71 KB
/
Payment.php
File metadata and controls
76 lines (74 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* M PHP Framework
*
* @package M
* @subpackage Payment
* @author Arnaud Sellenet <demental at github>
* @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
* @version 0.1
*/
/**
*
* Credit card payment process abstraction - draft (currently includes a driver for ATOS SIPS)
*
*/
class Payment {
public function &factory($driver='SIPS')
{
$driver = strtoupper($driver);
$className = 'Payment_Driver_'.$driver;
$options = PEAR::getStaticProperty('Payment_process','options');
return new $className($options);
}
public function setOptions($arr)
{
$this->options = $arr;
}
public function getOption($value)
{
return $this->options[$value];
}
public function setOption($var,$val)
{
$this->options[$var]=$val;
}
function fetch() {
throw new Exception('Driver not implemented');
}
function getResponse() {
throw new Exception('Driver not implemented');
}
function getTransactionId() {
return $this->transaction_id;
}
public function setTransactionId($id) {
$this->transaction_id=$id;
}
function &getOrder() {
if(!is_a('iOrder',$this->order)) {
$this->order = new Order;
$this->order->retrieveFromId($this->getOrderId());
}
return $this->order;
}
public function getTranscript()
{
return $this->transcript;
}
function logError() {
$mail = Mail::factory('vide');
$mail->setVars(array('body'=>print_r($this,true),'subject'=>'debug CB'));
$mail->sendTo('demental at github');
return;
}
public function getMode() {
return $this->_mode;
}
public function setMode($mode) {
$this->_mode = $mode;
}
public function getResponseCode() {
return $this->transcript['response_code'];
}
}