Пример #1
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->signerWmid . $this->payeePurse . $this->paymentNumber);
     } elseif ($this->authType === self::AUTH_MD5) {
         $this->md5 = md5($this->signerWmid . $this->payeePurse . $this->paymentNumber . $this->secretKey);
     }
 }
Пример #2
0
 /**
  * @param Signer $requestSigner
  *
  * @throws ApiException
  */
 public function sign(Signer $requestSigner = null)
 {
     $signString = $this->loginType . $this->integratorId . $this->integratorWmid . $this->resourceId;
     if ($this->loginType == self::LOGIN_TYPE_KEEPER) {
         if ($requestSigner === null) {
             throw new ApiException('This type of login requires the request signer.');
         }
         $this->signature = $requestSigner->sign($signString);
     } else {
         $this->signature = base64_encode(sha1($signString . $this->salt));
     }
 }
Пример #3
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->requestNumber . $this->operationType . $this->userWmid);
     }
 }
Пример #4
0
 /**
  * @param Signer $requestSigner
  *
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->contractId . $this->type);
     }
 }
Пример #5
0
 /**
  * @param Signer $requestSigner
  *
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->transactionId . $this->protectionCode . $this->requestNumber);
     }
 }
Пример #6
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->requestNumber . $this->transactionExternalId . $this->payerPurse . $this->payeePurse . $this->amount . $this->protectionPeriod . $this->protectionCode . $this->description . $this->invoiceId);
     }
 }
Пример #7
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->signerWmid . $this->payeePurse . $this->clientNumber . $this->clientNumberType . $this->smsType);
     }
 }
Пример #8
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->messageRecipientWmid . $this->requestNumber . mb_convert_encoding($this->messageText, 'Windows-1251', 'UTF-8') . mb_convert_encoding($this->messageSubject, 'Windows-1251', 'UTF-8'));
     }
 }
Пример #9
0
 /**
  * @param Signer $requestSigner
  *
  * @throws ApiException
  */
 public function sign(Signer $requestSigner = null)
 {
     $signString = $this->loginType . $this->integratorId . $this->integratorWmid . mb_convert_encoding($this->merchantNameInComment, 'Windows-1251', 'UTF-8') . $this->categoryId;
     if ($this->loginType == self::LOGIN_TYPE_KEEPER) {
         if ($requestSigner === null) {
             throw new ApiException('This type of login requires the request signer.');
         }
         $this->signature = $requestSigner->sign($signString);
     } else {
         $this->signature = base64_encode(sha1($signString . $this->salt));
     }
 }
Пример #10
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->setSignature($requestSigner->sign($this->getSignerWmid() . $this->getCurrency() . $this->getPayeePurse() . $this->getPhone() . $this->getPrice()));
     }
 }
Пример #11
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->setSignature($requestSigner->sign($this->getSignerWmid() . $this->getStartDateTime()->format('Ymd H:i:s') . $this->getEndDateTime()->format('Ymd H:i:s') . $this->getTransactionId()));
     }
 }
Пример #12
0
 /**
  * @param Signer $requestSigner
  *
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->orderId . $this->customerWmid . $this->purse . $this->amount . mb_convert_encoding($this->description, 'Windows-1251', 'UTF-8') . $this->address . $this->protectionPeriod . $this->expiration . $this->requestNumber);
     }
 }
Пример #13
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->signerWmid . $this->requestId . $this->confirmationCode);
     }
 }
Пример #14
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->requestNumber . $this->transactionExternalId . $this->payerPurse . $this->payeePurse . $this->amount . $this->protectionPeriod . $this->protectionCode . mb_convert_encoding($this->description, 'Windows-1251', 'UTF-8') . $this->invoiceId);
     }
 }
Пример #15
0
 /**
  * @param Signer $requestSigner
  *
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->signerWmid . $this->passportWmid);
     }
 }
Пример #16
0
 /**
  * @param Signer $requestSigner
  *
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->signerWmid . mb_strlen($this->contractName, 'UTF-8') . $this->contractType);
     }
 }
Пример #17
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->signerWmid . $this->payeePurse . $this->paymentNumber . $this->validityPeriodInHours);
     } elseif ($this->authType === self::AUTH_SHA256) {
         $this->sha256 = hash('sha256', $this->signerWmid . $this->payeePurse . $this->paymentNumber . $this->validityPeriodInHours . $this->secretKey);
     } elseif ($this->authType === self::AUTH_MD5) {
         $this->md5 = md5($this->signerWmid . $this->payeePurse . $this->paymentNumber . $this->validityPeriodInHours . $this->secretKey);
     }
 }
Пример #18
0
 /**
  * @param Signer $requestSigner
  *
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->signature = $requestSigner->sign($this->purse . $this->requestNumber);
     }
 }
Пример #19
0
 /**
  * @param Signer $requestSigner
  */
 public function sign(Signer $requestSigner = null)
 {
     if ($this->authType === self::AUTH_CLASSIC) {
         $this->setSignature($requestSigner->sign($this->getSignerWmid() . $this->getTransactionId() . $this->getCurrency() . $this->getTest() . $this->getPayeePurse() . $this->getPrice() . $this->getDate()->format('Ymd H:i:s') . $this->getPoint()));
     }
 }