Forum OpenACS Development: ref-currency package

Collapse
Posted by Iuri Sampaio on
Hi there,

I analyzed ref-currency pkg's datamodel and felt it was missing a table to actually storage the currency values.

So far so good, a simple two columns table, currency_code and value, if it wasn't my need to make thing complicated.

Giving more thought on that, I realized that maybe I'd like to storage currency and also keep a historic of values.

Thus I wonder what if the best approach would be to use cr_items and cr_revisions.

However, wouldn't that be too much, like missile to kill a little bird?

Collapse
2: Re: ref-currency package (response to 1)
Posted by Dave Bauer on
Have you looked at ecommerce? What would you store in "value"? ref-currency is just a package that fills in a dropdown to choose a currency. I'd think you'd want something more specialized to handle exchange rates.
Collapse
3: Re: ref-currency package (response to 2)
Posted by Iuri Sampaio on
Thanks Dave.

I did look at ecommerce.

There's nothing there related to currencies. There are Shipping costs and sales taxes though they are realted to business they aren't specifically related to what I'm building.

Prices are tagged in US dollars and that's it. No conversion engines, no rating updates from a WS'es or anything like that.

Torben,
Please, do correct myself if I'm being wrong here.

Yes, I do want something more specialized to handle exchange rates. That's what I am building and I thought ref-currency pkg is a the best place to be: conversion engines, rating updates from a Web services such as ECB http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
with parameter to have control over a few services.

Plus, together with rates history we could build graphics ... Sky's the limit here.

What do you think/suggest?

Collapse
4: Re: ref-currency package (response to 3)
Posted by Torben Brosten on
Hi Iuri,

Yes, ecommerce package has limited use for this.

There is tcl code handling currency conversion on this page:

https://github.com/eggtcl/eggtcl/blob/master/development/ucc.tcl

I haven't tried it, but it appears to connect with a Yahoo API.

cheers,

Collapse
5: Re: ref-currency package (response to 4)
Posted by Antonio Pisano on
I had posted some toughts about this very subject not much time ago, but I can't find any reference in the forum... really, could it have been lost?

Anyway... thumbs up for development on this. In that post I offered myself for analysis and coding, but I won't have time until March, so...

Ah! I have some working code for retrieving exchange rates from the euroforex!

Collapse
6: Re: ref-currency package (response to 5)
Posted by Gustaf Neumann on
Collapse
7: Re: ref-currency package (response to 6)
Posted by Antonio Pisano on
There it is! Thanks!
Collapse
8: Re: ref-currency package (response to 7)
Posted by Iuri Sampaio on
Pisano I'll read your thread.

I couldn't help it and coded a bit.
Here it's html version of it.

It basically consume a xml from ECB http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml

And do conversions. EUR's currency pivot.

1) http://ecommerce.natopia.com/get-exp-price?value=13.10&currency=BRL

2) http://ecommerce.natopia.com/get-exp-price?value=6.20&currency=USD

The object's to build a WS.

Best wishes