$fieldTypes = NULL
) {
CRM_Core_Payment_Form::mapParams($form->_bltID, $form->_params, $paymentParams, TRUE);
+ $isTest = ($form->_mode == 'test') ? 1 : 0;
+ $lineItems = $form->_lineItem;
$contributionType = new CRM_Financial_DAO_FinancialType();
if (isset($paymentParams['financial_type'])) {
NULL,
$contactID,
$contributionType,
- TRUE, TRUE, TRUE
+ TRUE, TRUE,
+ $isTest,
+ $lineItems
);
if ($contribution) {
NULL,
$contactID,
$contributionType,
- TRUE, TRUE, TRUE
+ TRUE, TRUE,
+ $isTest,
+ $lineItems
);
// restore cached values (part of fix for CRM-14354)
$contribution = CRM_Contribute_Form_Contribution_Confirm::processContribution($form,
$form->_params, $result,
$contactID, $contributionType,
- TRUE, $pending, TRUE
+ $pending, TRUE,
+ $isTest,
+ $lineItems
);
}
$form->postProcessPremium($premiumParams, $contribution);
}
return $_cache[$contactID];
}
+
+ /**
+ * Calculate the tax amount based on given tax rate.
+ *
+ * @param float $amount amount of field.
+ * @param float $taxRate tax rate of selected financial account for field.
+ *
+ * @return array array of tax amount
+ *
+ * @access public
+ * @static
+ *
+ */
+ public static function calculateTaxAmount($amount, $taxRate) {
+ $taxAmount = array();
+ $taxAmount['tax_amount'] = ($taxRate/100) * $amount;
+
+ return $taxAmount;
+ }
}