Author Topic: Force currency?  (Read 718 times)

Offline KenyaWeb

  • Sr. Member
  • ****
  • Posts: 55
    • View Profile
Force currency?
« on: 30/June/2010, 02:13:37 PM »
Hi,

I would like to accept payment in Kenya Shillings and can do this using the Iveri Lite gateway.  I would also like to accept payment via Paypal but they do not accept Kenya Shillings.

In WHMCS is it possible to force currency change depending on the gateway selected by the buyer.

Is this possible in nBill?

Thanks
Get freelance Magento work at www.maglance.com

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Force currency?
« Reply #1 on: 30/June/2010, 03:51:23 PM »
You can do it with a bit of custom code on the 'page submit code' setting on the order form (whichever page contains your gateway selection field). Create a hidden field, name it 'currency', and associate it with the currency order value. Give it a default value of 'KES'. Assuming the field that allows a choice of payment gateway is called 'gateway' and you want to force it to US Dollars if using Paypal, you would use the following code in the page submit code setting:

if (nbf_common::get_param($_POST, 'ctl_gatweay') == 'paypal')
{
  $_POST['ctl_currency'] = 'USD';
  $_REQUEST['ctl_currency'] = 'USD';
}