Moodle PayPal Enrolment on Payment tosses up a superfluous code string that scares users

156 views Asked by At

I have Enrollment on Payment (through PayPal) working flawlessly, except for one things: when users click the "Select Payment Type" button and the enrol.html popup opens, it has the following string under the PayPal payment button:

{$a->label}: {$a->value}

screenshot showing oddball code

I have searched high and low for any information and have only been able to verify that my integration follows all the instructions. The payments are processed; users receive no error. But that line of code is worrying everyone. I appreciate any and all help.

2

There are 2 answers

1
technicalmuse On

OK. It turns out this is a known bug and they're working on it now: https://tracker.moodle.org/browse/MDL-77003

Thank you again, Russell.

1
Russell England On

Looks like its a core Moodle string labelvalue in /lang/en/moodle.php

$string['labelvalue'] = '{$a->label}: {$a->value}';

Which is being displayed in the fee breakdown via a mustache template in /payment/templates/fee_breakdown.mustache

<div class="core_payment_fee_breakdown">
    {{#surcharge}}
        {{# str }} labelvalue, core, {
            "label": {{# quote }}{{# str }} cost {{/ str }}{{/ quote }},
            "value": {{# quote }}{{# str }} feeincludesurcharge, core_payment, {
                "fee": "{{fee}}",
                "surcharge": {{surcharge}}
                } {{/ str }}{{/ quote }}
            } {{/ str }}
    {{/surcharge}}
    {{^surcharge}}
        {{# str }} labelvalue, core, {
            "label": {{# quote }}{{# str }} cost {{/ str }}{{/ quote }},
            "value": "{{fee}}"
            } {{/ str }}
    {{/surcharge}}
</div>

Which I think is being called by updateCostRegion in /payment/amd/src/gateways_modal.js

Maybe one of the PayPal settings in Moodle has a null value somewhere, so its not being displayed correctly

Check the value for the PayPal surcharge - if its already 0 then click save to make sure the database has been updated with 0 rather than a null

Site admin > Plugins > Payment gateways > Paypal

Or direct to /admin/settings.php?section=paymentgatewaypaypal

If that doesn't fix it, then check the enrol cost for the paypal enrolment plugin

Site admin > Plugins > Enrolments > Paypal

Or direct to /admin/settings.php?section=enrolsettingspaypal

Again, if Enrol cost is already 0 then save changes to make sure

And check the enrol cost for the course

Course menu > Participants > Enrolment methods > Paypal