Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

Commit

Permalink
update settings page to show webhook url
Browse files Browse the repository at this point in the history
  • Loading branch information
webong committed Aug 28, 2019
1 parent bea0587 commit e42c33c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lang/en/enrol_paystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@
$string['charge_description2'] = 'Charge for Course Enrolment Cost.';
$string['paystack_sorry'] = "Sorry, you can not use the script that way.";
$string['webhook'] = 'Paystack Webhook Url';
$string['webhook_desc'] = 'Add this Webhook Url to your paystack account developer settings page here https://dashboard.paystack.com/#/settings/developer';
$string['webhook_desc'] = 'Add this Webhook Url "{$a->webhook}" to your paystack account developer settings page <a href="{$a->url}">here</a>';
24 changes: 10 additions & 14 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,16 @@
/** Paystack live mode enabled.*/
define('LIVE_MODE_ENABLED', 1);

if ($ADMIN->fulltree) {
global $CFG;
global $CFG;

if ($ADMIN->fulltree) {
$webhook = "$CFG->wwwroot/enrol/paystack/webhook.php";
$url = "https://dashboard.paystack.com/#/settings/developer";
$text = '<p>Add this Webhook Url <span style="color:blue; text-decoration:underline;">' . $webhook . '</span> to your paystack account developer settings page <a href="' . $url .'" target="_blank">here</a></p>';
$settings->add(new admin_setting_heading(
'enrol_paystack_enrolname_short',
'',
get_string('pluginname_desc', 'enrol_paystack')
));

$settings->add(new admin_setting_description(
'enrol_paystack/webhook',
get_string('webhook', 'enrol_paystack'),
get_string('webhook_desc', 'enrol_paystack'),
"$CFG->wwwroot/enrol/paystack/webhook.php"
get_string('pluginname_desc', 'enrol_paystack') . " " . $text
));

$options = array(
Expand Down Expand Up @@ -120,10 +116,10 @@
ENROL_EXT_REMOVED_UNENROL => get_string('extremovedunenrol', 'enrol'),
);
$settings->add(new admin_setting_configselect(
'enrol_paystack/expiredaction',
get_string('expiredaction', 'enrol_paystack'),
get_string('expiredaction_help', 'enrol_paystack'),
ENROL_EXT_REMOVED_SUSPENDNOROLES,
'enrol_paystack/expiredaction',
get_string('expiredaction', 'enrol_paystack'),
get_string('expiredaction_help', 'enrol_paystack'),
ENROL_EXT_REMOVED_SUSPENDNOROLES,
$options
));

Expand Down

0 comments on commit e42c33c

Please sign in to comment.