ISO Country Code from Store's Primary Currency

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hi,

I'm currently creating a new payment module for CardSave in the UK, and one of their requirements is that transactions specify the IS Currency code, e.g., 826 for GBP. As far as I can see, there's no way to figure this out from the store's  primary currency: GBP from the currency table does not tie this back to the country table (which has GBR) and hence you cannot derive the 826 - so this doesn't work:

int currencyISOCode = CountryManager.GetCountryByThreeLetterIsoCode(CurrencyManager.PrimaryStoreCurrency.CurrencyCode).NumericIsoCode;

Is there any way to derive this or do I have to hard-code it for the moment?

Graham
13 years ago
grahamauty wrote:
Hi,

I'm currently creating a new payment module for CardSave in the UK, and one of their requirements is that transactions specify the IS Currency code, e.g., 826 for GBP. As far as I can see, there's no way to figure this out from the store's  primary currency: GBP from the currency table does not tie this back to the country table (which has GBR) and hence you cannot derive the 826 - so this doesn't work:

int currencyISOCode = CountryManager.GetCountryByThreeLetterIsoCode(CurrencyManager.PrimaryStoreCurrency.CurrencyCode).NumericIsoCode;

Is there any way to derive this or do I have to hard-code it for the moment?

Graham


Why do you want to get it from currency code? why don't you just get it from billing address of the user? in the billing address there is country and i suppose you can get this from there?
13 years ago
Hi AtiqUr,

I don't think that will work. The ISO code that's required is the one related to the currency they're being billed in, i.e., the store's primary currency (as I'm not implementing multiple currencies at this point, just GBP). Your suggestion would be fine if all the customers were in the UK, but this may not be the case.

Any other thoughts?
13 years ago
Hi,

I am talking about the billing address. The billing address is always same as the currency you paying in. If someone is in uk his billing address and currency would be uk. if someone is in usa his billing and currency would be in usd.

or is there something else you are doing in your project?
13 years ago
Hi AtiqUr,

I take your point; I think I'll have to question the CardSave people about what they intend to receive in their SOAP message for this field, because their documentation and code examples from their site are not clear; they're all UK based test customers for a start, so the ISO currency/country code is always 826. Consequently, my current understanding is that the field they require is the code for the merchant's currency, GBP=826, not the customer's. If this is not the case, then you're right, I could use the billing address country.

Regards,
Graham
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.