1: | <?php
|
2: |
|
3: | namespace Mypos\IPC;
|
4: |
|
5: | |
6: | |
7: | |
8: |
|
9: | class IPCGetTxnLog extends Base
|
10: | {
|
11: | private $orderID;
|
12: |
|
13: | |
14: | |
15: | |
16: | |
17: |
|
18: | public function __construct(Config $cnf)
|
19: | {
|
20: | $this->setCnf($cnf);
|
21: | }
|
22: |
|
23: | |
24: | |
25: | |
26: | |
27: | |
28: |
|
29: | public function process()
|
30: | {
|
31: | $this->validate();
|
32: |
|
33: | $this->_addPostParam('IPCmethod', 'IPCGetTxnLog');
|
34: | $this->_addPostParam('IPCVersion', $this->getCnf()->getVersion());
|
35: | $this->_addPostParam('IPCLanguage', $this->getCnf()->getLang());
|
36: | $this->_addPostParam('SID', $this->getCnf()->getSid());
|
37: | $this->_addPostParam('WalletNumber', $this->getCnf()->getWallet());
|
38: | $this->_addPostParam('KeyIndex', $this->getCnf()->getKeyIndex());
|
39: | $this->_addPostParam('Source', $this->getCnf()->getSource());
|
40: | $this->_addPostParam('OrderID', $this->getOrderID());
|
41: | $this->_addPostParam('OutputFormat', $this->getOutputFormat());
|
42: |
|
43: | return $this->_processPost();
|
44: | }
|
45: |
|
46: | |
47: | |
48: | |
49: | |
50: | |
51: |
|
52: | public function validate()
|
53: | {
|
54: | try {
|
55: | $this->getCnf()->validate();
|
56: | } catch (\Exception $ex) {
|
57: | throw new IPC_Exception('Invalid Config details: '.$ex->getMessage());
|
58: | }
|
59: |
|
60: | if ($this->getOrderID() == null || !Helper::isValidOrderId($this->getOrderID())) {
|
61: | throw new IPC_Exception('Invalid OrderId');
|
62: | }
|
63: |
|
64: | if ($this->getOutputFormat() == null || !Helper::isValidOutputFormat($this->getOutputFormat())) {
|
65: | throw new IPC_Exception('Invalid Output format');
|
66: | }
|
67: |
|
68: | return true;
|
69: | }
|
70: |
|
71: | |
72: | |
73: | |
74: | |
75: |
|
76: | public function getOrderID()
|
77: | {
|
78: | return $this->orderID;
|
79: | }
|
80: |
|
81: | |
82: | |
83: | |
84: | |
85: | |
86: | |
87: |
|
88: | public function setOrderID($orderID)
|
89: | {
|
90: | $this->orderID = $orderID;
|
91: |
|
92: | return $this;
|
93: | }
|
94: | }
|
95: | |