Exemple #1
0
 /**
  * @param bool $defaultSum The `OutSum` will set as `DefaultSum`.
  *
  * @return array
  */
 private function getPaymentUrlQueryArray($defaultSum = false)
 {
     if (empty($this->description)) {
         throw new EmptyDescriptionException();
     }
     $params = ['MerchantLogin' => $this->auth->getMerchantLogin(), 'Description' => $this->description, 'SignatureValue' => $this->getPaymentSignatureHash()];
     if ($defaultSum) {
         $params['DefaultSum'] = $this->sum;
     } else {
         $params['OutSum'] = $this->getShopSum();
     }
     if ($this->id) {
         $params['InvId'] = $this->id;
     }
     if ($this->culture) {
         $params['Culture'] = $this->culture;
     }
     if ($this->encoding) {
         $params['Encoding'] = $this->encoding;
     }
     if ($this->email) {
         $params['Email'] = $this->email;
     }
     if ($this->expirationDate) {
         $params['ExpirationDate'] = $this->expirationDate->format('c');
     }
     if ($this->currency) {
         $params['OutSumCurrency'] = $this->currency;
     }
     if ($this->paymentMethod) {
         $params['IncCurrLabel'] = $this->paymentMethod;
     }
     if ($this->auth->isTest()) {
         $params['isTest'] = 1;
     }
     if ($this->customParams) {
         $params += $this->getCustomParamsArray();
     }
     return $params;
 }