user3429948
user3429948

Reputation: 1

different currencies in ci_merchant?

I want to do a webshop, where users pay via paypal. Everything works perfectly, if I use the default currencies. However I want to pay with Hungarian Forint, which is not working.

In the merchant library I have found this:

public static $NUMERIC_CURRENCY_CODES = array(
    'AUD' => '036',
    'CAD' => '124',
    'EUR' => '978',
    'GBP' => '826',
    'NZD' => '554',
    'USD' => '840',
);

So I added a new line: 'HUF' => '348', but regardless when I want to pass the HUF parameter to the CI-Merchant, its not working. Matter of fact, I can change anything in this array, the results will be the same

This is how I pass the parameters:

$params = array(
'amount' => $osszeg,
'currency' => 'HUF',
'return_url' => 'something',
'cancel_url' => 'something');

(paypal supports Hungarian forint, so the problem is not there)

Is there any way to make this work? Thank you very much for your answers in advance.

Upvotes: 0

Views: 191

Answers (1)

Adrian Macneil
Adrian Macneil

Reputation: 13263

Firstly, don't use CI Merchant, it has been unsupported for nearly a year now. Omnipay is its replacement.

If you must use CI Merchant, then the currency parameter is correct. You don't need to add the numeric currency code, since paypal uses standard 3 letter currency codes. It's passed through to paypal here:

https://github.com/expressodev/ci-merchant/blob/master/libraries/merchant/merchant_paypal_base.php#L94

Now since you only say it's 'not working', I don't know what the actual problem is so can't really help diagnose. If there is an error message, what is it? I suspect that the currency is not enabled on your paypal account.

Upvotes: 0

Related Questions