Skip to content

Commit 0ce9b86

Browse files
committed
Removed Credit subplugin
1 parent c6b21dc commit 0ce9b86

File tree

7 files changed

+4
-138
lines changed

7 files changed

+4
-138
lines changed

classes/plugininfo/paymentgateway.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static function sort_gateways_by_order($unsorted) {
9595

9696
foreach ($orderarray as $order => $gatewayname) {
9797
foreach ($unsorted as $key => $gateway) {
98-
if ($gateway->name == $gatewayname) {
98+
if ($gateway->get_name() == $gatewayname) {
9999
$sorted[] = $gateway;
100100
unset($unsorted[$key]);
101101
}

paymentgateway/credit/classes/paymentgateway.php

-36
This file was deleted.

paymentgateway/credit/lang/en/paymentgateway_credit.php

-29
This file was deleted.

paymentgateway/credit/settings.php

-30
This file was deleted.

paymentgateway/credit/version.php

-32
This file was deleted.

settings.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
get_string('gatewaydisableall:text', 'tool_paymentplugin'), '', 0));
5252
if ($category == '') {
5353
foreach ($gateways as $gateway) {
54-
$globalsettings->add(new admin_setting_configcheckbox('paymentgateway_'.$gateway->name.'/enabled',
54+
$globalsettings->add(new admin_setting_configcheckbox('paymentgateway_'.$gateway->get_name().'/enabled',
5555
get_string('gatewayenable:text', 'tool_paymentplugin', $gateway->get_display_name_appended()), '', 0));
5656
}
5757
}

tests/paymentplugin_test.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,13 @@ public function test_course_cost() {
6767
public function test_detectsubplugins() {
6868
$this->resetAfterTest();
6969

70-
$gateways = \tool_paymentplugin\plugininfo\paymentgateway::get_all_gateway_objects();
71-
// Test gateway detection.
72-
$this->assertEquals(2, count($gateways), "The gateway is not detected.");
7370
// Test disabled by default.
7471
$this->assertEquals(0, count(\tool_paymentplugin\plugininfo\paymentgateway::get_all_enabled_gateway_objects()),
7572
"The gateway is not disabled");
7673

7774
// Test enable configs.
7875
set_config('enabled', 1, 'paymentgateway_paypal');
79-
set_config('enabled', 1, 'paymentgateway_credit');
80-
$this->assertEquals(2, count(\tool_paymentplugin\plugininfo\paymentgateway::get_all_enabled_gateway_objects()),
76+
$this->assertEquals(1, count(\tool_paymentplugin\plugininfo\paymentgateway::get_all_enabled_gateway_objects()),
8177
"Configs are not enabled.");
8278

8379
// Test disable all config.
@@ -86,11 +82,8 @@ public function test_detectsubplugins() {
8682
"All configs are not disabled");
8783

8884
set_config('disableall', 0, 'tool_paymentplugin');
89-
$this->assertEquals(2, count(\tool_paymentplugin\plugininfo\paymentgateway::get_all_enabled_gateway_objects()),
85+
$this->assertEquals(1, count(\tool_paymentplugin\plugininfo\paymentgateway::get_all_enabled_gateway_objects()),
9086
"All configs are not disabled");
9187

92-
// Test gateways are not blank.
93-
$this->assertEquals($gateways[0]->name, 'credit', "gateway[credit] name is invaild");
94-
$this->assertEquals($gateways[1]->name, 'paypal', "gateway[name] name is invaild");
9588
}
9689
}

0 commit comments

Comments
 (0)