<commit_before><?php

namespace EasyPayPal;

/**
 * Class IPN
 * @package EasyPayPal
 * @author <NAME>
 */
class IPNHandler {

  /**
   * This is the database Connection
   * @var InterfaceDatabaseConnection
   */
  protected $databaseConnection;

  /**
   * True if the IPN Notification is valid & sent by PayPal.
   * @var bool
   */
  public $isOkay = false;

  public function __construct(InterfaceDatabaseConnection $databaseConnection, $paypalIPNValidation = true) {
    $paypalIPNResponse = $_POST;

    if(!isset($paypalIPNResponse) || empty($paypalIPNResponse))
      exit;

    $this->databaseConnection = $databaseConnection;

    $currentTransaction    = $this->_getTransactionInstance()->get($paypalIPNResponse['custom']);

    $validation = $currentTransaction->getPayPalDestination() . '?cmd=_notify-validate';

    foreach($paypalIPNResponse as $key => $value)
      $validation .= '&' . $key . '=' . $value;
    
    if($paypalIPNValidation)
      $paypalResponse = file_get_contents($validation);
    else
      $paypalResponse = 'VERIFIED';

    if($paypalResponse == 'VERIFIED') {
      if($paypalIPNResponse['receiver_email'] == $currentTransaction->getBusinessPayPalAccount()) {<commit_msg>receiver_email to bussiness<commit_after><?php

namespace EasyPayPal;

/**
 * Class IPN
 * @package EasyPayPal
 * @author <NAME>
 */
class IPNHandler {

  /**
   * This is the database Connection
   * @var InterfaceDatabaseConnection
   */
  protected $databaseConnection;

  /**
   * True if the IPN Notification is valid & sent by PayPal.
   * @var bool
   */
  public $isOkay = false;

  public function __construct(InterfaceDatabaseConnection $databaseConnection, $paypalIPNValidation = true) {
    $paypalIPNResponse = $_POST;

    if(!isset($paypalIPNResponse) || empty($paypalIPNResponse))
      exit;

    $this->databaseConnection = $databaseConnection;

    $currentTransaction    = $this->_getTransactionInstance()->get($paypalIPNResponse['custom']);

    $validation = $currentTransaction->getPayPalDestination() . '?cmd=_notify-validate';

    foreach($paypalIPNResponse as $key => $value)
      $validation .= '&' . $key . '=' . $value;

    if($paypalIPNValidation)
      $paypalResponse = file_get_contents($validation);
    else
      $paypalResponse = 'VERIFIED';

    if($paypalResponse == 'VERIFIED') {
      if($paypalIPNResponse['business'] == $currentTransaction->getBusinessPayPalAccount()) {
{'fraction_non_alphanumeric': 0.1326194398682043, 'fraction_numerical': 0.0, 'mean_word_length': 4.0498960498960495, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3687030', 'n_tokens_mistral': 728, 'n_tokens_neox': 706, 'n_words': 142}