class CRM_Contribute_BAO_Contribution_Utils

Methods

static array
processConfirm(CRM_Core_Form $form, array $paymentParams, int $contactID, int $financialTypeID, bool $isTest, bool $isRecur)

Process payment after confirmation.

static bool
isPaymentTransaction(CRM_Core_Form $form)

Is a payment being made.

static array
contributionChartMonthly(int $param)

Get the contribution details by month of the year.

static array
contributionChartYearly()

Get the contribution details by year.

static 
createCMSUser(array $params, int $contactID, $mail)

No description

static bool
_fillCommonParams(array $params, string $type = 'paypal')

No description

static mixed
getFirstLastDetails(int $contactID)

No description

static array
calculateTaxAmount(float $amount, float $taxRate)

Calculate the tax amount based on given tax rate.

static float
formatAmount(float $amount, int $decimals = 2)

Format monetary amount: round and return to desired decimal place CRM-20145

Details

at line 56
static array processConfirm(CRM_Core_Form $form, array $paymentParams, int $contactID, int $financialTypeID, bool $isTest, bool $isRecur)

Process payment after confirmation.

Parameters

CRM_Core_Form $form Form object.
array $paymentParams Array with payment related key. value pairs
int $contactID Contact id.
int $financialTypeID Financial type id.
bool $isTest
bool $isRecur

Return Value

array associated array

Exceptions

CRM_Core_Exception
Exception

at line 234
static protected bool isPaymentTransaction(CRM_Core_Form $form)

Is a payment being made.

Note that setting is_monetary on the form is somewhat legacy and the behaviour around this setting is confusing. It would be preferable to look for the amount only (assuming this cannot refer to payment in goats or other non-monetary currency

Parameters

CRM_Core_Form $form

Return Value

bool

at line 247
static array contributionChartMonthly(int $param)

Get the contribution details by month of the year.

Parameters

int $param Year.

Return Value

array associated array

at line 286
static array contributionChartYearly()

Get the contribution details by year.

Return Value

array associated array

at line 326
static createCMSUser(array $params, int $contactID, $mail)

Parameters

array $params
int $contactID
$mail

at line 349
static bool _fillCommonParams(array $params, string $type = 'paypal')

Parameters

array $params
string $type

Return Value

bool

at line 420
static mixed getFirstLastDetails(int $contactID)

Parameters

int $contactID

Return Value

mixed

at line 476
static array calculateTaxAmount(float $amount, float $taxRate)

Calculate the tax amount based on given tax rate.

Parameters

float $amount Amount of field.
float $taxRate Tax rate of selected financial account for field.

Return Value

array array of tax amount

at line 496
static float formatAmount(float $amount, int $decimals = 2)

Format monetary amount: round and return to desired decimal place CRM-20145

Parameters

float $amount Monetary amount
int $decimals How many decimal places to round to and return

Return Value

float Amount rounded and returned with the desired decimal places