Closed challengee closed 10 years ago
Go for one selling country for now? And implement multi-country later?
We still need to add VAT percentages somewhere for this.
@mohawke
Get a primary default selling country from Stripe, other selling countries can be added to config?
seems good, as done in #21.
Thinking about it some more, as opposed to what I said on chat, I think we to eager load configuration. If some config call like getting the selling country fail, they would fail on startup and not on the first transaction, which is better I think.
Maybe we can make ConfigurationService
a Singleton (http://www.ruby-doc.org/stdlib-1.9.3/libdoc/singleton/rdoc/Singleton.html). To eager load the configuration we can call ConfigurationService.instance.load
somewhere in the boot sequence.
We can also use the service to automatically enable/disable features based on ENV vars. Like if a segment io key is set, we enable analytics.
With this approach we can also easily stub certain configuration methods. Testing vat calculation would not need a cassette then + we can test it more easily for other countries (ConfigurationService.instance.stubs(:primary_country).returns('NL')
.
@mohawke any thoughts?
green light
Need to finish these ones first: https://github.com/piesync/billbo/issues?milestone=1&page=1&state=open
I think a better approach would be to just create Billbo#configuration=
to set a new configuration (Configuration
). And implement a shortcut Billbo#configure
which initializes a Configuration
and passes it to the given block. We could maybe also implement it like Configuration.new(options = ENV)
.
Go for zero config. Get the selling country from Stripe.