Example #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);
     }
 }
Example #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));
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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'));
     }
 }
Example #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));
     }
 }
Example #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()));
     }
 }
Example #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()));
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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);
     }
 }
Example #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()));
     }
 }