New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
currency formatting glitch when paying by check/MO in shop #2328
Comments
I'm not reproducing this -- I have put together something that forces 2 decimal places but it doesn't appear to change the behaviour I'm seeing... Is it still happening? Can I have more detailed steps-to-reproduce? (I don't have the privs to see the support request.) |
I pasted in the text of the support request more or less verbatim - there were no further details given, but I did some digging and can tell you that the user was buying points, if that helps. (I was going to add that the amount of the purchase ended in a zero, but I think that's true for every purchase.) |
…mail As reported some time ago, the "Amount Due" was being shown as e.g. $20.2 instead of $20.20. Future emails will print the amount with the standard number of decimal places. Fixes dreamwidth#2328.
* site configuration misbehavior: turning off shop components It is easily possible to disable the individual sections of the shop that sell icons, points, and rename tokens, but the storefront was not designed to gracefully handle that configuration. In the case of points or icons, the cart would throw a generic error when submitting the form. In the case of rename tokens, the "Add To Order" button would just silently fail. Although it is unlikely DW will ever disable these shop items, let's update the code to be better behaved on general principle. (Unavailable account levels are already handled in a reasonable manner.) This also adds the missing 'icons' key to the example %LJ::SHOP hash. * site configuration misbehavior: turning off the shop entirely Visiting any shop page with the 'payments' config option turned off results in a completely blank page and an error in the logs that says: Argument "The shop is currently disabled." isn't numeric. Looks like this happened because of a misunderstanding about the intended return value of DW::Controller::controller. The relevant code comment says to return "error text" if there was an error, but the error message can't be just a string, it has to be a server response. Perhaps the behavior was later updated in order to allow other possible responses such as redirects. At any rate, the fix is to use error_ml here. The subsequent sysban check obviously has the same problem, so this fixes that as well. * [#2974] enforce minimum amount for check/money order payments Defines a new config parameter $LJ::SHOP_CMO_MINIMUM. If set to a value greater than zero, that value will be the minimum "cash" value required to accept check/money order payments. Fixes #2974. * [#2328] print the currency to 2 decimal places in receipt email As reported some time ago, the "Amount Due" was being shown as e.g. $20.2 instead of $20.20. Future emails will print the amount with the standard number of decimal places. Fixes #2328. * new 'payments_cmo' option for LJ::is_enabled As mentioned in #2974, it's possible that we may need to entirely disable paying by check or money order in the future due to increasing costs. This adds a 'payments_cmo' test to LJ::is_enabled that will make the switch easy to flip if that day comes.
* site configuration misbehavior: turning off shop components It is easily possible to disable the individual sections of the shop that sell icons, points, and rename tokens, but the storefront was not designed to gracefully handle that configuration. In the case of points or icons, the cart would throw a generic error when submitting the form. In the case of rename tokens, the "Add To Order" button would just silently fail. Although it is unlikely DW will ever disable these shop items, let's update the code to be better behaved on general principle. (Unavailable account levels are already handled in a reasonable manner.) This also adds the missing 'icons' key to the example %LJ::SHOP hash. * site configuration misbehavior: turning off the shop entirely Visiting any shop page with the 'payments' config option turned off results in a completely blank page and an error in the logs that says: Argument "The shop is currently disabled." isn't numeric. Looks like this happened because of a misunderstanding about the intended return value of DW::Controller::controller. The relevant code comment says to return "error text" if there was an error, but the error message can't be just a string, it has to be a server response. Perhaps the behavior was later updated in order to allow other possible responses such as redirects. At any rate, the fix is to use error_ml here. The subsequent sysban check obviously has the same problem, so this fixes that as well. * [dreamwidth#2974] enforce minimum amount for check/money order payments Defines a new config parameter $LJ::SHOP_CMO_MINIMUM. If set to a value greater than zero, that value will be the minimum "cash" value required to accept check/money order payments. Fixes dreamwidth#2974. * [dreamwidth#2328] print the currency to 2 decimal places in receipt email As reported some time ago, the "Amount Due" was being shown as e.g. $20.2 instead of $20.20. Future emails will print the amount with the standard number of decimal places. Fixes dreamwidth#2328. * new 'payments_cmo' option for LJ::is_enabled As mentioned in dreamwidth#2974, it's possible that we may need to entirely disable paying by check or money order in the future due to increasing costs. This adds a 'payments_cmo' test to LJ::is_enabled that will make the switch easy to flip if that day comes.
https://www.dreamwidth.org/support/see_request?id=38431
After submitting an order, "Amount Due" is listed as "$XX.X USD" with one place after the decimal point instead of two.
The text was updated successfully, but these errors were encountered: