Omnipay\Alipay\Common\Signer::setSort PHP Метод

setSort() публичный Метод

public setSort ( boolean $sort ) : Signer
$sort boolean
Результат Signer
    public function setSort($sort)
    {
        $this->sort = $sort;
        return $this;
    }

Usage Example

 protected function verifySignature()
 {
     $signer = new Signer($this->params->all());
     $signer->setSort($this->sort);
     $content = $signer->getContentToSign();
     $sign = $this->params->get('sign');
     $signType = strtoupper($this->params->get('sign_type'));
     if ($signType == 'MD5') {
         if (!$this->getKey()) {
             throw new InvalidRequestException('The `key` is required for `MD5` sign_type');
         }
         $match = (new Signer())->verifyWithMD5($content, $sign, $this->getKey());
     } elseif ($signType == 'RSA') {
         if (!$this->getAlipayPublicKey()) {
             throw new InvalidRequestException('The `alipay_public_key` is required for `RSA` sign_type');
         }
         $match = (new Signer())->verifyWithRSA($content, $sign, $this->getAlipayPublicKey());
     } else {
         throw new InvalidRequestException('The `sign_type` is invalid');
     }
     if (!$match) {
         throw new InvalidRequestException('The signature is not match');
     }
 }
All Usage Examples Of Omnipay\Alipay\Common\Signer::setSort