We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e62c836 + 4cf6773 commit 9065177Copy full SHA for 9065177
api/v3/Contribution.php
@@ -46,6 +46,14 @@ function civicrm_api3_contribution_create(&$params) {
46
_civicrm_api3_custom_format_params($params, $values, 'Contribution');
47
$params = array_merge($params, $values);
48
49
+ if (empty($params['id'])) {
50
+ $op = 'add';
51
+ }
52
+ CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($types, $op);
53
+ if (!in_array($params['financial_type_id'], array_keys($types))) {
54
+ return civicrm_api3_create_error('You do not have permission to create this contribution');
55
56
+
57
if (!empty($params['id']) && !empty($params['contribution_status_id'])) {
58
$error = array();
59
//throw error for invalid status change such as setting completed back to pending
0 commit comments