Post by sat tv guy » Tue Jun 14, 2016 4:23 pm

Latest Paymentsense Module released and working 100%




Hi,

I have Paymentsense Credit / Debit card Plugin installled on 2 of my websites both are running on OC Version 2.1.0.2

My UK website is working with no issues as the payment currency is GBP and the Paymentsense Module can accomodate that , you can see it working here with my test product https://www.satellitetvshop.co.uk/test- ... earch=test

My problem is with my EU website, here the payment currency is in Euros and the Paymentsense module keeps charging in GBP which as you can imagine is a pain, you can test this yourself on the test product page , cost 1cent https://www.satellitetv.ie/test-product-cc?search=test

I have the latest Paymentsense module installed Module Version: v2.2, Release Date: 6th April 2016

i have gone through the Paymentsense files line by line and I think I have found the issue, the lines of code are pasted below;
$this->load->model('checkout/order');

$country_codes = array(
'Afghanistan'=>'4',
'Albania'=>'8',
'Algeria'=>'12',
'American Samoa'=>'16',
'Andorra'=>'20',
'Angola'=>'24',
'Anguilla'=>'660',
'Antarctica'=>'',
'Antigua and Barbuda'=>'28',
'Argentina'=>'32',
'Armenia'=>'51',
'Aruba'=>'533',
'Australia'=>'36',
'Austria'=>'40',
'Azerbaijan'=>'31',
'Bahamas'=>'44',
'Bahrain'=>'48',
'Bangladesh'=>'50',
'Barbados'=>'52',
'Belarus'=>'112',
'Belgium'=>'56',
'Belize'=>'84',
'Benin'=>'204',
'Bermuda'=>'60',
'Bhutan'=>'64',
'Bolivia'=>'68',
'Bosnia and Herzegowina'=>'70',
'Botswana'=>'72',
'Brazil'=>'76',
'Brunei Darussalam'=>'96',
'Bulgaria'=>'100',
'Burkina Faso'=>'854',
'Burundi'=>'108',
'Cambodia'=>'116',
'Cameroon'=>'120',
'Canada'=>'124',
'Cape Verde'=>'132',
'Cayman Islands'=>'136',
'Central African Republic'=>'140',
'Chad'=>'148',
'Chile'=>'152',
'China'=>'156',
'Colombia'=>'170',
'Comoros'=>'174',
'Congo'=>'178',
'Cook Islands'=>'180',
'Costa Rica'=>'184',
'Cote D\'Ivoire'=>'188',
'Croatia'=>'384',
'Cuba'=>'191',
'Cyprus'=>'192',
'Czech Republic'=>'196',
'Democratic Republic of Congo'=>'203',
'Denmark'=>'208',
'Djibouti'=>'262',
'Dominica'=>'212',
'Dominican Republic'=>'214',
'Ecuador'=>'218',
'Egypt'=>'818',
'El Salvador'=>'222',
'Equatorial Guinea'=>'226',
'Eritrea'=>'232',
'Estonia'=>'233',
'Ethiopia'=>'231',
'Falkland Islands (Malvinas)'=>'238',
'Faroe Islands'=>'234',
'Fiji'=>'242',
'Finland'=>'246',
'France'=>'250',
'French Guiana'=>'254',
'French Polynesia'=>'258',
'French Southern Territories'=>'',
'Gabon'=>'266',
'Gambia'=>'270',
'Georgia'=>'268',
'Germany'=>'276',
'Ghana'=>'288',
'Gibraltar'=>'292',
'Greece'=>'300',
'Greenland'=>'304',
'Grenada'=>'308',
'Guadeloupe'=>'312',
'Guam'=>'316',
'Guatemala'=>'320',
'Guinea'=>'324',
'Guinea-bissau'=>'624',
'Guyana'=>'328',
'Haiti'=>'332',
'Honduras'=>'340',
'Hong Kong'=>'344',
'Hungary'=>'348',
'Iceland'=>'352',
'India'=>'356',
'Indonesia'=>'360',
'Iran (Islamic Republic of)'=>'364',
'Iraq'=>'368',
'Ireland'=>'372',
'Israel'=>'376',
'Italy'=>'380',
'Jamaica'=>'388',
'Japan'=>'392',
'Jordan'=>'400',
'Kazakhstan'=>'398',
'Kenya'=>'404',
'Kiribati'=>'296',
'Korea, Republic of'=>'410',
'Kuwait'=>'414',
'Kyrgyzstan'=>'417',
'Lao People\'s Democratic Republic'=>'418',
'Latvia'=>'428',
'Lebanon'=>'422',
'Lesotho'=>'426',
'Liberia'=>'430',
'Libyan Arab Jamahiriya'=>'434',
'Liechtenstein'=>'438',
'Lithuania'=>'440',
'Luxembourg'=>'442',
'Macau'=>'446',
'Macedonia'=>'807',
'Madagascar'=>'450',
'Malawi'=>'454',
'Malaysia'=>'458',
'Maldives'=>'462',
'Mali'=>'466',
'Malta'=>'470',
'Marshall Islands'=>'584',
'Martinique'=>'474',
'Mauritania'=>'478',
'Mauritius'=>'480',
'Mexico'=>'484',
'Micronesia, Federated States of'=>'583',
'Moldova, Republic of'=>'498',
'Monaco'=>'492',
'Mongolia'=>'496',
'Montserrat'=>'500',
'Morocco'=>'504',
'Mozambique'=>'508',
'Myanmar'=>'104',
'Namibia'=>'516',
'Nauru'=>'520',
'Nepal'=>'524',
'Netherlands'=>'528',
'Netherlands Antilles'=>'530',
'New Caledonia'=>'540',
'New Zealand'=>'554',
'Nicaragua'=>'558',
'Niger'=>'562',
'Nigeria'=>'566',
'Niue'=>'570',
'Norfolk Island'=>'574',
'Northern Mariana Islands'=>'580',
'Norway'=>'578',
'Oman'=>'512',
'Pakistan'=>'586',
'Palau'=>'585',
'Panama'=>'591',
'Papua New Guinea'=>'598',
'Paraguay'=>'600',
'Peru'=>'604',
'Philippines'=>'608',
'Pitcairn'=>'612',
'Poland'=>'616',
'Portugal'=>'620',
'Puerto Rico'=>'630',
'Qatar'=>'634',
'Reunion'=>'638',
'Romania'=>'642',
'Russian Federation'=>'643',
'Rwanda'=>'646',
'Saint Kitts and Nevis'=>'659',
'Saint Lucia'=>'662',
'Saint Vincent and the Grenadines'=>'670',
'Samoa'=>'882',
'San Marino'=>'674',
'Sao Tome and Principe'=>'678',
'Saudi Arabia'=>'682',
'Senegal'=>'686',
'Seychelles'=>'690',
'Sierra Leone'=>'694',
'Singapore'=>'702',
'Slovak Republic'=>'703',
'Slovenia'=>'705',
'Solomon Islands'=>'90',
'Somalia'=>'706',
'South Africa'=>'710',
'Spain'=>'724',
'Sri Lanka'=>'144',
'Sudan'=>'736',
'Suriname'=>'740',
'Svalbard and Jan Mayen Islands'=>'744',
'Swaziland'=>'748',
'Sweden'=>'752',
'Switzerland'=>'756',
'Syrian Arab Republic'=>'760',
'Taiwan'=>'158',
'Tajikistan'=>'762',
'Tanzania, United Republic of'=>'834',
'Thailand'=>'764',
'Togo'=>'768',
'Tokelau'=>'772',
'Tonga'=>'776',
'Trinidad and Tobago'=>'780',
'Tunisia'=>'788',
'Turkey'=>'792',
'Turkmenistan'=>'795',
'Turks and Caicos Islands'=>'796',
'Tuvalu'=>'798',
'Uganda'=>'800',
'Ukraine'=>'804',
'United Arab Emirates'=>'784',
'United Kingdom'=>'826',
'United States'=>'840',
'Uruguay'=>'858',
'Uzbekistan'=>'860',
'Vanuatu'=>'548',
'Vatican City State (Holy See)'=>'336',
'Venezuela'=>'862',
'Viet Nam'=>'704',
'Virgin Islands (British)'=>'92',
'Virgin Islands (U.S.)'=>'850',
'Wallis and Futuna Islands'=>'876',
'Western Sahara'=>'732',
'Yemen'=>'887',
'Zambia'=>'894',
'Zimbabwe'=>'716'
);

$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);

$data = array();

if (in_array($order_info['payment_country'], array_keys($country_codes)))
{
$order_country = $country_codes[$order_info['payment_country']];
}
else
{
$order_country = '';
}

$data['OrderID'] = $this->session->data['order_id'];

$data['MerchantID'] = $this->config->get('paymentsense_direct_mid');
$data['MerchantPassword'] = $this->config->get('paymentsense_direct_pass');

$data['Amount'] = round($order_info['total'],2)*100;
$data['Currency'] = 826;

As you can see Ireland's code is 372 but this is not loaded ? Only 826 for UK GBP is ever loaded so help needed!

You can if you wish download the complete Plugin Module from here http://developers.paymentsense.co.uk/de ... t-plugins/

I am at a loss so all help will be greatly appreciated.

Active Member

Posts

Joined
Wed Oct 12, 2011 12:58 am
Location - london
Who is online

Users browsing this forum: No registered users and 5 guests