protected function send()
    {
        $userAgent = 'mpay24-php/' . self::VERSION;

        $ch = curl_init($this->getEtpURL());
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_USERPWD,
            'u' . $this->config->getMerchantId() . ':' . $this->config->getSoapPassword());
        curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $this->request);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        if ($this->config->isEnableCurlLog()) {
            $fh = fopen($this->getMpay24CurlLogPath(), 'a+') or $this->permissionError();

            curl_setopt($ch, CURLOPT_VERBOSE, 1);
            curl_setopt($ch, CURLOPT_STDERR, $fh);
        }

        try {
            curl_setopt($ch, CURLOPT_CAINFO, $this->config->getCaCertPath() . $this->config->getCaCertFileName());

            if ($this->config->getProxyHost()) {
                curl_setopt($ch, CURLOPT_PROXY, $this->config->getProxyHost() . ':' . $this->config->getProxyPort());

                if ($this->config->getProxyUser()) {
                    curl_setopt($ch, CURLOPT_PROXYUSERPWD,
                        $this->config->getProxyUser() . ':' . $this->config->getProxyPass());
                }

                if ($this->config->isVerifyPeer() !== true) {
                    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->config->isVerifyPeer());
                }
            }

            $this->response = curl_exec($ch);
            curl_close($ch);

        } catch (\Exception $e) {
            if ($this->config->isTestSystem()) {
                $dieMSG = "Your request couldn't be sent because of the following error:" . "\n" . curl_error(
                        $ch
                    ) . "\n" . $e->getMessage() . ' in ' . $e->getFile() . ', line: ' . $e->getLine() . '.';
            } else {
                $dieMSG = self::LIVE_ERROR_MSG;
            }

            echo $dieMSG;
        }

        if (isset($fh) && $this->config->isEnableCurlLog()) {
            fclose($fh);
        }
    }
protected function send()
    {
        $userAgent = 'mpay24-php/' . self::VERSION;

        $ch = curl_init($this->getEtpURL());
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_USERPWD,
            'u' . $this->config->getMerchantId() . ':' . $this->config->getSoapPassword());
        curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $this->request);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        if ($this->config->isEnableCurlLog()) {
            $fh = fopen($this->getMpay24CurlLogPath(), 'a+') or $this->permissionError();

            curl_setopt($ch, CURLOPT_VERBOSE, 1);
            curl_setopt($ch, CURLOPT_STDERR, $fh);
        }

        try {
            curl_setopt($ch, CURLOPT_CAINFO, $this->config->getCaCertPath() . $this->config->getCaCertFileName());

            if ($this->config->getProxyHost()) {
                curl_setopt($ch, CURLOPT_PROXY, $this->config->getProxyHost() . ':' . $this->config->getProxyPort());

                if ($this->config->getProxyUser()) {
                    curl_setopt($ch, CURLOPT_PROXYUSERPWD,
                        $this->config->getProxyUser() . ':' . $this->config->getProxyPass());
                }

                if ($this->config->isVerifyPeer() !== true) {
                    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->config->isVerifyPeer());
                }
            }

            $this->response = curl_exec($ch);
            curl_close($ch);

        } catch (\Exception $e) {
            if ($this->config->isTestSystem()) {
                $dieMSG = "Your request couldn't be sent because of the following error:" . "\n" . curl_error(
                        $ch
                    ) . "\n" . $e->getMessage() . ' in ' . $e->getFile() . ', line: ' . $e->getLine() . '.';
            } else {
                $dieMSG = self::LIVE_ERROR_MSG;
            }

            echo $dieMSG;
        }

        if (isset($fh) && $this->config->isEnableCurlLog()) {
            fclose($fh);
        }
    }
protected function send ( ) { $ userAgent = 'mpay24-php/' . self :: VERSION ; $ ch = curl_init ( $ this -> getEtpURL ( ) ) ; curl_setopt ( $ ch , CURLOPT_HEADER , 0 ) ; curl_setopt ( $ ch , CURLOPT_POST , 1 ) ; curl_setopt ( $ ch , CURLOPT_USERPWD , 'u' . $ this -> config -> getMerchantId ( ) . ':' . $ this -> config -> getSoapPassword ( ) ) ; curl_setopt ( $ ch , CURLOPT_USERAGENT , $ userAgent ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ this -> request ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; if ( $ this -> config -> isEnableCurlLog ( ) ) { $ fh = fopen ( $ this -> getMpay24CurlLogPath ( ) , 'a+' ) or $ this -> permissionError ( ) ; curl_setopt ( $ ch , CURLOPT_VERBOSE , 1 ) ; curl_setopt ( $ ch , CURLOPT_STDERR , $ fh ) ; } try { curl_setopt ( $ ch , CURLOPT_CAINFO , $ this -> config -> getCaCertPath ( ) . $ this -> config -> getCaCertFileName ( ) ) ; if ( $ this -> config -> getProxyHost ( ) ) { curl_setopt ( $ ch , CURLOPT_PROXY , $ this -> config -> getProxyHost ( ) . ':' . $ this -> config -> getProxyPort ( ) ) ; if ( $ this -> config -> getProxyUser ( ) ) { curl_setopt ( $ ch , CURLOPT_PROXYUSERPWD , $ this -> config -> getProxyUser ( ) . ':' . $ this -> config -> getProxyPass ( ) ) ; } if ( $ this -> config -> isVerifyPeer ( ) !== true ) { curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , $ this -> config -> isVerifyPeer ( ) ) ; } } $ this -> response = curl_exec ( $ ch ) ; curl_close ( $ ch ) ; } catch ( \ Exception $ e ) { if ( $ this -> config -> isTestSystem ( ) ) { $ dieMSG = "Your request couldn't be sent because of the following error:" . "\n" . curl_error ( $ ch ) . "\n" . $ e -> getMessage ( ) . ' in ' . $ e -> getFile ( ) . ', line: ' . $ e -> getLine ( ) . '.' ; } else { $ dieMSG = self :: LIVE_ERROR_MSG ; } echo $ dieMSG ; } if ( isset ( $ fh ) && $ this -> config -> isEnableCurlLog ( ) ) { fclose ( $ fh ) ; } }
Create a curl request and send the created SOAP XML
Create a curl request and send the created SOAP XML