Skip to content
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

Closed
kareila opened this issue Mar 25, 2018 · 2 comments · Fixed by #3007
Closed

currency formatting glitch when paying by check/MO in shop #2328

kareila opened this issue Mar 25, 2018 · 2 comments · Fixed by #3007

Comments

@kareila
Copy link
Member

kareila commented Mar 25, 2018

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.

@kaberett
Copy link
Contributor

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.)

@kareila
Copy link
Member Author

kareila commented Jul 17, 2018

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.)

@kareila kareila self-assigned this Nov 9, 2022
kareila added a commit to kareila/dreamwidth that referenced this issue Nov 9, 2022
…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.
zorkian pushed a commit that referenced this issue Nov 9, 2022
* 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.
momijizukamori pushed a commit to momijizukamori/dreamwidth that referenced this issue Nov 21, 2022
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants