Overview
  • Namespace
  • Class

Namespaces

  • Mypos
    • IPC

Classes

  • Mypos\IPC\Authorization
  • Mypos\IPC\AuthorizationCapture
  • Mypos\IPC\AuthorizationList
  • Mypos\IPC\AuthorizationReverse
  • Mypos\IPC\Base
  • Mypos\IPC\Card
  • Mypos\IPC\CardStore
  • Mypos\IPC\Cart
  • Mypos\IPC\Config
  • Mypos\IPC\Customer
  • Mypos\IPC\Defines
  • Mypos\IPC\GetPaymentStatus
  • Mypos\IPC\GetTxnStatus
  • Mypos\IPC\Helper
  • Mypos\IPC\IAPreAuthorization
  • Mypos\IPC\IAPurchase
  • Mypos\IPC\IAStoreCard
  • Mypos\IPC\IAStoredCardUpdate
  • Mypos\IPC\IPCGetTxnLog
  • Mypos\IPC\Loader
  • Mypos\IPC\MandateManagement
  • Mypos\IPC\PreAuthorization
  • Mypos\IPC\PreAuthorizationCancellation
  • Mypos\IPC\PreAuthorizationCompletion
  • Mypos\IPC\PreAuthorizationStatus
  • Mypos\IPC\Purchase
  • Mypos\IPC\PurchaseByIcard
  • 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: IPCGetTxnStatus.
 7  * Collect, validate and send API params
 8  */
 9 class GetTxnStatus extends Base
10 {
11     private $orderID;
12 
13     public function __construct(Config $cnf)
14     {
15         $this->setCnf($cnf);
16     }
17 
18     /**
19      * Initiate API request
20      *
21      * @return Response
22      */
23     public function process()
24     {
25         $this->validate();
26 
27         $this->_addPostParam('IPCmethod', 'IPCGetTxnStatus');
28         $this->_addPostParam('IPCVersion', $this->getCnf()->getVersion());
29         $this->_addPostParam('IPCLanguage', $this->getCnf()->getLang());
30         $this->_addPostParam('SID', $this->getCnf()->getSid());
31         $this->_addPostParam('WalletNumber', $this->getCnf()->getWallet());
32         $this->_addPostParam('KeyIndex', $this->getCnf()->getKeyIndex());
33         $this->_addPostParam('Source', $this->getCnf()->getSource());
34 
35         $this->_addPostParam('OrderID', $this->getOrderID());
36         $this->_addPostParam('OutputFormat', $this->getOutputFormat());
37 
38         return $this->_processPost();
39     }
40 
41     /**
42      * Validate all set details
43      *
44      * @return boolean
45      * @throws IPC_Exception
46      */
47     public function validate()
48     {
49         try {
50             $this->getCnf()->validate();
51         } catch (\Exception $ex) {
52             throw new IPC_Exception('Invalid Config details: '.$ex->getMessage());
53         }
54 
55         if ($this->getOrderID() == null || !Helper::isValidOrderId($this->getOrderID())) {
56             throw new IPC_Exception('Invalid OrderId');
57         }
58 
59         if ($this->getOutputFormat() == null || !Helper::isValidOutputFormat($this->getOutputFormat())) {
60             throw new IPC_Exception('Invalid Output format');
61         }
62 
63         return true;
64     }
65 
66     /**
67      * Original request order id
68      *
69      * @return string
70      */
71     public function getOrderID()
72     {
73         return $this->orderID;
74     }
75 
76     /**
77      * Original request order id
78      *
79      * @param string $orderID
80      *
81      * @return GetTxnStatus
82      */
83     public function setOrderID($orderID)
84     {
85         $this->orderID = $orderID;
86 
87         return $this;
88     }
89 }
90 
API documentation generated by ApiGen