Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20393 - fix for check if the user already submitted transaction #10147

Merged
merged 1 commit into from
Apr 12, 2017
Merged

CRM-20393 - fix for check if the user already submitted transaction #10147

merged 1 commit into from
Apr 12, 2017

Conversation

KarinG
Copy link
Contributor

@KarinG KarinG commented Apr 12, 2017

No need to truncate x_invoice_num - and without truncating x_invoice_num which is passed into this function as invoiceId - this can actually work now:

  /**
   * Checks to see if invoice_id already exists in db.
   *
   * It's arguable if this belongs in the payment subsystem at all but since several processors implement it
   * it is better to standardise to being here.
   *
   * @param int $invoiceId The ID to check.
   *
   * @param null $contributionID
   *   If a contribution exists pass in the contribution ID.
   *
   * @return bool
   *   True if invoice ID otherwise exists, else false
   */
  protected function checkDupe($invoiceId, $contributionID = NULL) {
    $contribution = new CRM_Contribute_DAO_Contribution();
    $contribution->invoice_id = $invoiceId;
    if ($contributionID) {
      $contribution->whereAdd("id <> $contributionID");
    }
    return $contribution->find();
  }

@eileenmcnaughton
Copy link
Contributor

I think this is a fairly clear-cut of A.net either accepts or doesn't accept > 20 char & if @KarinG has tested it I think we can merge on pass

@eileenmcnaughton eileenmcnaughton merged commit eb3c005 into civicrm:master Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants