Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-20393

Authorize.net: fix for the "check if the user already submitted this transaction"

    Details

    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      This is not working - because earlier on $authorizeNetFields['x_invoice_num'] has been truncated to 20 digits - so it will never be the same as the the invoice_id stored in CiviCRM:

        // Authorize.Net will not refuse duplicates, so we should check if the user already submitted this transaction                                                                                      
          if ($this->checkDupe($authorizeNetFields['x_invoice_num'], CRM_Utils_Array::value('contributionID', $params))) {
            return self::error(9004, 'It appears that this transaction is a duplicate...');
          }

      Turns out - Authorize.net is perfectly happy receiving invoice_id > 20 digits - it will truncate them itself. iATS Payments used to truncate them - now they are showing full sequence for invoice_id.

      Bottom line: lets send the entire non truncated invoice_id over to Authorize.net:

      • it will be there in full if/when authorize.net decides to retain all digits
      • it will give us a checkDupe that will work

      PR coming for both 4.7 and 4.6

        Attachments

          Activity

            People

            • Assignee:
              KarinG KarinG
              Reporter:
              KarinG KarinG
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: