Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cached version of payment processor. #12627

Merged
merged 1 commit into from
Aug 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CRM/Financial/BAO/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public static function defaultComparison($processor1, $processor2) {
*/
public static function getAllPaymentProcessors($mode = 'all', $reset = FALSE, $isCurrentDomainOnly = TRUE) {

$cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . $mode . '_' . CRM_Core_Config::domainID();
$cacheKey = 'CRM_Financial_BAO_Payment_Processor_' . $mode . '_' . $isCurrentDomainOnly . '_' . CRM_Core_Config::domainID();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could drop off domain if not current domain only - but I think any benefit from that is negligible & on balance this feels slightly safer

if (!$reset) {
$processors = CRM_Utils_Cache::singleton()->get($cacheKey);
if (!empty($processors)) {
Expand Down Expand Up @@ -370,10 +370,10 @@ public static function getAllPaymentProcessors($mode = 'all', $reset = FALSE, $i
public static function getPaymentProcessors($capabilities = array(), $ids = FALSE) {
$testProcessors = in_array('TestMode', $capabilities) ? self::getAllPaymentProcessors('test') : array();
if (is_array($ids)) {
$processors = self::getAllPaymentProcessors('all', TRUE, FALSE);
$processors = self::getAllPaymentProcessors('all', FALSE, FALSE);
}
else {
$processors = self::getAllPaymentProcessors('all', TRUE);
$processors = self::getAllPaymentProcessors('all');
}

if (in_array('TestMode', $capabilities) && is_array($ids)) {
Expand Down