Overview
  • Namespace
  • Class

Namespaces

  • Mypos
    • IPC

Classes

  • Mypos\IPC\Base
  • Mypos\IPC\Card
  • Mypos\IPC\CardStore
  • Mypos\IPC\Cart
  • Mypos\IPC\Config
  • Mypos\IPC\Customer
  • Mypos\IPC\Defines
  • Mypos\IPC\GetTxnStatus
  • Mypos\IPC\Helper
  • Mypos\IPC\IAPurchase
  • Mypos\IPC\IAStoreCard
  • Mypos\IPC\IAStoredCardUpdate
  • Mypos\IPC\IPCGetTxnLog
  • Mypos\IPC\Loader
  • Mypos\IPC\MandateManagement
  • Mypos\IPC\Purchase
  • Mypos\IPC\Refund
  • Mypos\IPC\RequestMoney
  • Mypos\IPC\Response
  • Mypos\IPC\Reversal

Exceptions

  • Mypos\IPC\IPC_Exception
 1 <?php
 2 
 3 namespace Mypos\IPC;
 4 
 5 /**
 6  * Process IPC method: IPCGetTxnLog.
 7  * Collect, validate and send API params
 8  */
 9 class IPCGetTxnLog extends Base{
10 
11     private $orderID;
12 
13     /**
14      * Return IPCGetTxnLog object
15      * @param Config $cnf
16      */
17     public function __construct(Config $cnf){
18         $this->setCnf($cnf);
19     }
20 
21     /**
22      * Original request order id
23      * @param string $orderID
24      * @return IPCGetTxnLog
25      */
26     public function setOrderID($orderID){
27         $this->orderID = $orderID;
28         return $this;
29     }
30 
31     /**
32      * Original request order id
33      * @return string
34      */
35     public function getOrderID(){
36         return $this->orderID;
37     }
38 
39     /**
40      * Initiate API request
41      * @return boolean
42      */
43     public function process(){
44         $this->validate();
45 
46         $this->_addPostParam('IPCmethod', 'IPCGetTxnLog');
47         $this->_addPostParam('IPCVersion', $this->getCnf()->getVersion());
48         $this->_addPostParam('IPCLanguage', $this->getCnf()->getLang());
49         $this->_addPostParam('SID', $this->getCnf()->getSid());
50         $this->_addPostParam('WalletNumber', $this->getCnf()->getWallet());
51         $this->_addPostParam('KeyIndex', $this->getCnf()->getKeyIndex());
52         $this->_addPostParam('Source', Defines::SOURCE_PARAM);
53         $this->_addPostParam('OrderID', $this->getOrderID());
54         $this->_addPostParam('OutputFormat', $this->getOutputFormat());
55         return $this->_processPost();
56     }
57 
58     /**
59      * Validate all set details
60      * @return boolean
61      * @throws IPC_Exception
62      */
63     public function validate(){
64         try{
65             $this->getCnf()->validate();
66         }catch(Exception $ex){
67             throw new IPC_Exception('Invalid Config details: ' . $ex->getMessage());
68         }
69 
70         if($this->getOrderID() == null || !Helper::isValidOrderId($this->getOrderID())){
71             throw new IPC_Exception('Invalid OrderId');
72         }
73 
74         if($this->getOutputFormat() == null || !Helper::isValidOutputFormat($this->getOutputFormat())){
75             throw new IPC_Exception('Invalid Output format');
76         }
77         return true;
78     }
79 
80 }
81 
API documentation generated by ApiGen