public function TransactionIsRepeated($properties)
 {
     RedNaoAddMessage("Checking if transaction is repeated");
     if ($this->_TransactionIsRepeated === NULL) {
         global $wpdb;
         $query = $wpdb->prepare("select count(*) from " . SMART_DONATIONS_TRANSACTION_TABLE . " where txn_id=%s", $properties['txn_id']);
         $this->_TransactionIsRepeated = $wpdb->get_var($query) > 0;
     }
     return $this->_TransactionIsRepeated;
 }
 private function ProcessForm($properties, $formId, $formType, $referenceId, $sFormId)
 {
     $form = get_transient($formId);
     if ($form === false) {
         $form = get_option($formId);
     }
     RedNaoAddMessage("Processing form");
     $splittedFormOptions = explode('rednaosplitter', $form);
     if ($form == false) {
         $this->SendFormError('The submitted form was not found, that means this transaction was processed 3 days after the payment', $properties);
         return;
     }
     if ($formType == 'sf') {
         SmartFormsSaveDonationForm($sFormId, $splittedFormOptions[1], $referenceId);
         return;
     }
     $formElementsValues = explode('&', $splittedFormOptions[1]);
     try {
         $this->SendFormEmail($formElementsValues, $properties, $splittedFormOptions[0]);
     } catch (Exception $e) {
         $this->SendFormError($e->getMessage(), $properties);
     }
 }
 public function ReceiverIsValid($receiverEmail)
 {
     RedNaoAddMessage($receiverEmail);
     global $wpdb;
     $count = $wpdb->get_var($wpdb->prepare("select count(*) from " . SMART_DONATIONS_TABLE_NAME . " where email=%s", $receiverEmail));
     return $count > 0;
 }
 public function ReceiverIsValid($receiverEmail)
 {
     RedNaoAddMessage($receiverEmail);
     global $wpdb;
     $count = $wpdb->get_var($wpdb->prepare("select count(*) from " . SMART_DONATIONS_TABLE_NAME . " where email=%s", $_POST["receiver_email"]));
     if ($count <= 0) {
         $count = $wpdb->get_var($wpdb->prepare("select count(*) from " . SMART_DONATIONS_TABLE_NAME . " where email=%s", $_POST["business"]));
     }
     return $count > 0;
 }