Hello everyone,
payment processors usually take comissions with floating point, 1.5%, 2.9%...
Not sure why Moodle architects used INT so i suggent to change it to FLOAT
/**
|
* This functions adds the settings that are common for all payment gateways.
|
*
|
* @param \admin_settingpage $settings The settings object
|
* @param string $gateway The gateway name prefixed with paygw_
|
*/
|
public static function add_common_gateway_settings(\admin_settingpage $settings, string $gateway): void { |
$settings->add(new \admin_setting_configtext($gateway . '/surcharge', get_string('surcharge', 'core_payment'), |
get_string('surcharge_desc', 'core_payment'), 0, PARAM_INT)); |
}
|
to
/**
|
* This functions adds the settings that are common for all payment gateways.
|
*
|
* @param \admin_settingpage $settings The settings object
|
* @param string $gateway The gateway name prefixed with paygw_
|
*/
|
public static function add_common_gateway_settings(\admin_settingpage $settings, string $gateway): void { |
$settings->add(new \admin_setting_configtext($gateway . '/surcharge', get_string('surcharge', 'core_payment'), |
get_string('surcharge_desc', 'core_payment'), 0, PARAM_FLOAT)); |
}
|
in file: /payment/classed/helper.php
Note from Matt: We should also review the typing across other variables. Whilst triaging I noticed that both cost and amount typings also flicker between strings, floats and text.
- has been marked as being related by
-
MDL-80153 wrong amount field type
- Closed