CRM_Utils_Hook::alterPaymentProcessorParams($this, $params, $requestFields);
// Check to see if we have a duplicate before we send
- if ($this->_checkDupe($params['invoiceID'])) {
+ if ($this->checkDupe($params['invoiceID'], CRM_Utils_Array::value('contributionID', $params))) {
return self::errorExit(9003, 'It appears that this transaction is a duplicate. Have you already submitted the form once? If so there may have been a connection problem. Check your email for a receipt. If you do not receive a receipt within 2 hours you can try your transaction again. If you continue to have problems please contact the site administrator.');
}
}
}
- /**
- * Checks to see if invoice_id already exists in db.
- *
- * @param int $invoiceId
- * The ID to check.
- *
- * @return bool
- * True if ID exists, else false
- */
- public function _checkDupe($invoiceId) {
- $contribution = new CRM_Contribute_DAO_Contribution();
- $contribution->invoice_id = $invoiceId;
- return $contribution->find();
- }
-
/**
* Produces error message and returns from class.
* @param string $errorCode