How to create a checkout page in the shops currency

Hi,

I’m having a problem figuring out how to create a checkout page in the shop’s currency:

The shop is placed in Iceland (IS) where the currency is ISK. The customer is placed in Denmark (DK) where the currency is DKK. An invoice has already been issued for the amount of 12000 ISK. I need to customer to be able to pay 12000 ISK.

From the documentation:
country - The two-letter ISO 3166-1 ALPHA-2 code for the country. Uppercase.
currency - Three-letter ISO 4217 code for the currency used in fields that represent monetary amounts. Uppercase.

I expected the country to be the customers country DK and the currency to be the one I what to be paid (ISK)

When I try to start the checkout page this way:

{
   "amount":12000,
   "country":"DK",
   "currency":"ISK"
}

I’m getting an error:

{
   "error_code":"ERROR_HOSTED_PAGE_COUNTRY_CURRENCY_MISMATCH",
   "status":"ERROR",
   "message":"The request tried to create a checkout page, but there is no payment method that is supported in the country for the currency provided. The request was rejected. Corrective action: Use a different currency or country.",
}

I have tried different things, e.g.:

{
"amount":12000,
"country":"DK",
"currency":"DKK",
"requested_currency":"ISK",
"fixed_side":"buy",
"metadata":{"merchant_currency_only":true}
}

But that getting me another error:

{“error_code”:“ERROR_HOSTED_PAGE_COUNTRY_CURRENCY_MISMATCH”,“status”:“ERROR”,“message”:"The request tried to create a checkout page, but there is no payment method that is supported in the country for the currency provided. The request was rejected. Corrective action: Use a different currency or country.}

Have I misunderstood what country to send - is the country the customers or just the primary country for the currency that I want to issue a payment for?

Is it all possible to have a customer pay in another currency than the currency of the customers home country?

I think I have found the hidden currencies - it looks like that there is a difference between sandbox and production regarding what currencies are accepted.

Please see a video of the amazing UX:

@Boris_Jaskerovich @Gabriel_Hatewa @audunnhrafn @ariks @Xi_Li @shivas - might be able to address being able to have a customer pay in another currency than the currency of the customer’s home country?

Hi @onesoft , your founding is correct in terms of which currencies being enabled in sandbox versus the production. On production, we enabled all supported currencies by default, whilst in the sandbox, the currencies enabled there would be: GBP, USD, EUR + the local currency which is defined by the “country” parameter" sent in the payment request.

So in your case, when passing country code DK, in the sandbox, it only has GBP, USD, EUR and DKK enabled. Therefore, when you want to collect ISK, it ended up with an API error.

To resolve this, if you are aiming at creating a checkout page for card payment only, then the country code can be always IS where the legal entity is domiciled as where the shopper is based is less relevant for the card collection. However, if you are looking into card plus alternative payment methods, then indeed passing the shopper country would be the right move and in that case, we can check whether we can add ISK to dk_mastercard_card. So please let us know which is the use case, thanks

2 Likes

Hi @Xi_Li, thanks for your answer.

Our use case is that all we want is a simple payment gateway to handle credit card payments only. The business is placed in Iceland, and the customers can be all over the world. The invoice has already been created at the time of payment, so I can’t just change the currency of the invoice.

In short: what I need is to have a customer in whatever country to pay {invoice amount} ISK with a credit card.
In some situations, the customer can also have the invoice in EUR, USD, SEK or DKK - depending on the customer’s preferences. Again I need the customer to pay the invoice with a credit card in the invoiced currency - no matter what country the customer is using for shipping address: if the customer is living in the US but still want to have the invoice in DKK, I want the customer to be able to pay in DKK.

As all the products are priced in ISK, if the customer has asked to have the invoice in another currency, we have already calculated the currency exchange at the time of invoicing. So we have invoiced the customer ISK 5,920 → SEK 395.36. I need the customer to pay SEK 395.63, even if he is paying 8 days later and the exchange rate has changed.

If all currencies are enabled for “card” in production, as I understand, I can go with:

{
  "amount":{invoice amount},
  "country":"{customer country}",
  "currency":"{invoice currency}"
  "payment_method_type_categories": ["card"]
}

And I’m fine with my current use-case?

Hi @onesoft thanks for providing more context around the use case. For cards only, the country would be IS instead of DK. As your domicile country defines the card payments as mentioned in the first reply. So please give a try by putting the country value as IS.

In addition, please make use the existing API, called: * Create Checkout Page with FX

Please let us know if that works out

Hi @Xi_Li

One problem I have is that I really don’t know what FX is. I have read nearly all the API documentation, and no-ware can I find any definition about what FX is.

" In a payment with FX where fixed_side = buy" :confused:

Hi @Xi_Li

Sending

amount = 235.22,
country = IS,
currency = DKK,
requested_currency = DKK,
fixed_side = buy,
merchant_currency_only = true,

isn’t helping me - getting error: ERROR_CANNOT_SET_FIXED_SIDE_FOR_NON_FX_PAYMENT

only sending

amount = 352.22,
country = IS,
currency = DKK,

is working - I think that’s because on country IS my sandbox have Korta
is_korta_card enabled for all currencies + I can change the card type.

Another concern: if I fix the country to IS and ask a customer in DK to pay with VISA - is that possible to pay with dk_visa_card - when only is_visa_card registred on IS.

sending
amount = 12000,
country = “IS”,
currency = “ISK”,
requested_currency = “DKK”,
fixed_side = “buy”,
merchant_currency_only = true,

is working, except that you calculate the amount in DKK with today’s rate

Hi @onesoft, regarding your questions:

  • FX stands for foreign exchange. And in your use case, that would be DKK/ISK. Before identifying the API, you need to understand the shopper currency and your settlement currency (which is the currency that you will get settled into your bank account). Based on your description, your shopper currency will be DKK and your settlement currency will be ISK, meaning your shoppers can pay in DKK, but you will get ISK in your account.

  • The reason that when sending the following is not working as the requested_currency should be ISK instead of DKK, unless you want to get settled into DKK in your bank account. currency = shopper currency and requested_currency = your settlement currency. In your example, both currency and requested_currency are DKK, which doesn’t indicate a FX payment actually.

amount = 235.22,
country = IS,
currency = DKK,
requested_currency = DKK,
fixed_side = buy,
merchant_currency_only = true,
  • Also, you don’t necessarily to utilize the payment with FX api unless you want to display the fx rate on the frontend to your shopper. if you don’t need to display the FX rate to your shopper, when you are on production, we will need to set up for the currencies pairs which list out a paired shopper currencies and the settlement currencies according to your need. And you only need to use create checkout page API call and identify the shopper currency. In the backend and reconciliation reports, you will see the FX rate which we used to convert.
1 Like

Hi @Xi_Li

Thanks for explaining FX - after reading your response - I have tried:

            amount = 325.25,
            country = "SE",
            currency = "SEK",
            requested_currency = "ISK",
            fixed_side = "sell",
            merchant_currency_only = true,

And that seems to work, and I’m getting the customer’s countries payment methods (se_mastercard_card + se_visa_card and not is_…_card types).

Is this a correct way to do it, or has I misunderstood it again?:

Hi @onesoft, the example you shared works. Just to simply it for cards, you don’t need to change the country according to the shopper country, instead, you can use IS as a fixed value there. This means that underlying payment methods will always call is_visa_card and is_mastercard_card instead of changing per shopper country. For cards, shopper country doesn’t have determine the payment method. You can use one across all. so it will be:
amount = 325.25,
country = “IS”,
currency = “SEK”,
requested_currency = “ISK”,
fixed_side = “sell”,
merchant_currency_only = true,

1 Like