<commit_before><?php

namespace mPay24;

use DOMDocument;

use mPay24\Responses\PaymentResponse;
use mPay24\Responses\PaymentTokenResponse;
use mPay24\Responses\ManagePaymentResponse;
use mPay24\Responses\TransactionStatusResponse;
use mPay24\Responses\ListPaymentMethodsResponse;

/**
 * Main mPAY24 PHP APIs Class.
 *
 * The MPAY24SDK class provides the communication functioanallity. It hold's all the sensitive data (merchant ID, SOAP password, etc) and
 * build the SOAP request, sent to mPAY24.
 *
 * @author              mPAY24 GmbH <<EMAIL>>
 * @filesource          MPAY24SDK.php
 * @license MIT
 */
class MPAY24SDK
{
    /**
     * An error message, that will be displayed to the user in case you are using the LIVE system
     * @const LIVE_ERROR_MSG
     */
    const LIVE_ERROR_MSG = "We are sorry, an error occured - please contact the merchant!";

    /**
     * @var string
     */
    private $version = "3.0.1";

    /**
     * The link where the requests should be sent to
     *
     * DEFAULT : https://test.mpay24.com/app/bin/etpproxy_v15 (TEST SYSTEM)
     *
     * @var string
     */
    private $etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";

    /**
     * The fix (envelope) part of the soap xml, which is to be sent to mPAY24
     *
     * @var string
     */
    private $soap_xml = "";

    /**
     * The whole soap-xml (envelope and body), which is to be sent to mPAY24 as request
     *
     * @var string
     */
    private $request = "";

    /**
     * The response from mPAY24
     *
     * @var string
     */
    private $response = "";

    /**
     * @var MPay24Config
     */
    private $config;


    public function __construct( MPay24Config &$config = null )
    {
        if ( is_null($config) ){
            $config = new MPay24Config();
        }

        $this->config = $config;
    }

    /**
     * Set the basic (mandatory) settings for the requests
     *
     * @param string $spid
     *          The SPID of your account, supported by mPAY24
     * @param string $password
     *          The flexLINK password, supported by mPAY24
     * @param bool $test
     *          TRUE - when you want to use the TEST system
     *
     *          FALSE - when you want to use the LIVE system
     */
    public function configureFlexLINK( $spid, $password, $test )
    {
        $this->config->setSPid($spid);
        $this->config->setFlexLinkPassword($password);
        $this->config->useFlexLinkTestSystem((bool) $test);
    }

    /**
     * Get the merchant ID, which was set by the function configure(Config $config)
     *
     * @return string
     */
    public function getMerchantID()
    {
        return substr($this->config->getMerchantID(), 1);
    }

    /**
     * Get the SPID, which was set by the function configureFlexLINK($spid, $password, $test)
     *
     * @return string
     */
    public function getSPID()
    {
        return $this->config->getSpid();
    }

    /**
     * Get the system, which should be used for flexLINK (test -> 'test' or live -> 'www')
     *
     * @return string
     */
    public function getFlexLINKSystem()
    {<commit_msg>Missed one str function... removed it<commit_after><?php

namespace mPay24;

use DOMDocument;

use mPay24\Responses\PaymentResponse;
use mPay24\Responses\PaymentTokenResponse;
use mPay24\Responses\ManagePaymentResponse;
use mPay24\Responses\TransactionStatusResponse;
use mPay24\Responses\ListPaymentMethodsResponse;

/**
 * Main mPAY24 PHP APIs Class.
 *
 * The MPAY24SDK class provides the communication functioanallity. It hold's all the sensitive data (merchant ID, SOAP password, etc) and
 * build the SOAP request, sent to mPAY24.
 *
 * @author              mPAY24 GmbH <<EMAIL>>
 * @filesource          MPAY24SDK.php
 * @license MIT
 */
class MPAY24SDK
{
    /**
     * An error message, that will be displayed to the user in case you are using the LIVE system
     * @const LIVE_ERROR_MSG
     */
    const LIVE_ERROR_MSG = "We are sorry, an error occured - please contact the merchant!";

    /**
     * @var string
     */
    private $version = "3.0.1";

    /**
     * The link where the requests should be sent to
     *
     * DEFAULT : https://test.mpay24.com/app/bin/etpproxy_v15 (TEST SYSTEM)
     *
     * @var string
     */
    private $etp_url = "https://test.mpay24.com/app/bin/etpproxy_v15";

    /**
     * The fix (envelope) part of the soap xml, which is to be sent to mPAY24
     *
     * @var string
     */
    private $soap_xml = "";

    /**
     * The whole soap-xml (envelope and body), which is to be sent to mPAY24 as request
     *
     * @var string
     */
    private $request = "";

    /**
     * The response from mPAY24
     *
     * @var string
     */
    private $response = "";

    /**
     * @var MPay24Config
     */
    private $config;


    public function __construct( MPay24Config &$config = null )
    {
        if ( is_null($config) ){
            $config = new MPay24Config();
        }

        $this->config = $config;
    }

    /**
     * Set the basic (mandatory) settings for the requests
     *
     * @param string $spid
     *          The SPID of your account, supported by mPAY24
     * @param string $password
     *          The flexLINK password, supported by mPAY24
     * @param bool $test
     *          TRUE - when you want to use the TEST system
     *
     *          FALSE - when you want to use the LIVE system
     */
    public function configureFlexLINK( $spid, $password, $test )
    {
        $this->config->setSPid($spid);
        $this->config->setFlexLinkPassword($password);
        $this->config->useFlexLinkTestSystem((bool) $test);
    }

    /**
     * Get the merchant ID, which was set by the function configure(Config $config)
     *
     * @return string
     */
    public function getMerchantID()
    {
        return $this->config->getMerchantID();
    }

    /**
     * Get the SPID, which was set by the function configureFlexLINK($spid, $password, $test)
     *
     * @return string
     */
    public function getSPID()
    {
        return $this->config->getSpid();
    }

    /**
     * Get the system, which should be used for flexLINK (test -> 'test' or live -> 'www')
     *
     * @return string
     */
    public function getFlexLINKSystem()
    {
{'fraction_non_alphanumeric': 0.10968457758757331, 'fraction_numerical': 0.01632588365826597, 'mean_word_length': 2.170854271356784, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 33, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3779897', 'n_tokens_mistral': 2036, 'n_tokens_neox': 1938, 'n_words': 586}