--CRM-16188, reverted back the changes since contribution status id is needed in...
authorPradeep Nayak <pradpnayak@gmail.com>
Fri, 12 Feb 2016 04:31:50 +0000 (10:01 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Tue, 16 Feb 2016 17:04:56 +0000 (22:34 +0530)
api/v3/Order.php

index ff98dec4cc3712678e2490af5b2c6fc87bafc204..008a584189fe390fd6c2d67f5c759000bd125ed5 100644 (file)
@@ -158,7 +158,7 @@ function civicrm_api3_order_delete($params) {
  */
 function civicrm_api3_order_cancel($params) {
   $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
-  $params['contribution_status_id'] = 'Cancelled';
+  $params['contribution_status_id'] = array_search('Cancelled', $contributionStatuses);
   $result = civicrm_api3('Contribution', 'create', $params);
   CRM_Contribute_BAO_Contribution::transitionComponents($params);
   return civicrm_api3_create_success($result['values'], $params, 'Order', 'cancel');