36 Commits

Author SHA1 Message Date
Jake Dallimore
ffb85e63f7
MDL-79584 core_payment: wait for processPayment promise to resolve
This fixes a regression introduced by MDL-78324 in which the
notification was being called before the promise had resolved. This
change just reverts that.
2023-10-05 12:56:15 +08:00
Jake Dallimore
dc2721083c
MDL-79584 core_payment: load strings in js and pass to template
This template shouldn't really be using string helpers inside string
helpers like it does, and this is unsupported in 4.3. This just moves
the string resolution to js land and then passes that resolved string
into the template instead.
2023-10-05 12:56:14 +08:00
Jake Dallimore
230c2961fc
MDL-79584 core_payment: fix modal content insertion in payment modal
Instead of replacing the body, revert to the desired behavior in which
the payment methods are injected into the body, retaining the desired
markup classes, etc.
2023-10-05 12:50:06 +08:00
Andrew Nicols
48bc688ccd
MDL-78324 core: Convert modals to use new static methods
This commit takes all modals which were not using the legacy
ModalFactory.create triggers and migrates them to the new Modal.create
method.
2023-09-09 00:04:11 +08:00
Andrew Nicols
af7719682d
MDL-79064 core: Update all get_strings as uses 2023-08-29 10:57:54 +08:00
Andrew Nicols
77b4d0236f
MDL-78306 core: Provide helper method to register modals classes 2023-06-14 21:41:49 +08:00
Andrew Nicols
511401f4f6 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Andrew Nicols
33b1e41f13 MDL-75012 js: Full build of all grunt things 2023-03-02 11:55:32 +08:00
Andrew Nicols
e1b9d5f3cd MDL-73915 js: Drop support for IE and android
Moodle announced that support for IE would be dropped back in August
2020 with Moodle 3.9 but not active steps were taken at that time. That
decision was made in MDLSITE-6109 and this particular step was meant to
be taken in Moodle 3.10.

This is the first step taken to actively drop support for IE.

This commit also bumps the browser support pattern from 0.25% to 0.3%.
The percentage here includes any browser where at least this percentage
of users worldwide may be using a browser. In this case it causes
support for Android 4.3-4.4 to be dropped, which relate to Android
KitKat (released 2013).

This combination of changes means that all of the supported browsers in
our compatibility list support modern features including async,
for...of, classes, native Promises, and more which has a huge impact on
the ease of debugging code, and drastically reduces the minified file
size because a number of native Polyfills included by Babel are no
longer included.
2022-02-23 08:55:20 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Paul Holden
e8d7817f7f MDL-72544 output: set default core/toast message type to information.
Update existing code to set type to warning as appropriate.
2021-09-24 08:19:54 +01:00
Andrew Nicols
92179b7057 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Andrew Nicols
70dcc60862 MDL-71113 js: Bare minimum fixes to build jsdoc 2021-06-18 09:38:04 +08:00
Shamim Rezaie
9317849257 MDL-70287 core_payment: Redirect user to the successurl after payment 2021-02-24 22:44:10 +11:00
Shamim Rezaie
0ecce652b1 MDL-69166 core_payment: Use promises instead of callbacks 2020-10-27 15:34:56 +11:00
Shamim Rezaie
f5d94d6305 MDL-69166 core_payment: Addressing various integration points
- Add help for 'payment account' field in the enrol instance form
- Remove MOODLE_INTERNALs when not necessary
- Add $userid to deliver_order
- Check if provider classes implement the provider interface
- Rename get_cost to get_payable
- get_payable returns payable object
- Improve registerEventListeners and added init
- Rename payment\provider to payment\service_provider
2020-10-27 15:34:56 +11:00
Shamim Rezaie
d5a9d6e520 MDL-69166 core_payment: Rename componentid to itemid 2020-10-27 15:34:56 +11:00
Shamim Rezaie
2d7feb7583 MDL-69166 core_payment: Renamed plugintype name from pg to paygw 2020-10-27 15:34:55 +11:00
Marina Glancy
71ccaf200d MDL-69166 core_payment: rename some functions 2020-10-27 15:34:55 +11:00
Shamim Rezaie
61766b3d11 MDL-69166 core_payment: Add paymentarea to the payment subsystem 2020-10-27 14:40:49 +11:00
Shamim Rezaie
73527fa213 MDL-69166 core_payment: Show cost on the modal when no gateway is chosen 2020-10-27 14:40:49 +11:00
Marina Glancy
1d479dc0cf MDL-69166 core_payment: improvements to api, small fixes 2020-10-27 14:40:49 +11:00
Marina Glancy
6ff3087fe6 MDL-69166 core_payment: add payment accounts 2020-10-27 14:40:49 +11:00
Shamim Rezaie
e25eb2c0e1 MDL-69166 core-payment: Autoselect gateway when there is only one 2020-10-27 14:40:49 +11:00
Shamim Rezaie
e3e83185ed MDL-69166 core_payment: payment gateways can have a surcharge 2020-10-27 14:40:47 +11:00
Shamim Rezaie
11b2d9e9ac MDL-69166 core_payment: show cost on the modal 2020-10-27 14:37:29 +11:00
Shamim Rezaie
fd187060ad MDL-69166 core_payment: ES6-ifying modal_gateways 2020-10-27 14:37:28 +11:00
Shamim Rezaie
b23dcc37f2 MDL-69166 core_payment: Use a custom modal type for gateway selector 2020-10-27 14:37:28 +11:00
Shamim Rezaie
9d773ee592 MDL-69166 enrol_fee: use template for payment btn & properly format cost 2020-10-27 14:37:28 +11:00
Shamim Rezaie
ad6df31745 MDL-69166 core_payment: es6-ify 2020-10-27 14:37:28 +11:00
Shamim Rezaie
b5507b8685 MDL-69166 core_payment: add a callback for when payment is done 2020-10-27 14:37:28 +11:00
Shamim Rezaie
8726d77517 MDL-69166 pg_paypal: Display PayPal buttons in a modal 2020-10-27 14:37:28 +11:00
Shamim Rezaie
03f20edbd5 MDL-69166 core_payment: send a purchase description to payment gateways
We truncate description to 127 chars as per PayPal requirement
2020-10-27 14:37:28 +11:00
Shamim Rezaie
8ef156b7dc MDL-69166 core_payment: post to process payment 2020-10-27 08:37:08 +11:00
Shamim Rezaie
e9de430907 MDL-69166 core_payment: display the gateways modal 2020-10-27 08:37:08 +11:00