Merge pull request #17371 from eileenmcnaughton/too
[civicrm-core.git] / api / v3 / Order.php
index 464dcd427058828abf546d574b188c23390afaf0..99b270ec29755882805bc62f9a2a9e4439f659b0 100644 (file)
@@ -74,7 +74,7 @@ function civicrm_api3_order_create($params) {
   civicrm_api3_verify_one_mandatory($params, NULL, ['line_items', 'total_amount']);
   $entity = NULL;
   $entityIds = [];
-  $contributionStatus = CRM_Utils_Array::value('contribution_status_id', $params);
+  $contributionStatus = $params['contribution_status_id'] ?? NULL;
   if ($contributionStatus !== 'Pending' && 'Pending' !== CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contributionStatus)) {
     CRM_Core_Error::deprecatedFunctionWarning("Creating a Order with a status other than pending is deprecated. Currently empty defaults to 'Completed' so as a transition not passing in 'Pending' is deprecated. You can chain payment creation e.g civicrm_api3('Order', 'create', ['blah' => 'blah', 'contribution_status_id' => 'Pending', 'api.Payment.create => ['total_amount' => 5]]");
   }