CiviCRM
  1. CiviCRM
  2. CRM-8906

Add Soft Credit details to Contribution APIv3 get method

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.5
    • Fix Version/s: 4.4.0
    • Component/s: CiviCRM API
    • Labels:
      None
    • Is MIH?:
      No
    • Code Sprint:
      Yes

      Description

      This is a follow on from http://issues.civicrm.org/jira/browse/CRM-8662 which I don't think really addressed the problem. It added soft_credit_id to GetFields, but didn't add any support for actually including that data in the return from ContributionGet.
      1. CRM-8662.1.patch
        2 kB
        Tom Kirkpatrick
      2. CRM-8906.patch
        6 kB
        Pradeep Nayak

        Activity

        Hide
        Eileen McNaughton added a comment -
        here's the action-specific tests from event - might be of use

          function testgetfields() {
            $description = "demonstrate use of getfields to interogate api";
            $params = array('version' => 3, 'action' => 'create');
            $result = civicrm_api('event', 'getfields', $params);
            $this->assertEquals(1, $result['values']['title']['api.required'], 'in line ' . __LINE__);
          }
          /*
             * test api_action param also works
             */
          function testgetfieldsRest() {
            $description = "demonstrate use of getfields to interogate api";
            $params = array('version' => 3, 'api_action' => 'create');
            $result = civicrm_api('event', 'getfields', $params);
            $this->assertEquals(1, $result['values']['title']['api.required'], 'in line ' . __LINE__);
          }
          function testgetfieldsGet() {
            $description = "demonstrate use of getfields to interogate api";
            $params = array('version' => 3, 'action' => 'get');
            $result = civicrm_api('event', 'getfields', $params);
            $this->assertEquals('title', $result['values']['event_title']['name'], 'in line ' . __LINE__);
          }
          function testgetfieldsDelete() {
            $description = "demonstrate use of getfields to interogate api";
            $params = array('version' => 3, 'action' => 'delete');
            $result = civicrm_api('event', 'getfields', $params);
            $this->assertEquals(1, $result['values']['id']['api.required']);
          }
        }
        Show
        Eileen McNaughton added a comment - here's the action-specific tests from event - might be of use   function testgetfields() {     $description = "demonstrate use of getfields to interogate api";     $params = array('version' => 3, 'action' => 'create');     $result = civicrm_api('event', 'getfields', $params);     $this->assertEquals(1, $result['values']['title']['api.required'], 'in line ' . __LINE__);   }   /*      * test api_action param also works      */   function testgetfieldsRest() {     $description = "demonstrate use of getfields to interogate api";     $params = array('version' => 3, 'api_action' => 'create');     $result = civicrm_api('event', 'getfields', $params);     $this->assertEquals(1, $result['values']['title']['api.required'], 'in line ' . __LINE__);   }   function testgetfieldsGet() {     $description = "demonstrate use of getfields to interogate api";     $params = array('version' => 3, 'action' => 'get');     $result = civicrm_api('event', 'getfields', $params);     $this->assertEquals('title', $result['values']['event_title']['name'], 'in line ' . __LINE__);   }   function testgetfieldsDelete() {     $description = "demonstrate use of getfields to interogate api";     $params = array('version' => 3, 'action' => 'delete');     $result = civicrm_api('event', 'getfields', $params);     $this->assertEquals(1, $result['values']['id']['api.required']);   } }
        Hide
        Joe Murray added a comment -
        Thanks, Eileen. Nitesh, please adapt as appropriate to the contribution context.
        Show
        Joe Murray added a comment - Thanks, Eileen. Nitesh, please adapt as appropriate to the contribution context.
        Hide
        Pradeep Nayak added a comment -
        Eileen, Joe
        Reviewed and attached the patch CRM-8906.patch.
        Nitesh followed your comments and did changes.
        Show
        Pradeep Nayak added a comment - Eileen, Joe Reviewed and attached the patch CRM-8906 .patch. Nitesh followed your comments and did changes.
        Hide
        Nitesh Pawar added a comment -
        I followed your comments and have submitted patch to Pradeep for review.
        Show
        Nitesh Pawar added a comment - I followed your comments and have submitted patch to Pradeep for review.
        Hide
        Eileen McNaughton added a comment -
        Not sure we ever got a Unit test on this, or that we got quite the right answer (i.e. we were trying to reduce the default fields & make them requestable) but I do feel like the ship has sailed on it
        Show
        Eileen McNaughton added a comment - Not sure we ever got a Unit test on this, or that we got quite the right answer (i.e. we were trying to reduce the default fields & make them requestable) but I do feel like the ship has sailed on it

          People

          • Assignee:
            Eileen McNaughton
            Reporter:
            Tom Kirkpatrick
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 days, 2 hours
              2d 2h

                Development