- $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution',
- 'contribution_status_id',
- ['labelColumn' => 'name']
- );
- $contributionStatusID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $this->_contributionId, 'contribution_status_id');
- if ($contributionStatuses[$contributionStatusID] == 'Pending') {
- civicrm_api3('Contribution', 'create',
- [
- 'id' => $this->_contributionId,
- 'contribution_status_id' => array_search('Partially paid', $contributionStatuses),
- 'is_pay_later' => 0,
- ]
- );
- }