Pop\Payment\Adapter\PayLeap::send PHP Метод

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

Send transaction
public send ( boolean $verifyPeer = true ) : void
$verifyPeer boolean
Результат void
    public function send($verifyPeer = true)
    {
        if (!$this->validate()) {
            throw new Exception('The required transaction data has not been set.');
        }
        $url = $this->test ? $this->testUrl : $this->liveUrl;
        $url .= '?' . $this->buildQueryString();
        $options = array(CURLOPT_HEADER => false);
        if (!$verifyPeer) {
            $options[CURLOPT_SSL_VERIFYPEER] = false;
        }
        $curl = new Curl($url, $options);
        $this->response = $curl->execute();
        $this->responseCodes = $this->parseResponseCodes();
        $this->responseCode = $this->responseCodes['Result'];
        $this->message = $this->responseCodes['RespMSG'];
        switch ($this->message) {
            case 'Approved':
                $this->approved = true;
                break;
            case 'Declined':
                $this->declined = true;
                break;
        }
        if ($this->responseCode > 0) {
            $this->error = true;
        }
    }