*/
public static function getPaymentProcessors($capabilities = array(), $ids = array()) {
$mode = NULL;
+ $testProcessors = in_array('TestMode', $capabilities) ? self::getAllPaymentProcessors('test') : array();
+ $processors = $liveProcessors = self::getAllPaymentProcessors('live');
+
if (in_array('TestMode', $capabilities)) {
- $mode = 'test';
- }
- elseif (in_array('LiveMode', $capabilities)) {
- $mode = 'live';
+ foreach ($testProcessors as $testProcessor) {
+ if (!in_array($testProcessor['id'], $ids)) {
+ foreach ($liveProcessors as $liveProcessor) {
+ if ($liveProcessor['name'] == $testProcessor['name']) {
+ $ids[] = $testProcessor['id'];
+ }
+ }
+ }
+ }
+ $processors = $testProcessors;
}
- $processors = self::getAllPaymentProcessors($mode);
foreach ($processors as $index => $processor) {
- if (!empty($ids) && !in_array($processor['id'], $ids)) {
+ if (!in_array($processor['id'], $ids)) {
unset ($processors[$index]);
continue;
}