| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /* | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | * This file is part of the PayBreak/basket package. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  | * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | * (c) PayBreak <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | * For the full copyright and license information, please view the LICENSE | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | * file that was distributed with this source code. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  | */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | namespace PayBreak\Sdk\Gateways; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use PayBreak\Sdk\Entities\ApplicationEntity; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use PayBreak\Sdk\SdkException; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | use PayBreak\ApiClient\ErrorResponseException; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |  * Application Gateway | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |  * @author WN | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |  * @package PayBreak\Sdk\Gateways | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | class ApplicationGateway extends AbstractGateway | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |      * @author WN | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |      * @param int $id | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |      * @param string $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |      * @return ApplicationEntity | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |      * @throws SdkException | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 | 2 |  |     public function getApplication($id, $token) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 | 2 |  |         return ApplicationEntity::make($this->fetchDocument('/v4/applications/' . $id, $token, 'Application')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |      * @author WN | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |      * @param ApplicationEntity $application | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |      * @param string $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |      * @return ApplicationEntity | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |      * @throws SdkException | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 43 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 44 | 6 |  |     public function initialiseApplication(ApplicationEntity $application, $token) | 
            
                                                                        
                            
            
                                    
            
            
                | 45 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 46 | 6 |  |         $api = $this->getApiFactory()->makeApiClient($token); | 
            
                                                                        
                            
            
                                    
            
            
                | 47 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 48 |  |  |         try { | 
            
                                                                        
                            
            
                                    
            
            
                | 49 | 6 |  |             $response = $api->post('/v4/initialize-application', $application->toArray(true)); | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 51 | 2 |  |             $application->setId($response['application']); | 
            
                                                                        
                            
            
                                    
            
            
                | 52 | 2 |  |             $application->setResumeUrl($response['url']); | 
            
                                                                        
                            
            
                                    
            
            
                | 53 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 54 | 2 |  |             return $application; | 
            
                                                                        
                            
            
                                    
            
            
                | 55 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 56 | 4 |  |         } catch (ErrorResponseException $e) { | 
            
                                                                        
                            
            
                                    
            
            
                | 57 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 58 | 2 |  |             $this->logWarning('ApplicationGateway::initialiseApplication[' . $e->getCode() . ']: ' . $e->getMessage()); | 
            
                                                                        
                            
            
                                    
            
            
                | 59 | 2 |  |             throw new SdkException($e->getMessage()); | 
            
                                                                        
                            
            
                                    
            
            
                | 60 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 61 | 2 |  |         } catch (\Exception $e) { | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 63 | 2 |  |             $this->logError('ApplicationGateway::initialiseApplication[' . $e->getCode() . ']: ' . $e->getMessage()); | 
            
                                                                        
                            
            
                                    
            
            
                | 64 | 2 |  |             throw new SdkException('Problem Initialising Application on Provider API'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |      * @author EA, EB | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |      * @param ApplicationEntity $application | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |      * @param string $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |      * @return ApplicationEntity | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |      * @throws SdkException | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 | 2 |  |     public function initialiseAssistedApplication(ApplicationEntity $application, $token) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |         $api = $this->getApiFactory()->makeApiClient($token); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |         try { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |             $response = $api->post('/v4/initialize-assisted-application', $application->toArray(true)); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 | 2 |  |             $application->setId($response['application']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |             $application->setResumeUrl($response['url']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |             $application->setUser($response['user']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |             return $application; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |         } catch (ErrorResponseException $e) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |             $this->logWarning('ApplicationGateway::initialiseAssistedApplication[' . $e->getCode() . ']: ' . $e->getMessage()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |             throw new SdkException($e->getMessage()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |         } catch (\Exception $e) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |             $this->logError('ApplicationGateway::initialiseAssistedApplication[' . $e->getCode() . ']: ' . $e->getMessage()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |             throw new SdkException('Problem Initialising Assisted Application on Provider API'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |      * @author WN, EB | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |      * @param int $id | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |      * @param string $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |      * @param string $reference | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |      * @return bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |      * @throws SdkException | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 | 2 |  |     public function fulfilApplication($id, $token, $reference = null) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 | 2 |  |         return $this->requestAction('/v4/applications/' . $id . '/fulfil', ['reference' => $reference], $token); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |      * @param int $id | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |      * @param string $description | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |      * @param string $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  |      * @return bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |      * @throws SdkException | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 | 2 |  |     public function cancelApplication($id, $description, $token) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 | 2 |  |         return $this->requestAction( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 | 2 |  |             '/v4/applications/' . $id . '/request-cancellation', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 | 2 |  |             ['description' => $description], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  |             $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 | 2 |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  |      * @param $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  |      * @throws SdkException | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 | 2 |  |     public function getPendingCancellations($installationId, $token) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 | 2 |  |         return $this->fetchDocument( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 | 2 |  |             '/v4/installations/' . $installationId . '/applications', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 | 2 |  |             $token, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 | 2 |  |             'Pending Cancellations', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 | 2 |  |             ['pending-cancellations' => true] | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 | 2 |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  |      * Get Merchant Payments. Filter Params can accept | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  |      * - since, until : (string - ISO8601 Date Part Only) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |      * - count, offset : (int) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |      * @author SL | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |      * @param $application | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |      * @param $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  |      * @param array $filterParams | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 | 2 |  |     public function getMerchantPayments($application, $token, array $filterParams = []) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 | 2 |  |         return $this->fetchDocument( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 | 2 |  |             '/v4/applications/' . $application . '/merchant-payments', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 | 2 |  |             $token, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 | 2 |  |             'Merchant Payments', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |             $filterParams | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 | 2 |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |      * Add a Merchant Payment to the given application. Amount should be supplied in pence. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |      * @author SL | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |      * @param string $application | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |      * @param \DateTime $effectiveDate | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |      * @param int $amount | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |      * @param string $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 | 2 |  |     public function addMerchantPayment($application, \DateTime $effectiveDate, $amount, $token) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 | 2 |  |         return $this->postDocument( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 | 2 |  |             '/v4/applications/' . $application . '/merchant-payments', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |             [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 | 2 |  |                 'amount' => $amount, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 | 2 |  |                 'effective_date' => $effectiveDate->format('Y-m-d'), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 | 2 |  |             ], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 | 2 |  |             $token, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |             'Add Merchant Payment' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 | 2 |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  |      * @author EB | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |      * @param $installationId | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  |      * @param $application | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  |      * @param $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 | 2 |  |     public function getApplicationCreditInfo($installationId, $application, $token) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 | 2 |  |         return $this->postDocument( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 | 2 |  |             'v4/installations/' . $installationId . '/applications/' . $application . '/get-credit-information', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 | 2 |  |             [], | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 | 2 |  |             $token, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 |  |  |             'Application Credit Information' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 | 2 |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |      * Get application history | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  |      * @author SL | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |      * @param $application | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  |      * @param $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 |  |  |      * @return array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 | 2 |  |     public function getApplicationHistory($application, $token) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 214 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 215 | 2 |  |         return $this->fetchDocument( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 216 | 2 |  |             '/v4/applications/' . $application . '/status-history', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 217 | 2 |  |             $token, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 218 |  |  |             'Application Status History' | 
            
                                                                                                            
                            
            
                                    
            
            
                | 219 | 2 |  |         ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 220 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 221 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 222 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 223 |  |  |      * @author WN | 
            
                                                                                                            
                            
            
                                    
            
            
                | 224 |  |  |      * @param string $action | 
            
                                                                                                            
                            
            
                                    
            
            
                | 225 |  |  |      * @param array $data | 
            
                                                                                                            
                            
            
                                    
            
            
                | 226 |  |  |      * @param string $token | 
            
                                                                                                            
                            
            
                                    
            
            
                | 227 |  |  |      * @return bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 228 |  |  |      * @throws SdkException | 
            
                                                                                                            
                            
            
                                    
            
            
                | 229 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 230 | 4 |  |     private function requestAction($action, $data, $token) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 231 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 232 | 4 |  |         $this->postDocument($action, $data, $token, 'Application'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 233 | 4 |  |         return true; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 234 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 235 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 236 |  |  |  |