Closed peterhuppertz closed 3 years ago
I found the problem in enrol.php.
$_SESSION['amount'] = get_stripe_amount($cost, $_SESSION['currency'], false);
is set in the top. The new amount taking the coupon into account is calculated further down and therefore the new amount is not taking into account. I fixed this simply by moving above code down and set the amount value once the costs are calculated correctly.
Cost is saved to session on line 40, then modified on line 126. You can move line 40 to the blank line 129 after the closing curly brace. Refactor should separate logic and presentation. All logic should occur before any presentation.
The modifications suggested at https://github.com/dualcube/moodle-enrol_stripepayment/issues/57 are already included in version 3.2.1 of the module and still not working. The problem is that making the call to validate-coupon.php is as if it did not receive the coupon and returned a 404 error.
Hello @carlosmhpl, We have checked the plugin for the error you mentioned but we couldn't find any such issue. Below we have attached a video for your reference.
Thank you
@carlosmhpl, have you fixed the problem? I'm having the same message.
I can't determine if the coupon function is going to work for Moodle 3.10. Does anyone know?
The deducted amount is displayed fine once I input the coupon code, but the full price is taken by Stripe upon payment.