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

Unclear behavior when competition's currency changes when a payment has been made #1356

Open
viroulep opened this issue Feb 22, 2017 · 1 comment
Labels
CONVERT-TO-PROJECT: payments A "Paymens" project will be created including all the issues with this label. could-be-quick META: good first issue Small/easy change which is a good introduction to working in the WCA repo

Comments

@viroulep
Copy link
Contributor

Just thought about this: I don't think we handle well the case where the organizer or delegate change the currency when a payment has been made!
The refund behavior is well defined since we refund a Stripe charge, however we don't take into account multiple currencies in some part of the website, eg in paid_entry_fees:

  def paid_entry_fees
    Money.new(
      registration_payments.sum(:amount_lowest_denomination),
      # FIXME: see https://github.com/thewca/worldcubeassociation.org/issues/1257
      (competition.currency_code.blank? ? Money.default_currency : competition.currency_code),
    )
  end

Note how we just make a sum, assuming everything is in the same currency.

Suggestion: make the currency immutable as long as anyone has a non zero balance for the competition.

@viroulep viroulep added the CONVERT-TO-PROJECT: payments A "Paymens" project will be created including all the issues with this label. label Feb 22, 2017
@larspetrus
Copy link
Contributor

Yeah, I agree with immutability!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CONVERT-TO-PROJECT: payments A "Paymens" project will be created including all the issues with this label. could-be-quick META: good first issue Small/easy change which is a good introduction to working in the WCA repo
Projects
Status: No status
Status: No status
Development

No branches or pull requests

4 participants