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

AuthorizeNet unit tests are not checking doDirectPayment and cancelSubscription results

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.8
    • Fix Version/s: 4.3.0
    • Component/s: Test suite
    • Labels:
      None

      Description

      Both of the tests in CRM_Core_Payment_AuthorizeNetTest make calls to Authnet for doDirectPayment and then cancelSubscription. However, neither test checks the results of those calls - so in my testing both calls 'failed' (errors below) but the test reports success.

      I trapped these problems by adding debug statements after these calls. I 'think' we may need to randomize some of the parameters passed in to doDirectPayment to avoid the 'duplicate subscription' error. AND I 'think' we need to pass the subscrptionID into cancelSubscription() - which is currently not happening.

      NOTE: There was also a problem w/ line_item table needing to be truncated between the two test methods which was causing the test to report an error if the whole class is run. I've fixed that problem.

      Error from cancelSubscription:
      The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:subscriptionId' element is invalid - The value '' is invalid according to its datatype 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:numericString' - The Pattern constraint failed.<br />

      Error from doDirectPayment:
      You have submitted a duplicate of Subscription 1634141. A duplicate subscription will not be created.

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: