Pop\Payment\Adapter\Authorize::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;
        $options = array(CURLOPT_HEADER => false, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $this->buildPostString());
        if (!$verifyPeer) {
            $options[CURLOPT_SSL_VERIFYPEER] = false;
        }
        $curl = new Curl($url, $options);
        $this->response = $curl->execute();
        $this->responseCodes = explode('|', $this->response);
        $this->responseCode = $this->responseCodes[0];
        $this->responseSubcode = $this->responseCodes[1];
        $this->reasonCode = $this->responseCodes[2];
        $this->message = $this->responseCodes[3];
        switch ($this->responseCode) {
            case 1:
                $this->approved = true;
                break;
            case 2:
                $this->declined = true;
                break;
            case 3:
                $this->error = true;
                break;
        }
    }