This repository was archived by the owner on May 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Unable to enroll users after successful payments #7
Open
David-OLAJIDE
wants to merge
42
commits into
webong:webhook
Choose a base branch
from
PaystackHQ:master
base: webhook
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
990b4f1
Merge pull request #2 from webong/webhook
webong 0309850
Add files via upload
webong bf66387
Delete Group.png
webong ad86a40
Add files via upload
webong 3e51425
Update README.md
webong 2d4a0d3
Update README.md
webong abb424d
set verify to handle course enrolment too as well as webhook
webong 93bb7e2
update plugin version
webong dccc4b1
update verify script
webong 5b3a25f
Merge pull request #3 from webong/verify
webong 3f7009d
Merge pull request #1 from webong/master
lukman008 e92392d
a
webong 6534d66
update version
webong 8a4573c
update version
webong 853f6d6
r
webong c12041e
paystack.php
webong a99ec51
Merge pull request #2 from webong/master
lukman008 b2f3ef4
minor fix
lukman008 f4764e3
Update paystack.php
lukman008 933c3ed
update plugin settings to add profile fields to be used as custom fie…
webong 0fe24f8
update plugin lang
webong 42f58a2
update lib.php with getting activated custom fields
webong 107aa12
update enrol.html view
webong fc04150
update edit.php
webong fde1569
update plugin version
webong 635786f
Update paystack.php
webong 19f35b9
Merge pull request #3 from webong/patch-1
whales-paystack fbf1d69
hotfix
webong 1579f15
Fix bugs
whales-paystack b74eb79
Add South African Rand currency code (ZAR) to lib
Vladdermouse db903d4
Merge pull request #4 from Vladdermouse/master
lukman-paystack 20be0c2
Added more currencies
Segtel1 cff2281
Merge pull request #6 from Segtel1/master
lukman-paystack 5d2ef26
enrol_paystack_charge_exception_handler defined
OgheneTega 0a4e297
get_exception_handler called in verify.php
OgheneTega 2a88bc8
Merge pull request #7 from OgheneTega/set_exception_handler
lukman-paystack 3d325b9
add support for EGP, KES, and XOF
lukman-paystack f620ac0
add support for EGP, KES, and XOF
lukman-paystack b1acd85
Merge branch 'master' into patch/currency-support
lukman-paystack 48fb370
Merge pull request #8 from PaystackHQ/patch/currency-support
lukman-paystack b5ffc2e
added the $a variable where missing
OgheneTega fe30fc1
Merge pull request #9 from OgheneTega/fix-windows-redirect
lukman-paystack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| <?php | ||
| // This file is part of Moodle - http://moodle.org/ | ||
| // | ||
| // Moodle is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
| // | ||
| // Moodle is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
| // | ||
| // You should have received a copy of the GNU General Public License | ||
| // along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| /** | ||
| * PayPal enrolment plugin utility class. | ||
| * | ||
| * @package enrol_paystack | ||
| * @copyright 2019 Paystack | ||
| * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
| */ | ||
|
|
||
| namespace enrol_paystack; | ||
|
|
||
| defined('MOODLE_INTERNAL') || die(); | ||
|
|
||
| /** | ||
| * Paystack enrolment plugin utility class. | ||
| * | ||
| * @package enrol_paystack | ||
| * @copyright 2019 Paystack | ||
| * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
| */ | ||
| final class util { | ||
|
|
||
| /** | ||
| * Send payment error message to the admin. | ||
| * | ||
| * @param string $subject | ||
| * @param stdClass $data | ||
| */ | ||
| function message_paystack_error_to_admin($subject, $data) | ||
| { | ||
| $admin = get_admin(); | ||
| $site = get_site(); | ||
| $message = "$site->fullname: Transaction failed.\n\n$subject\n\n"; | ||
| foreach ($data as $key => $value) { | ||
| $message .= s($key) . " => " . s($value) . "\n"; | ||
| } | ||
| $eventdata = new \core\message\message(); | ||
| $eventdata->modulename = 'moodle'; | ||
| $eventdata->component = 'enrol_paystack'; | ||
| $eventdata->name = 'paystack_enrolment'; | ||
| $eventdata->userfrom = $admin; | ||
| $eventdata->userto = $admin; | ||
| $eventdata->subject = "PAYSTACK PAYMENT ERROR: " . $subject; | ||
| $eventdata->fullmessage = $message; | ||
| $eventdata->fullmessageformat = FORMAT_PLAIN; | ||
| $eventdata->fullmessagehtml = ''; | ||
| $eventdata->smallmessage = ''; | ||
| message_send($eventdata); | ||
| } | ||
|
|
||
| /** | ||
| * Silent exception handler. | ||
| * | ||
| * @return callable exception handler | ||
| */ | ||
| public static function get_exception_handler() { | ||
| return function($ex) { | ||
| $info = get_exception_info($ex); | ||
|
|
||
| $logerrmsg = "enrol_paystack Webhook exception handler: ".$info->message; | ||
| if (debugging('', DEBUG_NORMAL)) { | ||
| $logerrmsg .= ' Debug: '.$info->debuginfo."\n".format_backtrace($info->backtrace, true); | ||
| } | ||
| error_log($logerrmsg); | ||
|
|
||
| if (http_response_code() == 200) { | ||
| http_response_code(500); | ||
| } | ||
|
|
||
| exit(0); | ||
| }; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After successful payments by users, they were not enrolled for the course,