Django Multiple Currencies Implementation

162 views
Skip to first unread message

A.Khan

unread,
Aug 7, 2016, 5:47:51 PM8/7/16
to Django users
Hi I am new to Django and I need to implement multiple currency options based on user's preference. What I don't understand that let's say I am in Pakistan and I've used in my template simply

<h3>PKR {{ object.price }} </h3>.

Now I need to understand how would a payment processor will determine what currency I am using for example if I am using above tag and someone needs to pay me with localized currency equaling to my currency amount using Credit Cart or whatever.

Secondly I need to implement multiple currencies that user can select currency option for payment. Can you please tell me the simplest way possible to achieve it.

This is not a necessity at this point but just in case I need to implement a use case that Django provides localized currency automatically if website accessed from a particular location what do I need to do.

I need to implement Braintree and Stripe with Paypal and Credit cards both for testing on two different projects. As I said I am a beginner so not sure if its a qualified question.
Please advise.

Thanks.

Babatunde Akinyanmi

unread,
Aug 7, 2016, 10:02:13 PM8/7/16
to Django users

Hello Khan,
Your payment processor will specify in its API how it determines currency. This is not a django problem. I'm sure the answer to your question lies in the documentation of Stripe and Braintree


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/51b5e211-0b03-4423-b1c2-2b42aaa92ba8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ali khan

unread,
Aug 8, 2016, 2:24:10 AM8/8/16
to django...@googlegroups.com
Thank you Babutunde,
So you are saying that the price = models.DecimalField(max_digits=20, decimal_fields=2) will automatically sense it that what currency it is or if someone wants to pay me in different currency how would a payment processor will change currency value?

Also I need my currency to be localized upon the location of access. For example if my client is in US he should get USD based prices and if someone in Japan he should see Yen. How would I do it?
Regards,
Ali

Mike Dewhirst

unread,
Aug 8, 2016, 2:44:08 AM8/8/16
to django...@googlegroups.com
On 8/08/2016 12:23 PM, Ali khan wrote:
> Thank you Babutunde,
> So you are saying that the price = models.DecimalField(max_digits=20,
> decimal_fields=2) will automatically sense it that what currency it is
> or if someone wants to pay me in different currency how would a payment
> processor will change currency value?
>
> Also I need my currency to be localized upon the location of access. For
> example if my client is in US he should get USD based prices and if
> someone in Japan he should see Yen. How would I do it?

There are two sides to this coin ;)

Your probable ideal solution is to use an account with a bank which will
do all your currency conversions automatically for the bottom twenty
percent of your transactions and keep certain other accounts denominated
in the currencies of the major proportion of your transactions. But
ideal may not be practical. All foreign exchange transactions attract
bank fees.

You will need a price setting mechanism as well. If you set a selling
price in one currency, how will you decide on the exchange rate to use
to calculate the other selling prices?

How frequently will you update your selling prices?

These are both hard questions.

Most larger firms force their customers to buy in a one of a few stable
currencies which normally don't move very quickly against each other.
That lets them take out forward exchange contracts to hedge or lock-in a
given conversion rate at some point in future for a given amount.

A smaller firm would most likely choose just one stable currency and
force all buyers to pay in that currency.

Probably not answering your question but I hope that helps

Mike


> Regards,
> Ali
>
> On Sun, Aug 7, 2016 at 3:01 PM, Babatunde Akinyanmi
> <tunde...@gmail.com <mailto:tunde...@gmail.com>> wrote:
>
> Hello Khan,
> Your payment processor will specify in its API how it determines
> currency. This is not a django problem. I'm sure the answer to your
> question lies in the documentation of Stripe and Braintree
>
>
> On 7 Aug 2016 18:46, "A.Khan" <alipath...@gmail.com
> it, send an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to
> django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/group/django-users>.
> <https://groups.google.com/d/msgid/django-users/51b5e211-0b03-4423-b1c2-2b42aaa92ba8%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BWjgXMBCeVRi0wTSxnv7-ZHcAMCdx8c9cvFNVFQe3dxiP1qjQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BWjgXMBCeVRi0wTSxnv7-ZHcAMCdx8c9cvFNVFQe3dxiP1qjQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAXvsYnd%3D0uePhTn4M5PR1ixi8K3JC%2BcqpyYkkc-AD7qRsxCLg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAXvsYnd%3D0uePhTn4M5PR1ixi8K3JC%2BcqpyYkkc-AD7qRsxCLg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Babatunde Akinyanmi

unread,
Aug 8, 2016, 6:26:52 AM8/8/16
to Django users

Hello Ali,
Mike has given a good analysis of the financials and your database implementation will depend on which option you choose.

I know that's not the most helpful answer in the world but that will help in making good suggestions regarding the problem.

If you ask me, stick to one currency and look for a processor that will allow customers pay for your product by converting the customers' local currency into yours.


        it, send an email to django-users+unsubscribe@googlegroups.com
        <mailto:django-users+unsubscrib...@googlegroups.com>.

        To post to this group, send email to
        django...@googlegroups.com
        <mailto:django-users@googlegroups.com>.

        Visit this group at https://groups.google.com/group/django-users
        <https://groups.google.com/group/django-users>.
        To view this discussion on the web visit
        https://groups.google.com/d/msgid/django-users/51b5e211-0b03-4423-b1c2-2b42aaa92ba8%40googlegroups.com
        <https://groups.google.com/d/msgid/django-users/51b5e211-0b03-4423-b1c2-2b42aaa92ba8%40googlegroups.com?utm_medium=email&utm_source=footer>.
        For more options, visit https://groups.google.com/d/optout
        <https://groups.google.com/d/optout>.

    --
    You received this message because you are subscribed to the Google
    Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it,

    To post to this group, send email to django...@googlegroups.com

    Visit this group at https://groups.google.com/group/django-users
    <https://groups.google.com/group/django-users>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/django-users/CA%2BWjgXMBCeVRi0wTSxnv7-ZHcAMCdx8c9cvFNVFQe3dxiP1qjQ%40mail.gmail.com
    <https://groups.google.com/d/msgid/django-users/CA%2BWjgXMBCeVRi0wTSxnv7-ZHcAMCdx8c9cvFNVFQe3dxiP1qjQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

    For more options, visit https://groups.google.com/d/optout
    <https://groups.google.com/d/optout>.


--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send

To post to this group, send email to django...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.

Ali khan

unread,
Aug 8, 2016, 6:31:50 AM8/8/16
to django...@googlegroups.com
Thank you mike for your kind reply but question was more related to how to setup moneyfield using what available modules. Use case is that a payment processor should be able to determine exchange value for instance if price is listed in Asian currency and someone wants to make payment in USD then payment processor should provide same equal amount to localized currency.

Hope I was able to explain.
Please specify what reusable apps support following:
1. Different currencies in a format that payment api can understand it.
2. Should be connected to some online exchange rate site to get updated price.

Thank you for your interest to address this question and looking forward for your response.

Regards,
Ali

Ali khan

unread,
Aug 8, 2016, 6:33:35 AM8/8/16
to django...@googlegroups.com
Thank you Babatunde,

That is also I am not aware of that which payment processor supports such functions. So if you've implemented any such kind of api please let me know.

Regards,
Ali

Mike Dewhirst

unread,
Aug 8, 2016, 9:07:36 AM8/8/16
to django...@googlegroups.com
On 8/08/2016 4:31 PM, Ali khan wrote:
> Thank you mike for your kind reply but question was more related to how
> to setup moneyfield using what available modules. Use case is that a
> payment processor should be able to determine exchange value for
> instance if price is listed in Asian currency and someone wants to make
> payment in USD then payment processor should provide same equal amount
> to localized currency.
>
> Hope I was able to explain.
> Please specify what reusable apps support following:
> 1. Different currencies in a format that payment api can understand it.
> 2. Should be connected to some online exchange rate site to get updated
> price.

So you want your page to display a price calculated in the customer's
regional currency upon loading the browser page and perhaps
recalculating that price upon page refresh?

Behind the scenes, will you set the actual fixed price in your own
favourite currency?

So you need an API through which your preferred exchange rate site will
provide an up-to-date pair with which to recalculate the selling price
in the other currency. You will of course have to factor in any banking
costs to you for receiving foreign currency and converting to your
preferred currency on the day it is received (not the day the purchase
was made).

You also need to consider the changing laws around the world related to
overseas transactions if the sums involved are substantial.

I don't know of any apps/APIs which do this. But I haven't looked. There
may be some.

Mike

>
> Thank you for your interest to address this question and looking forward
> for your response.
>
> Regards,
> Ali
>
> On Sun, Aug 7, 2016 at 3:01 PM, Babatunde Akinyanmi
> <tunde...@gmail.com <mailto:tunde...@gmail.com>> wrote:
>
> Hello Khan,
> Your payment processor will specify in its API how it determines
> currency. This is not a django problem. I'm sure the answer to your
> question lies in the documentation of Stripe and Braintree
>
>
> On 7 Aug 2016 18:46, "A.Khan" <alipath...@gmail.com
> it, send an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to
> django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/group/django-users>.
> <https://groups.google.com/d/msgid/django-users/51b5e211-0b03-4423-b1c2-2b42aaa92ba8%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/group/django-users>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BWjgXMBCeVRi0wTSxnv7-ZHcAMCdx8c9cvFNVFQe3dxiP1qjQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BWjgXMBCeVRi0wTSxnv7-ZHcAMCdx8c9cvFNVFQe3dxiP1qjQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAXvsYnSm7m7FdAx2iXcFoo2OUQYykG0ucE8xzw%3D8RUY3fVZcA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAAXvsYnSm7m7FdAx2iXcFoo2OUQYykG0ucE8xzw%3D8RUY3fVZcA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages