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

Гуманизация сообщений в исключениях и money для транзакций #13

Open
dapi opened this issue Aug 28, 2017 · 2 comments

Comments

@dapi
Copy link
Contributor

dapi commented Aug 28, 2017

Коллеги, что скажите на счет такого:

class CloudPayments::Client::ReasonedGatewayError
  def message
    key = self.class.name.split('::').last
    I18n.t key, scope: 'cloud_payments.errors'
  end
end

class CloudPayments::Transaction
  def amount_money
    amount.to_money(currency)
  end
end

Стоит вливать в gem?

@undr
Copy link
Owner

undr commented Oct 18, 2017

Сама идея интересная, но это заставляет использовать i18n и money. Возможно есть способ сделать тоже самое без насилия. Только по обоюдному согласию.

@dapi
Copy link
Contributor Author

dapi commented Dec 6, 2017

Можно оставить в wiki как подсказка

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants