<commit_before><?php

namespace sokoji\payPalIPN;

use Yii;
use yii\base\Exception;

/**
 * Class PayPalIPN
 *
 * @package sokoji\payPalIPN
 */

/**
 * Class PayPalIPN
 * @package sokoji\payPalIPN
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */
class PayPalIPN
{
    /**
     * @var bool sandbox mode
     */
    public $sandbox = false;

    /**
     * @var string
     */
    private $sandboxUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
    /**
     * @var string
     */
    private $liveUrl = 'https://www.paypal.com/cgi-bin/webscr';

    /**
     * POST data for IPN verify request
     *
     * @var array|null
     */
    private $postData;

    /**
     * @var string
     */
    private $validateQuery = 'cmd=_notify-validate';

    /**
     * Debug mode
     *
     * @var bool
     */
    private $debug = false;

    /**
     * Data from IPN
     *
     * @var array
     */
    private $ipnData = [];


    /**
     * @param bool $sandbox
     * @param bool $debug
     * @param array $config
     * @internal param bool $is_live
     */
    function __construct($sandbox = false, $debug = false, $config = [])
    {
        $this->sandbox = $sandbox;
        $this->debug = $debug;
    }

    /**
     * Checks IPN Request and verify it. Return true if IPN is VERIFIED
     *
     * @return bool
     * @throws Exception<commit_msg>fix phpdoc<commit_after><?php

namespace sokoji\payPalIPN;

use yii;
use yii\base\Exception;

/**
 * Class PayPalIPN
 *
 * @package sokoji\payPalIPN
 */

/**
 * Class PayPalIPN
 * @package sokoji\payPalIPN
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */
class PayPalIPN
{
    /**
     * @var bool sandbox mode
     */
    public $sandbox = false;

    /**
     * @var string
     */
    private $sandboxUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
    /**
     * @var string
     */
    private $liveUrl = 'https://www.paypal.com/cgi-bin/webscr';

    /**
     * POST data for IPN verify request
     *
     * @var array|null
     */
    private $postData;

    /**
     * @var string
     */
    private $validateQuery = 'cmd=_notify-validate';

    /**
     * Debug mode
     *
     * @var bool
     */
    private $debug = false;

    /**
     * Data from IPN
     *
     * @var array
     */
    private $ipnData = [];


    /**
     * @param bool $sandbox — use sandbox mode
     * @param bool $debug   — use debug (log everything into app logfile)
     */
    function __construct($sandbox = false, $debug = false)
    {
        $this->sandbox = $sandbox;
        $this->debug = $debug;
    }

    /**
     * Checks IPN Request and verify it. Return true if IPN is VERIFIED
     *
     * @return bool
     * @throws Exception
{'fraction_non_alphanumeric': 0.1466372657111356, 'fraction_numerical': 0.0, 'mean_word_length': 1.8834745762711864, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, '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': '2428556', 'n_tokens_mistral': 963, 'n_tokens_neox': 923, 'n_words': 220}