Example #1
0
 private function download($apiUrl)
 {
     $args = func_get_args();
     $args[0] = $this->context->getToken();
     $this->requestUrl = $this->context->getUrl() . vsprintf($apiUrl, $args);
     return $this->context->getQueue()->download($this->context->getToken(), $this->requestUrl);
 }
Example #2
0
 /**
  * @todo check filesize ??? 2MB in documentation
  * @param string|Pay\Payment\Property $filename
  * @return Pay\IResponse
  * @throws Utils\FioException
  */
 public function send($filename = NULL)
 {
     if ($filename instanceof Pay\Payment\Property) {
         $this->xmlFile->setData($filename);
     }
     if ($this->xmlFile->isReady()) {
         $this->setUploadExtenstion('xml');
         $filename = $this->xmlFile->getPathname();
     } elseif (is_file($filename)) {
         $this->setUploadExtenstion(pathinfo($filename, PATHINFO_EXTENSION));
     } else {
         throw new Utils\FioException('Is supported only filepath or Property object.');
     }
     $post = array('type' => $this->uploadExtension, 'token' => $this->context->getToken(), 'lng' => $this->language);
     return $this->response = $this->context->getQueue()->upload($this->getUrl(), $post, $filename);
 }