if (isset($paymentParams['financial_type'])) {
$contributionType->id = $paymentParams['financial_type'];
}
- elseif (CRM_Utils_Array::value('pledge_id', $form->_values)) {
+ elseif (!empty($form->_values['pledge_id'])) {
$contributionType->id = CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_Pledge',
$form->_values['pledge_id'],
'financial_type_id'
}
}
elseif ($form->_values['is_monetary'] && $form->_amount > 0.0) {
- if (CRM_Utils_Array::value('is_recur', $paymentParams) &&
+ if (!empty($paymentParams['is_recur']) &&
$form->_contributeMode == 'direct'
) {
if (is_a($result, 'CRM_Core_Error')) {
//make sure to cleanup db for recurring case.
- if (CRM_Utils_Array::value('contributionID', $paymentParams)) {
+ if (!empty($paymentParams['contributionID'])) {
CRM_Contribute_BAO_Contribution::deleteContribution($paymentParams['contributionID']);
}
- if (CRM_Utils_Array::value('contributionRecurID', $paymentParams)) {
+ if (!empty($paymentParams['contributionRecurID'])) {
CRM_Contribute_BAO_ContributionRecur::deleteRecurContribution($paymentParams['contributionRecurID']);
}
// check if pending was set to true by payment processor
$pending = FALSE;
- if (CRM_Utils_Array::value('contribution_status_pending',
- $form->_params
- )) {
+ if (!empty($form->_params
+['contribution_status_pending'])) {
$pending = TRUE;
}
if (!(!empty($paymentParams['is_recur']) && $form->_contributeMode == 'direct')) {
}
$created = TRUE;
- if (CRM_Utils_Array::value('cms_create_account', $params)) {
+ if (!empty($params['cms_create_account'])) {
$params['contactID'] = $contactID;
if (!CRM_Core_BAO_CMSUser::create($params, $mail)) {
CRM_Core_Error::statusBounce(ts('Your profile is not saved and Account is not created.'));
if ($riskInfo['google-order-number']['VALUE'] == $apiParams[2]['google-order-number']['VALUE']) {
foreach ($riskInfo['risk-information']['billing-address'] as $field => $info) {
- if (CRM_Utils_Array::value($field, $mapper['location'])) {
+ if (!empty($mapper['location'][$field])) {
$params['address'][1][$mapper['location'][$field]] = $info['VALUE'];
}
- elseif (CRM_Utils_Array::value($field, $mapper['contact'])) {
+ elseif (!empty($mapper['contact'][$field])) {
if ($newOrder && CRM_Utils_Array::value('structured-name', $newOrder['buyer-billing-address'])) {
foreach ($newOrder['buyer-billing-address']['structured-name'] as $namePart => $nameValue) {
$params[$mapper['contact'][$namePart]] = $nameValue['VALUE'];
$params[$mapper['contact'][$field]] = $info['VALUE'];
}
}
- elseif (CRM_Utils_Array::value($field, $mapper['transaction'])) {
+ elseif (!empty($mapper['transaction'][$field])) {
$transaction[$mapper['transaction'][$field]] = $info['VALUE'];
}
}
}
foreach ($localMapper as $localKey => $localVal) {
- if (CRM_Utils_Array::value($localKey, $mapper['transaction'])) {
+ if (!empty($mapper['transaction'][$localKey])) {
$transaction[$mapper['transaction'][$localKey]] = $localVal;
}
}
$dedupeParams['check_permission'] = FALSE;
$dupeIds = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual');
// if we find more than one contact, use the first one
- if (CRM_Utils_Array::value(0, $dupeIds)) {
+ if (!empty($dupeIds[0])) {
$params['contact_id'] = $dupeIds[0];
}
$contact = CRM_Contact_BAO_Contact::create($params);