Modulesgarden_Gpndata - Version 1.2.0

Version Notes

Initial Stable Release

Download this release

Release Info

Developer ModulesGarden
Extension Modulesgarden_Gpndata
Version 1.2.0
Comparing to
See all releases


Version 1.2.0

Files changed (31) hide show
  1. app/code/community/Modulesgarden/Gpndata/Block/Checkout/Cart/Totals.php +50 -0
  2. app/code/community/Modulesgarden/Gpndata/Block/Form/Cc.php +31 -0
  3. app/code/community/Modulesgarden/Gpndata/Block/Redirect.php +79 -0
  4. app/code/community/Modulesgarden/Gpndata/Helper/Data.php +41 -0
  5. app/code/community/Modulesgarden/Gpndata/Model/Gpndata/Map.php +77 -0
  6. app/code/community/Modulesgarden/Gpndata/Model/Notification.php +80 -0
  7. app/code/community/Modulesgarden/Gpndata/Model/Notification/850.php +190 -0
  8. app/code/community/Modulesgarden/Gpndata/Model/Notification/860.php +103 -0
  9. app/code/community/Modulesgarden/Gpndata/Model/Notification/870.php +215 -0
  10. app/code/community/Modulesgarden/Gpndata/Model/Notification/Response.php +44 -0
  11. app/code/community/Modulesgarden/Gpndata/Model/Observer.php +174 -0
  12. app/code/community/Modulesgarden/Gpndata/Model/Payment.php +288 -0
  13. app/code/community/Modulesgarden/Gpndata/Model/Paymentrecurring.php +270 -0
  14. app/code/community/Modulesgarden/Gpndata/Model/Request.php +82 -0
  15. app/code/community/Modulesgarden/Gpndata/Model/Request/700.php +401 -0
  16. app/code/community/Modulesgarden/Gpndata/Model/Request/701.php +78 -0
  17. app/code/community/Modulesgarden/Gpndata/Model/Request/702.php +71 -0
  18. app/code/community/Modulesgarden/Gpndata/Model/Request/705.php +105 -0
  19. app/code/community/Modulesgarden/Gpndata/Model/Request/755.php +93 -0
  20. app/code/community/Modulesgarden/Gpndata/Model/Request/756.php +104 -0
  21. app/code/community/Modulesgarden/Gpndata/Model/Request/760.php +86 -0
  22. app/code/community/Modulesgarden/Gpndata/Model/Response.php +69 -0
  23. app/code/community/Modulesgarden/Gpndata/controllers/NotificationsController.php +128 -0
  24. app/code/community/Modulesgarden/Gpndata/controllers/RedirectController.php +35 -0
  25. app/code/community/Modulesgarden/Gpndata/etc/config.xml +152 -0
  26. app/code/community/Modulesgarden/Gpndata/etc/system.xml +280 -0
  27. app/code/community/Modulesgarden/Gpndata/sql/gpndata_setup/mysql4-install-0.2.0.php +47 -0
  28. app/design/adminhtml/default/default/layout/gpndata.xml +16 -0
  29. app/etc/modules/Modulesgarden_Gpndata.xml +12 -0
  30. app/locale/en_US/Modulesgarden_Gpndata.csv +14 -0
  31. package.xml +22 -0
app/code/community/Modulesgarden/Gpndata/Block/Checkout/Cart/Totals.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-09-02, 07:56:11)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ * Template: frontend/base/default/template/checkout/total/nominal.phtml
28
+ */
29
+ class Modulesgarden_Gpndata_Block_Checkout_Cart_Totals extends Mage_Checkout_Block_Cart_Totals {
30
+
31
+ public function getTotals() {
32
+ if (is_null($this->_totals))
33
+ parent::getTotals();
34
+
35
+ if (Mage::getStoreConfig('payment/gpndatarecurring/hidecheckoutemptytotals')){
36
+ foreach ($this->getQuote()->getAllItems() as $item) {
37
+ if ($item->getProduct()->getIsRecurring()){
38
+ foreach ($this->_totals as $k => $total) {
39
+ if (in_array($total->getCode(), array('subtotal', 'grand_total', 'shipping')))
40
+ unset($this->_totals[$k]);
41
+ }
42
+ }
43
+ // magento allow to have only one recurring product at once in the cart
44
+ break;
45
+ }
46
+ }
47
+ return $this->_totals;
48
+ }
49
+
50
+ }
app/code/community/Modulesgarden/Gpndata/Block/Form/Cc.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-01-24, 15:50:04)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Block_Form_Cc extends Mage_Payment_Block_Form_Cc {
30
+
31
+ }
app/code/community/Modulesgarden/Gpndata/Block/Redirect.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-07, 14:51:04)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Block_Redirect extends Mage_Core_Block_Abstract {
30
+
31
+ protected function _toHtml(){
32
+
33
+ $session= Mage::getSingleton('core/session');
34
+ $ACS = $session->getAcs();
35
+
36
+ $inputs = '';
37
+ foreach ($session->getData() as $k => $value){
38
+ $key = $this->_getValidParamKey($k);
39
+ if ($key){
40
+ $inputs .= '<input type="hidden" name="'.$key.'" value="'.$value.'" />';
41
+ $session->unsetData($k);
42
+ }
43
+ }
44
+
45
+ $html = '
46
+ <!DOCTYPE html>
47
+ <html>
48
+ <head>
49
+ <meta http-equiv="Content-Type" content="text/html; Charset=UTF-8">
50
+ <title>'.$this->__('3D-Secure Payment Transaction').'</title>
51
+ </head>
52
+ <body>
53
+ '.$this->__('You will be redirected to the bank website in a few seconds.').'
54
+ <form method="post" action="'.$ACS.'" id="gpndata_form">
55
+ '.$inputs.'
56
+ <noscript>
57
+ <p>'.$this->__('JavaScript is currently disabled or is not supported by your browser. Please click Submit to continue the processing of your 3D-Secure Payment transaction.').'</p>
58
+ <input type="submit" value="'.$this->__('Submit').'" />
59
+ </noscript>
60
+ </form>
61
+
62
+ <script type="text/javascript">document.getElementById("gpndata_form").submit();</script>
63
+ </body>
64
+ </html>
65
+ ';
66
+
67
+ $session->unsAcs();
68
+
69
+ return $html;
70
+ }
71
+
72
+ protected function _getValidParamKey($key){
73
+ if (substr($key, 0, 7) !== 'gpn3ds_')
74
+ return null;
75
+
76
+ return substr($key, 7);
77
+ }
78
+
79
+ }
app/code/community/Modulesgarden/Gpndata/Helper/Data.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-01-27, 14:14:51)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Helper_Data extends Mage_Core_Helper_Abstract {
30
+
31
+ public function prepare3ds(Modulesgarden_Gpndata_Model_Response $response){
32
+ $session = Mage::getSingleton('core/session');
33
+ $session->setAcs( $response->simpleResponseValue('ACS') );
34
+ if ($response->getXml() && $response->getXml()->parameters){
35
+ foreach ($response->getXml()->parameters->children() as $k => $v){
36
+ $session->setData( 'gpn3ds_' . (string)$k, (string)$v );
37
+ }
38
+ }
39
+ }
40
+
41
+ }
app/code/community/Modulesgarden/Gpndata/Model/Gpndata/Map.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-01-28, 12:39:07)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Model_Gpndata_Map {
30
+
31
+ public static $states = array(
32
+ array('18640','1','West Virginia','WV'),array('18641','1','Virginia','VA'),array('18642','1','Utah','UT'),array('18643','1','Tennessee','TN'),array('18644','1','Pennsylvania','PA'),array('18645','1','North Carolina','NC'),array('18646','1','Minnesota','MN'),array('18647','1','Missouri','MO'),array('18648','1','Montana','MT'),array('18649','1','Nevada','NV'),array('18650','1','New Jersey','NJ'),array('18651','1','New York','NY'),array('18652','1','North Dakota','ND'),array('18653','1','Oklahoma','OK'),array('18654','1','Oregon','OR'),array('18655','1','Alabama','AL'),array('18656','1','Arizona','AZ'),array('18657','1','California','CA'),array('18658','1','Connecticut','CT'),array('18659','1','District of Columbia','DC'),array('18660','1','Georgia','GA'),array('18661','1','Idaho','ID'),array('18662','1','Indiana','IN'),array('18663','1','Iowa','IA'),array('18664','1','Kentucky','KY'),array('18665','1','Maine','ME'),array('18666','1','Massachusetts','MA'),array('18667','1','Rhode Island','RI'),array('18668','1','South Dakota','SD'),array('18669','1','Texas','TX'),array('18670','1','Vermont','VT'),array('18671','1','Washington','WA'),array('18672','1','Wisconsin','WI'),array('18673','1','Wyoming','WY'),array('18674','1','Illinois','IL'),array('18675','1','Kansas','KS'),array('18676','1','Louisiana','LA'),array('18677','1','Maryland','MD'),array('18678','1','Michigan','MI'),array('18679','1','Mississippi','MS'),array('18680','1','Nebraska','NE'),array('18681','1','New Hampshire','NH'),array('18682','1','New Mexico','NM'),array('18683','1','Alaska','AK'),array('18684','1','Arkansas','AR'),array('18685','1','Colorado','CO'),array('18686','1','Delaware','DE'),array('18687','1','Florida','FL'),array('18688','1','Hawaii','HI'),array('18689','1','Ohio','OH'),array('18690','1','South Carolina','SC'),array('19386','1','American Samoa array(see also separate entry under AS)','AS'),array('19388','1','Guam array(see also separate entry under GU)','GU'),array('19390','1','Northern Mariana Islands array(see also separate entry under MP)','MP'),array('19591','1','Puerto Rico array(see also separate entry under PR)','PR'),array('19593','1','Virgin Islands, U.S. array(see also separate entry under VI)','VI'),array('19597','1','United States Minor Outlying Islands array(see also separate entry under UM)','UM'),array('12254','2','Zabol [Zabul]','ZA'),array('12255','2','Oruzgan [Uruzgan]','OR'),array('12256','2','Kondoz [Kunduz]','KD'),array('12257','2','Parwan','PA'),array('12258','2','Sar-e Pol','SA'),array('12259','2','Paktika','PK'),array('12260','2','Lowgar','LO'),array('12261','2','Kapisa','KA'),array('12262','2','Herat','HE'),array('12263','2','Kandahar','KA'),array('12264','2','Samangan','SA'),array('12265','2','Takhar','TA'),array('12266','2','Wardak [Wardag]','WA'),array('12267','2','Badakhshan','BD'),array('12268','2','Baghlan','BG'),array('12269','2','Bamian','BA'),array('12270','2','Faryab','FY'),array('12271','2','Ghazni','GH'),array('12272','2','Badghis','BD'),array('12273','2','Balkh','BA'),array('12274','2','Farah','FR'),array('12275','2','Ghowr','GH'),array('12276','2','Khowst','KH'),array('12277','2','Helmand','HE'),array('12278','2','Kabul [Kabol]','KA'),array('12279','2','Laghman','LA'),array('12280','2','Nangrahar [Nangarhar]','NA'),array('12281','2','Nurestan','NU'),array('12282','2','Paktia','PI'),array('12283','2','Jowzjan','JO'),array('12284','2','Konar [Kunar]','KN'),array('12285','2','Nimruz','NI'),array('20221','2','Daykondi','DA'),array('20222','2','Panjshir','PA'),array('12286','4','Tirane','TR'),array('12287','4','Shkoder','SH'),array('12288','4','Pogradec','PG'),array('12289','4','Mirdite','MR'),array('12290','4','Kolonje','ER'),array('12291','4','Mat','MT'),array('12292','4','Peqin','PQ'),array('12293','4','Permet','PR'),array('12294','4','Puke','PU'),array('12295','4','Sarande','SR'),array('12296','4','Skrapar','SK'),array('12297','4','Tepelene','TE'),array('12298','4','Tropoje','TP'),array('12299','4','Vlore','VL'),array('12300','4','Has','HA'),array('12301','4','Kavaje','KA'),array('12302','4','Korce','KO'),array('12303','4','Kruje','KR'),array('12304','4','Kukes','KU'),array('12305','4','Kurbin','KB'),array('12306','4','Librazhd','LB'),array('12307','4','Lushnje','LU'),array('12308','4','Malesi e Madhe','MM'),array('12309','4','Bulqize','BU'),array('12310','4','Delvine','DL'),array('12311','4','Diber','DI'),array('12312','4','Durres','DR'),array('12313','4','Fier','FR'),array('12314','4','Gjirokaster','GJ'),array('12315','4','Elbasan','EL'),array('12316','4','Berat','BR'),array('12317','4','Devoll','DV'),array('12318','4','Gramsh','GR'),array('12319','4','Kucove','KC'),array('12320','4','Lezhe','LE'),array('12321','4','Mallakaster','MK'),array('12322','5','Ouargla','30'),array('12323','5','El Oued','39'),array('12324','5','Tizi Ouzou','15'),array('12325','5','Tissemsilt','38'),array('12326','5','Sidi Bel Abbes','22'),array('12327','5','Saida','20'),array('12328','5','Naama','45'),array('12329','5','Mila','43'),array('12330','5','Jijel','18'),array('12332','5','Annaba','23'),array('12333','5','Ain Temouchent','46'),array('12334','5','Batna','5'),array('12335','5','Bejaia','6'),array('12336','5','Blida','9'),array('12337','5','Boumerdes','35'),array('12338','5','Relizane','48'),array('12339','5','Khenchela','40'),array('12340','5','Illizi','33'),array('12341','5','Bouira','10'),array('12342','5','Bordj Bou Arreridj','34'),array('12343','5','Ghardaia','47'),array('12344','5','Alger','16'),array('12345','5','Djelfa','17'),array('12346','5','Medea','26'),array('12347','5','Mostaganem','27'),array('12348','5','Constantine','25'),array('12349','5','Skikda','21'),array('12350','5','Laghouat','3'),array('12351','5','Ain Defla','44'),array('12352','5','Bechar','8'),array('12353','5','El Bayadh','32'),array('12354','5','Biskra','7'),array('12355','5','Setif','19'),array('12356','5','Souk Ahras','41'),array('12357','5','El Tarf','36'),array('12358','5','Tebessa','12'),array('12359','5','Tindouf','37'),array('12360','5','Tiaret','14'),array('12361','5','Oum el Bouaghi','4'),array('12362','5','Oran','31'),array('12363','5','Adrar','1'),array('12364','5','Msila','28'),array('12365','5','Mascara','29'),array('12366','5','Guelma','24'),array('12367','5','Chlef','2'),array('12368','5','Tamanghasset','11'),array('12369','5','Tipaza','42'),array('12370','5','Tlemcen','13'),array('12378','7','Sant Julià de Lòria','6'),array('12379','7','Ordino','5'),array('12380','7','Escaldes-Engordany','8'),array('12381','7','Canillo','2'),array('12382','7','Andorra la Vella','7'),array('12383','7','Encamp','3'),array('12384','7','La Massana','4'),array('12385','8','Zaire','ZA'),array('12386','8','Lunda Sul','LS'),array('12387','8','Luanda','LU'),array('12388','8','Cuanza Norte','CN'),array('12389','8','Cunene','CN'),array('12390','8','Bengo','BG'),array('12391','8','Benguela','BG'),array('12392','8','Cabinda','CA'),array('12393','8','Huambo','HU'),array('12394','8','Cuando-Cubango','CC'),array('12395','8','Bie','BI'),array('12396','8','Huila','HU'),array('12397','8','Cuanza Sul','CU'),array('12398','8','Lunda Norte','LN'),array('12399','8','Malange','MA'),array('12400','8','Uige','UI'),array('12401','8','Moxico','MO'),array('12402','8','Namibe','NA'),array('12425','11','Redonda','1.10.2002'),array('12426','11','Barbuda','10'),array('12427','11','Saint George','3'),array('12428','11','Saint Mary','5'),array('12429','11','Saint Paul','6'),array('12430','11','Saint Philip','8'),array('12431','11','Saint Johns','4'),array('12432','11','Saint Peter','7'),array('12433','12','Santiago del Estero','G'),array('12434','12','Santa Cruz','Z'),array('12435','12','Salta','A'),array('12436','12','La Rioja','F'),array('12437','12','Capital federal','C'),array('12438','12','Catamarca','K'),array('12439','12','Buenos Aires','B'),array('12440','12','Chaco','H'),array('12441','12','Cordoba','X'),array('12442','12','Corrientes','W'),array('12443','12','Entre Rios','E'),array('12444','12','Jujuy','Y'),array('12445','12','La Pampa','L'),array('12446','12','Mendoza','M'),array('12447','12','Neuquen','Q'),array('12448','12','Rio Negro','R'),array('12449','12','San Juan','J'),array('12450','12','San Luis','D'),array('12451','12','Santa Fe','S'),array('12452','12','Tierra del Fuego','V'),array('12453','12','Tucuman','T'),array('12454','12','Chubut','U'),array('12455','12','Formosa','P'),array('12456','12','Misiones','N'),array('12457','13','Tavus','TV'),array('12458','13','Vayoc Jor','VD'),array('12459','13','sirak','SH'),array('12460','13','Gegarkunik','GR'),array('12461','13','Ararat','AR'),array('12462','13','Kotayk','KT'),array('12463','13','Syunik','SU'),array('12464','13','Erevan','ER'),array('12465','13','Loy','LO'),array('12466','13','Aragacotn','AG'),array('12467','13','Armavir','AV'),array('12470','15','Western Australia','WA'),array('12471','15','Australian Capital Territory','AC'),array('12472','15','South Australia','SA'),array('12473','15','Victoria','VI'),array('12474','15','Tasmania','TA'),array('12475','15','Northern Territory','NT'),array('12476','15','Queensland','QL'),array('12477','15','New South Wales','NS'),array('12478','16','Wien','9'),array('12479','16','Salzburg','5'),array('12480','16','Burgenland','1'),array('12481','16','Karnten','2'),array('12482','16','Oberosterreich','4'),array('12483','16','Steiermark','6'),array('12484','16','Vorarlberg','8'),array('12485','16','Niederosterreich','3'),array('12486','16','Tirol','7'),array('12487','17','Zangilan','ZA'),array('12488','17','Yardimli','YA'),array('12489','17','Xocali','XC'),array('12490','17','Xankandi','XA'),array('12491','17','Sumqayit','SM'),array('12492','17','Samux','SM'),array('12493','17','Agstafa','AG'),array('12494','17','Babak','BA'),array('12495','17','Barda','BA'),array('12496','17','Cabrayil','CA'),array('12497','17','Daskasan','DA'),array('12498','17','ali Bayramli','AB'),array('12499','17','Ganca','GA'),array('12500','17','Haciqabul','HA'),array('12501','17','Ismayilli','IS'),array('12502','17','Sahbuz','SA'),array('12503','17','Samaxi','SM'),array('12504','17','Sadarak','SA'),array('12505','17','Saki','SA'),array('12506','17','Sarur','SA'),array('12507','17','Siyazan','SI'),array('12508','17','Susa','SU'),array('12509','17','Tartar','TA'),array('12510','17','Ucar','UC'),array('12512','17','Goranboy','GO'),array('12513','17','Goycay','GO'),array('12514','17','Imisli','IM'),array('12515','17','Kalbacar','KA'),array('12516','17','Kurdamir','KU'),array('12517','17','Lankaran','LA'),array('12518','17','Lerik','LE'),array('12519','17','Mingacevir','MI'),array('12520','17','Naftalan','NA'),array('12521','17','Abseron','AB'),array('12522','17','Agcabadi','AG'),array('12523','17','Agdas','AG'),array('12524','17','Agsu','AG'),array('12525','17','Astara','AS'),array('12526','17','Baki','BA'),array('12527','17','Balakan','BA'),array('12528','17','Beylaqan','BE'),array('12529','17','Bilasuvar','BI'),array('12530','17','Calilabab','CA'),array('12531','17','Culfa','CU'),array('12532','17','Davaci','DA'),array('12533','17','Fuzuli','FU'),array('12534','17','Gadabay','GA'),array('12535','17','Neftcala','NE'),array('12536','17','Ordubad','OR'),array('12537','17','Qax','QA'),array('12538','17','Qabala','QA'),array('12539','17','Qobustan','QO'),array('12540','17','Qubadli','QB'),array('12541','17','Qusar','QU'),array('12542','17','Sabirabad','SA'),array('12543','17','Xacmaz','XA'),array('12544','17','Xanlar','XA'),array('12545','17','Xizi','XI'),array('12546','17','Xocavand','XV'),array('12547','17','Yevlax','YE'),array('12548','17','Zaqatala','ZA'),array('12549','17','Zardab','ZA'),array('12550','17','Agdam','AG'),array('12551','17','Lacin','LA'),array('12552','17','Masalli','MA'),array('12553','17','Naxcivan','NX'),array('12554','17','Oguz','OG'),array('12555','17','Qazax','QA'),array('12556','17','Quba','QB'),array('12557','17','Saatli','SA'),array('12558','17','Salyan','SA'),array('12559','17','Samkir','SK'),array('12560','17','Tovuz','TO'),array('20104','17','Lankaran City','LA'),array('20105','17','Saki City','SA'),array('20106','17','Susa City','SS'),array('20107','17','Yevlax City','YE'),array('12563','18','New Providence','NP'),array('12564','18','Mayaguana','MG'),array('12565','18','Inagua','IN'),array('12566','18','Freeport','FP'),array('12567','18','Acklins and Crooked Islands','AC'),array('12568','18','Ragged Island','RI'),array('12569','18','San Salvador and Rum Cay','SR'),array('12571','18','Green Turtle Cay','GT'),array('12572','18','Fresh Creek','FC'),array('12573','18','Nicholls Town and Berry Islands','NB'),array('12574','18','Bimini','BI'),array('12575','18','Cat Island','CI'),array('12577','18','Governors Harbour','GH'),array('12578','18','Exuma','EX'),array('12579','18','Harbour Island','HI'),array('12580','18','Long Island','LI'),array('20112','18','High Rock','HR'),array('20113','18','Kemps Bay','KB'),array('20114','18','Marsh Harbour','MH'),array('20115','18','Rock Sound','RS'),array('20116','18','Sandy Point','SP'),array('12581','19','Al Wusta','16'),array('12582','19','Ash Shamaliyah','17'),array('12583','19','Al Muharraq','15'),array('12589','19','Al Manamah array(Al Asimah)','13'),array('12592','19','Al Janubiyah','14'),array('12593','20','Tangail zila','63'),array('12594','20','Sirajganj zila','59'),array('12595','20','Sherpur zila','57'),array('12596','20','Rajshahi zila','54'),array('12597','20','Panchagarh zila','52'),array('12598','20','Nawabganj zila','45'),array('12599','20','Narayanganj zila','40'),array('12600','20','Bagerhat zila','5'),array('12601','20','Bandarban zila','1'),array('12602','20','Barguna zila','2'),array('12603','20','Jessore zila','22'),array('12604','20','Jhenaidah zila','23'),array('12605','20','Kishoreganj zila','26'),array('12606','20','Comilla zila','8'),array('12607','20','Kushtia zila','30'),array('12608','20','Lalmonirhat zila','32'),array('12609','20','Magura zila','37'),array('12610','20','Manikganj zila','33'),array('12611','20','Meherpur zila','39'),array('12612','20','Barisal zila','6'),array('12613','20','Bhola zila','7'),array('12614','20','Bogra zila','3'),array('12615','20','Chandpur zila','9'),array('12616','20','Dhaka zila','13'),array('12617','20','Faridpur zila','15'),array('12618','20','Feni zila','16'),array('12619','20','Gopalganj zila','17'),array('12620','20','Jaipurhat zila','24'),array('12621','20','Mymensingh zila','34'),array('12622','20','Moulvibazar zila','38'),array('12623','20','Munshiganj zila','35'),array('12624','20','Narail zila','43'),array('12625','20','Narsingdi zila','42'),array('12626','20','Naogaon zila','48'),array('12627','20','Netrakona zila','41'),array('12628','20','Noakhali zila','47'),array('12629','20','Pabna zila','49'),array('12630','20','Brahmanbaria zila','4'),array('12631','20','Chittagong zila','10'),array('12632','20','Chuadanga zila','12'),array('12633','20','Dinajpur zila','14'),array('12634','20','Gaibandha zila','19'),array('12635','20','Gazipur zila','18'),array('12636','20','Habiganj zila','20'),array('12637','20','Jamalpur zila','21'),array('12638','20','Jhalakati zila','25'),array('12639','20','Khagrachari zila','29'),array('12640','20','Khulna zila','27'),array('12641','20','Coxs Bazar zila','11'),array('12642','20','Kurigram zila','28'),array('12643','20','Lakshmipur zila','31'),array('12644','20','Madaripur zila','36'),array('12645','20','Patuakhali zila','51'),array('12646','20','Rajbari zila','53'),array('12647','20','Rangamati zila','56'),array('12648','20','Rangpur zila','55'),array('12649','20','Shariatpur zila','62'),array('12650','20','Sylhet zila','60'),array('12651','20','Sunamganj zila','61'),array('12652','20','Thakurgaon zila','64'),array('12653','20','Natore zila','44'),array('12654','20','Nilphamari zila','46'),array('12655','20','Pirojpur zila','50'),array('12656','20','Satkhira zila','58'),array('12657','21','Saint Thomas','11'),array('12658','21','Saint Michael','8'),array('12659','21','Saint Joseph','6'),array('12660','21','Saint James','4'),array('12661','21','Christ Church','1'),array('12662','21','Saint George','3'),array('12663','21','Saint Andrew','2'),array('12664','21','Saint John','5'),array('12665','21','Saint Lucy','7'),array('12666','21','Saint Peter','9'),array('12667','21','Saint Philip','10'),array('12668','22','Vitsyebskaya voblasts array(be) Vitebskaya oblast array(ru)','VI'),array('12669','22','Brestskaya voblasts array(be) Brestskaya oblast array(ru)','BR'),array('12670','22','Homyelskaya voblasts array(be) Gomelskaya oblast array(ru)','HO'),array('12671','22','Mahilyowskaya voblasts array(be) Mogilevskaya oblast array(ru)','MA'),array('12672','22','Hrodzenskaya voblasts array(be) Grodnenskaya oblast array(ru)','HR'),array('12673','22','Minskaya voblasts array(be) Minskaya oblast array(ru)','MI'),array('12674','22','Horad Minsk','1.10.2001'),array('12675','23','Vlaams Brabant array(nl)','VB'),array('12676','23','Luxembourg array(fr)','WL'),array('12677','23','Oost-Vlaanderen array(nl)','VO'),array('12678','23','Hainaut array(fr)','WH'),array('12679','23','Brabant Wallon array(fr)','WB'),array('12680','23','Limburg array(nl)','VL'),array('12681','23','West-Vlaanderen array(nl)','VW'),array('12682','23','Brussels','BR'),array('12683','23','Antwerpen array(nl)','VA'),array('12684','23','Liege array(fr)','WL'),array('12685','23','Namur array(fr)','WN'),array('12686','24','Stann Creek','SC'),array('12687','24','Belize','BZ'),array('12688','24','Corozal','CZ'),array('12689','24','Orange Walk','OW'),array('12690','24','Toledo','TO'),array('12691','24','Cayo','CY'),array('12692','25','Zou','ZO'),array('12693','25','Plateau','PL'),array('12694','25','Littoral','LI'),array('12696','25','Alibori','AL'),array('12697','25','Atlantique','AQ'),array('12698','25','Borgou','BO'),array('12699','25','Kouffo','KO'),array('12700','25','Mono','MO'),array('12701','25','Oueme','OU'),array('12702','25','Atakora','AK'),array('12704','25','Collines','CO'),array('12705','25','Donga','DO'),array('12717','27','Trongsa','32'),array('12718','27','Samtse','14'),array('12719','27','Punakha','23'),array('12720','27','Zhemgang','34'),array('12721','27','Trashigang','41'),array('12722','27','Monggar','42'),array('12723','27','Dagana','22'),array('12724','27','Bumthang','33'),array('12725','27','Tsirang','21'),array('12726','27','Sarpang','31'),array('12727','27','Lhuentse','44'),array('12728','27','Pemagatshel','43'),array('12729','27','Paro','11'),array('12730','27','Samdrup Jongkha','45'),array('12731','27','Thimphu','15'),array('12732','27','Wangdue Phodrang','24'),array('12733','27','Gasa','GA'),array('12734','27','Trashi Yangtse','TY'),array('12735','27','Chhukha','12'),array('12736','27','Ha','13'),array('12737','28','Potosi','P'),array('12738','28','Oruro','O'),array('12739','28','Chuquisaca','H'),array('12740','28','El Beni','B'),array('12741','28','Cochabamba','C'),array('12742','28','La Paz','L'),array('12743','28','Pando','N'),array('12744','28','Santa Cruz','S'),array('12745','28','Tarija','T'),array('12746','29','Federacija Bosna i Hercegovina','BI'),array('12747','29','Republika Srpska','SR'),array('12749','30','North-East','NE'),array('12751','30','South-East','SE'),array('12759','30','Ghanzi','GH'),array('12762','30','Kweneng','KW'),array('12770','30','Kgatleng','KL'),array('19401','30','Central','CE'),array('19402','30','Kgalagadi','KG'),array('19403','30','North-West','NW'),array('19404','30','Southern','SO'),array('12771','32','Sao Paulo','SP'),array('12772','32','Rondonia','RO'),array('12773','32','Pernambuco','PE'),array('12774','32','Mato Grosso do Sul','MS'),array('12775','32','Amapa','AP'),array('12776','32','Bahia','BA'),array('12777','32','Distrito Federal','DF'),array('12778','32','Espirito Santo','ES'),array('12779','32','Maranhao','MA'),array('12780','32','Mato Grosso','MT'),array('12781','32','Minas Gerais','MG'),array('12782','32','Paraiba','PB'),array('12783','32','Parana','PR'),array('12784','32','Alagoas','AL'),array('12785','32','Piaui','PI'),array('12786','32','Rio de Janeiro','RJ'),array('12787','32','Rio Grande do Sul','RS'),array('12788','32','Roraima','RR'),array('12789','32','Santa Catarina','SC'),array('12790','32','Sergipe','SE'),array('12791','32','Tocantins','TO'),array('12793','32','Acre','AC'),array('12794','32','Amazonas','AM'),array('12795','32','Ceara','CE'),array('12796','32','Goias','GO'),array('12797','32','Para','PA'),array('12798','32','Rio Grande do Norte','RN'),array('12804','34','Tutong','TU'),array('12805','34','Belait','BE'),array('12806','34','Temburong','TE'),array('12807','34','Brunei-Muara','BM'),array('12808','35','Veliko Tarnovo','4'),array('12809','35','Smolyan','21'),array('12810','35','Razgrad','17'),array('12811','35','Montana','12'),array('12812','35','Yambol','28'),array('12813','35','Burgas','2'),array('12814','35','Plovdiv','16'),array('12815','35','Ruse','18'),array('12816','35','Sliven','20'),array('12817','35','Sofia-Grad','22'),array('12818','35','Stara Zagora','24'),array('12819','35','sumen','27'),array('12820','35','Varna','3'),array('12821','35','Vidin','5'),array('12822','35','Vratsa','6'),array('12823','35','Gabrovo','7'),array('12824','35','Haskovo','26'),array('12825','35','Kardzhali','9'),array('12826','35','Lovech','11'),array('12827','35','Pazardzhik','13'),array('12828','35','Pleven','15'),array('12829','35','Blagoevgrad','1'),array('12830','35','Dobrich','8'),array('12831','35','Kjustendil','10'),array('12832','35','Pernik','14'),array('12833','35','Silistra','19'),array('12834','35','Sofia','23'),array('12835','35','Targovishte','25'),array('12837','36','Loroum','LO'),array('12838','36','Nahouri','NA'),array('12839','36','Noumbiel','NO'),array('12840','36','Oudalan','OU'),array('12841','36','Sanguie','SN'),array('12842','36','Seno','SE'),array('12843','36','Sissili','SI'),array('12844','36','Soum','SO'),array('12845','36','Sourou','SO'),array('12846','36','Bale','BA'),array('12847','36','Banwa','BA'),array('12848','36','Boulgou','BL'),array('12849','36','Comoe','CO'),array('12850','36','Gourma','GO'),array('12851','36','Ioba','IO'),array('12852','36','Kenedougou','KE'),array('12853','36','Kossi','KO'),array('12854','36','Kouritenga','KO'),array('12855','36','Bam','BA'),array('12856','36','Bazega','BA'),array('12857','36','Bougouriba','BG'),array('12858','36','Boulkiemde','BL'),array('12859','36','Ganzourgou','GA'),array('12860','36','Gnagna','GN'),array('12861','36','Houet','HO'),array('12862','36','Kadiogo','KA'),array('12863','36','Komondjari','KM'),array('12864','36','Kompienga','KM'),array('12865','36','Koulpelogo','KO'),array('12866','36','Kourweogo','KO'),array('12867','36','Leraba','LE'),array('12868','36','Mouhoun','MO'),array('12869','36','Namentenga','NA'),array('12870','36','Nayala','NA'),array('12871','36','Oubritenga','OU'),array('12872','36','Passore','PA'),array('12873','36','Poni','PO'),array('12874','36','Sanmatenga','SM'),array('12876','36','Ziro','ZI'),array('12877','36','Yatenga','YA'),array('12878','36','Yagha','YA'),array('12879','36','Tapoa','TA'),array('12880','36','Tui','TU'),array('12881','36','Zondoma','ZO'),array('12882','36','Zoundweogo','ZO'),array('12883','37','Ruyigi','RY'),array('12884','37','Bujumbura','BJ'),array('12885','37','Cankuzo','CA'),array('12886','37','Gitega','GI'),array('12887','37','Karuzi','KR'),array('12888','37','Kirundo','KI'),array('12889','37','Makamba','MA'),array('12890','37','Muyinga','MY'),array('12891','37','Ngozi','NG'),array('12892','37','Rutana','RT'),array('12893','37','Bubanza','BB'),array('12894','37','Kayanza','KY'),array('12895','37','Bururi','BR'),array('12896','37','Cibitoke','CI'),array('12897','37','Muramvya','MU'),array('12898','37','Mwaro','MW'),array('12900','38','Pousaat [Pouthisat]','15'),array('12901','38','Otdar Mean Chey [Otdar Meanchey]','22'),array('12902','38','Kampong Thum [Kampong Thum]','6'),array('12903','38','Kampot [Kampot]','7'),array('12904','38','Kandaal [Kandal]','8'),array('12905','38','Kaoh Kong [Kaoh Kong]','9'),array('12906','38','Kracheh [Kracheh]','10'),array('12907','38','Krong Kaeb [Krong Keb]','23'),array('12908','38','Krong Pailin [Krong Pailin]','24'),array('12909','38','Krong Preah Sihanouk [Krong Preah Sihanouk]','18'),array('12910','38','Mondol Kiri [Mondol Kiri]','11'),array('12911','38','Banteay Mean Chey [Banteay Meanchey]','1'),array('12912','38','Kampong Chaam [Kampong Cham]','3'),array('12913','38','Preah Vihear [Preah Vihear]','13'),array('12914','38','Prey Veaeng [Prey Veng]','14'),array('12915','38','Siem Reab [Siemreab]','17'),array('12916','38','Svaay Rieng [Svay Rieng]','20'),array('12918','38','Baat Dambang [Batdambang]','2'),array('12919','38','Kampong Chhnang [Kampong Chhnang]','4'),array('12920','38','Kampong Spueu [Kampong Spoe]','5'),array('12921','38','Phnom Penh [Phnum Penh]','12'),array('12922','38','Rotanak Kiri [Rotanokiri]','16'),array('12924','38','Taakaev [Takev]','21'),array('12925','38','Stueng Traeng [Stoeng Treng]','19'),array('12926','39','South-West','SW'),array('12927','39','North-West','NW'),array('12928','39','Centre','CE'),array('12929','39','Littoral','LT'),array('12930','39','West','OU'),array('12931','39','North','NO'),array('12932','39','Adamaoua','AD'),array('12933','39','East','ES'),array('12934','39','Far North','EN'),array('12935','39','South','SU'),array('12936','40','Saskatchewan','SK'),array('12937','40','New Brunswick','NB'),array('12938','40','British Columbia','BC'),array('12939','40','Northwest Territories','NT'),array('12940','40','Alberta','AB'),array('12941','40','Manitoba','MB'),array('12942','40','Newfoundland and Labrador','NL'),array('12943','40','Nova Scotia','NS'),array('12944','40','Nunavut','NU'),array('12945','40','Prince Edward Island','PE'),array('12946','40','Quebec','QC'),array('12947','40','Yukon Territory','YT'),array('12948','40','Ontario','ON'),array('12949','41','Sao Nicolau','SN'),array('12950','41','Sao Vicente','SV'),array('12953','41','Boa Vista','BV'),array('12954','41','Maio','MA'),array('12955','41','Ribeira Grande','RG'),array('12956','41','Sal','SL'),array('12957','41','Brava','BR'),array('19405','41','Calheta de Sao Miguel','CS'),array('19406','41','Mosteiros','MO'),array('19407','41','Paul','PA'),array('19408','41','Porto Novo','PN'),array('19409','41','Praia','PR'),array('19411','41','Santa Catarina','CA'),array('19412','41','Santa Cruz','CR'),array('19413','41','Sao Domingos','SD'),array('19414','41','Sao Filipe','SF'),array('19415','41','Tarrafal','TA'),array('12958','42','Little Cayman','5'),array('12962','42','Cayman Brac','2'),array('20891','42','East End','3'),array('48080','42','Bodden Town','1'),array('48081','42','George Town','4'),array('48082','42','North Side','6'),array('48083','42','West Bay','7'),array('12963','43','Sangha-Mbaere','SE'),array('12964','43','Ombella-Mpoko','MP'),array('12965','43','Nana-Grebizi','KB'),array('12966','43','Mambere-Kadei','HS'),array('12967','43','Kemo','KG'),array('12968','43','Haute-Kotto','HK'),array('12969','43','Bangui','BG'),array('12970','43','Ouham-Pende','OP'),array('12971','43','Vakaga','VK'),array('12972','43','Bamingui-Bangoran','BB'),array('12973','43','Basse-Kotto','BK'),array('12974','43','Haut-Mbomou','HM'),array('12975','43','Lobaye','LB'),array('12976','43','Mbomou','MB'),array('12977','43','Nana-Mambere','NM'),array('12978','43','Ouham','AC'),array('12979','43','Ouaka','UK'),array('12980','44','Tandjile','TA'),array('12981','44','Batha','BA'),array('12982','44','Borkou-Ennedi-Tibesti','BE'),array('12983','44','Guera','GR'),array('12984','44','Kanem','KA'),array('12985','44','Lac','LC'),array('12986','44','Logone-Occidental','LO'),array('12987','44','Logone-Oriental','LR'),array('12988','44','Ouaddai','OD'),array('12990','44','Chari-Baguirmi','CB'),array('12991','44','Moyen-Chari','MC'),array('12992','44','Salamat','SA'),array('19416','44','Hadjer Lamis','HL'),array('19417','44','Mandoul','MA'),array('19418','44','Mayo-Kebbi-Est','ME'),array('19419','44','Mayo-Kebbi-Ouest','MO'),array('19420','44','Ndjamena','ND'),array('19421','44','Wadi Fira','WF'),array('12994','45','Tarapaca','TA'),array('12995','45','Maule','ML'),array('12996','45','Coquimbo','CO'),array('12997','45','Araucania','AR'),array('12998','45','Antofagasta','AN'),array('12999','45','Atacama','AT'),array('13000','45','Libertador General Bernardo OHiggins','LI'),array('13001','45','Magallanes','MA'),array('13002','45','Region Metropolitana de Santiago','RM'),array('13003','45','Valparaiso','VS'),array('13004','45','Aisen del General Carlos Ibanez del Campo','AI'),array('13005','45','Bio-Bio','BI'),array('13006','45','Los Lagos','LL'),array('13007','46','Zhejiang','33'),array('13008','46','Xinjiang','65'),array('13009','46','Tianjin','12'),array('13010','46','Shanxi','14'),array('13011','46','Shandong','37'),array('13012','46','Anhui','34'),array('13013','46','Beijing','11'),array('13014','46','Chongqing','50'),array('13015','46','Gansu','62'),array('13016','46','Guangdong','44'),array('13017','46','Guizhou','52'),array('13018','46','Hainan','46'),array('13019','46','Hebei','13'),array('13020','46','Hubei','42'),array('13021','46','Jiangxi','36'),array('13022','46','Jilin','22'),array('13023','46','Liaoning','21'),array('13024','46','Nei Mongol array(mn)','15'),array('13025','46','Ningxia','64'),array('13026','46','Qinghai','63'),array('13027','46','Shaanxi','61'),array('13028','46','Heilongjiang','23'),array('13029','46','Henan','41'),array('13030','46','Hunan','43'),array('13031','46','Jiangsu','32'),array('13032','46','Xizang','54'),array('13033','46','Yunnan','53'),array('13034','46','Aomen array(zh) ***','92'),array('13035','46','Fujian','35'),array('13036','46','Guangxi','45'),array('13037','46','Shanghai','31'),array('13038','46','Sichuan','51'),array('13039','46','Xianggang array(zh) **','91'),array('18995','46','Taiwan *','71'),array('13040','49','Vaupes','VA'),array('13041','49','Sucre','SU'),array('13042','49','Quindio','QU'),array('13043','49','San Andres, Providencia y Santa Catalina','SA'),array('13044','49','Narino','NA'),array('13045','49','Amazonas','AM'),array('13046','49','Arauca','AR'),array('13047','49','Atlantico','AT'),array('13048','49','Bolivar','BO'),array('13049','49','Caldas','CA'),array('13050','49','Caqueta','CA'),array('13051','49','Cauca','CA'),array('13052','49','Choco','CH'),array('13053','49','Cordoba','CO'),array('13054','49','Guainia','GU'),array('13055','49','Antioquia','AN'),array('13056','49','Distrito Capital de Bogota','DC'),array('13057','49','Boyaca','BO'),array('13058','49','Casanare','CA'),array('13059','49','Cesar','CE'),array('13060','49','Cundinamarca','CU'),array('13061','49','Guaviare','GU'),array('13062','49','Magdalena','MA'),array('13063','49','Huila','HU'),array('13064','49','La Guajira','LA'),array('13065','49','Meta','ME'),array('13066','49','Norte de Santander','NS'),array('13067','49','Putumayo','PU'),array('13068','49','Risaralda','RI'),array('13069','49','Santander','SA'),array('13070','49','Tolima','TO'),array('13071','49','Valle del Cauca','VA'),array('13072','49','Vichada','VI'),array('13073','50','Anjouan','A'),array('13074','50','Grande Comore','G'),array('13075','50','Moheli','M'),array('13076','51','Cuvette-Ouest','15'),array('13077','51','Cuvette','8'),array('13078','51','Bouenza','11'),array('13079','51','Likouala','7'),array('13080','51','Brazzaville','BZ'),array('13081','51','Kouilou','5'),array('13082','51','Lekoumou','2'),array('13083','51','Niari','9'),array('13084','51','Pool','12'),array('13085','51','Sangha','13'),array('13086','51','Plateaux','14'),array('13087','52','Nord-Kivu','NK'),array('13088','52','Bas-Congo','BC'),array('13089','52','Orientale','OR'),array('13090','52','Kasai-Oriental','KE'),array('13091','52','Kinshasa','KN'),array('13092','52','Kasai-Occidental','KW'),array('13093','52','equateur','EQ'),array('13094','52','Bandundu','BN'),array('13095','52','Maniema','MA'),array('13096','52','Sud-Kivu','SK'),array('13097','52','Katanga','KA'),array('13113','54','Puntarenas','P'),array('13114','54','Limon','L'),array('13115','54','Cartago','C'),array('13116','54','Guanacaste','G'),array('13117','54','San Jose','SJ'),array('13118','54','Heredia','H'),array('13119','54','Alajuela','A'),array('18974','55','18 Montagnes array(Region des)','6'),array('18975','55','Agnebi array(Region de l)','16'),array('18976','55','Bafing array(Region du)','17'),array('18977','55','Bas-Sassandra array(Region du)','9'),array('18978','55','Denguele array(Region du)','10'),array('18979','55','Fromager array(Region du)','18'),array('18980','55','Haut-Sassandra array(Region du)','2'),array('18981','55','Lacs array(Region des)','7'),array('18982','55','Lagunes array(Region des)','1'),array('18983','55','Marahoue array(Region de la)','12'),array('18984','55','Moyen-Cavally array(Region du)','19'),array('18985','55','Moyen-Comoe array(Region du)','5'),array('18986','55','Nzi-Comoe array(Region)','11'),array('18987','55','Savanes array(Region des)','3'),array('18988','55','Sud-Bandama array(Region du)','15'),array('18989','55','Sud-Comoe array(Region du)','13'),array('18990','55','Vallee du Bandama array(Region de la)','4'),array('18991','55','Worodougou array(Region du)','14'),array('18992','55','Zanzan array(Region du)','8'),array('13120','56','Vukovarsko-srijemska zupanija','16'),array('13121','56','Istarska zupanija','18'),array('13122','56','Dubrovacko-neretvanska zupanija','19'),array('13123','56','Grad Zagreb','21'),array('13124','56','Karlovacka zupanija','4'),array('13125','56','Krapinsko-zagorska zupanija','2'),array('13126','56','Licko-senjska zupanija','9'),array('13127','56','Osjecko-baranjska zupanija','14'),array('13128','56','Primorsko-goranska zupanija','8'),array('13129','56','sibensko-kninska zupanija','15'),array('13130','56','Brodsko-posavska zupanija','12'),array('13131','56','Varazdinska zupanija','5'),array('13132','56','Viroviticko-podravska zupanija','10'),array('13133','56','Zadarska zupanija','13'),array('13134','56','Zagrebacka zupanija','1'),array('13135','56','Bjelovarsko-bilogorska zupanija','7'),array('13136','56','Koprivnicko-krizevacka zupanija','6'),array('13137','56','Splitsko-dalmatinska zupanija','17'),array('13138','56','Sisacko-moslavacka zupanija','3'),array('13139','56','Pozesko-slavonska zupanija','11'),array('13140','56','Medimurska zupanija','20'),array('13142','57','Ciudad de La Habana','3'),array('13143','57','Isla de la Juventud','99'),array('13144','57','Las Tunas','10'),array('13145','57','Matanzas','4'),array('13146','57','Sancti Spiritus','7'),array('13147','57','Villa Clara','5'),array('13152','57','Camaguey','9'),array('13153','57','Ciego de avila','8'),array('13154','57','Cienfuegos','6'),array('13155','57','Granma','12'),array('13156','57','Holguin','11'),array('13157','57','Guantanamo','14'),array('13158','57','Santiago de Cuba','13'),array('13159','57','La Habana','2'),array('13160','57','Pinar del Rio','1'),array('19428','58','Keryneia','6'),array('19429','58','Larnaka','3'),array('19430','58','Lefkosia','1'),array('19431','58','Lemesos','2'),array('19433','58','Pafos','5'),array('20225','58','Ammochostos','4'),array('13183','59','Karlovarsky kraj','KA'),array('13184','59','Liberecky kraj','LI'),array('13185','59','Olomoucky kraj','OL'),array('13186','59','Plzensky kraj','PL'),array('13187','59','Stredocesky kraj','ST'),array('13188','59','Vysocina','VY'),array('13219','59','Jihocesky kraj','JC'),array('13220','59','Jihomoravsky kraj','JM'),array('13221','59','Kralovehradecky kraj','KR'),array('13222','59','Moravskoslezsky kraj','MO'),array('13223','59','Pardubicky kraj','PA'),array('13224','59','Praha, hlavni mesto','PR'),array('13225','59','ustecky kraj','US'),array('13226','59','Zlinsky kraj','ZL'),array('13256','60','Bornholm','4'),array('13257','60','Frederiksborg','2'),array('13258','60','Kobenhavn City','10'),array('13259','60','Ringkobing','6'),array('13260','60','Sonderjylland','5'),array('13261','60','Storstrom','3'),array('13262','60','Vejle','6'),array('13263','60','Vestsjaelland','3'),array('13264','60','Viborg','7'),array('13265','60','Fyn','4'),array('13266','60','Kobenhavn','1'),array('13267','60','Nordjylland','8'),array('13268','60','Ribe','5'),array('13269','60','Roskilde','2'),array('13274','60','arhus','7'),array('13275','60','Frederiksberg City','14'),array('19434','60','Capital','84'),array('19435','60','Central Jutland','82'),array('19436','60','North Jutland','81'),array('19437','60','Zeeland','85'),array('19438','60','South Denmark','83'),array('13280','61','Djibouti','DJ'),array('13281','61','Obock','OB'),array('13282','61','Dikhil','DI'),array('13283','61','Ali Sabieh','AS'),array('13284','61','Tadjourah','TA'),array('19439','61','Arta','AR'),array('13285','62','Saint Patrick','9'),array('13286','62','Saint Andrew','2'),array('13287','62','Saint Paul','10'),array('13288','62','Saint Peter','11'),array('13289','62','Saint David','3'),array('13290','62','Saint Mark','8'),array('13291','62','Saint Joseph','6'),array('13292','62','Saint John','5'),array('13293','62','Saint George','4'),array('13294','62','Saint Luke','7'),array('13477','63','Barahona','4'),array('13487','63','La Romana','12'),array('13489','63','Bahoruco','3'),array('13490','63','Dajabon','5'),array('13491','63','Duarte','6'),array('13492','63','El Seybo [El Seibo]','8'),array('13493','63','Espaillat','9'),array('13494','63','Independencia','10'),array('13496','63','Maria Trinidad Sanchez','14'),array('13497','63','Monte Cristi','15'),array('13498','63','Pedernales','16'),array('13499','63','Peravia','17'),array('13500','63','Salcedo','19'),array('13501','63','Sanchez Ramirez','24'),array('13502','63','San Jose de Ocoa','31'),array('13503','63','San Pedro de Macoris','23'),array('13504','63','Santiago Rodriguez','26'),array('13505','63','Valverde','27'),array('13506','63','Azua','2'),array('13509','63','La Estrelleta [Elias Pina]','7'),array('13510','63','Hato Mayor','30'),array('13511','63','La Altagracia','11'),array('13512','63','La Vega','13'),array('13513','63','Monsenor Nouel','28'),array('13514','63','Monte Plata','29'),array('13515','63','Puerto Plata','18'),array('13516','63','Samana','20'),array('13517','63','San Cristobal','21'),array('13518','63','San Juan','22'),array('13519','63','Santiago','25'),array('13520','63','Distrito Nacional array(Santo Domingo)','1'),array('13566','64','Zamora-Chinchipe','Z'),array('13567','64','Sucumbios','U'),array('13568','64','Pastaza','Y'),array('13569','64','Napo','N'),array('13570','64','Azuay','A'),array('13571','64','Bolivar','B'),array('13572','64','Carchi','C'),array('13573','64','Cotopaxi','X'),array('13574','64','El Oro','O'),array('13575','64','Galapagos','W'),array('13576','64','Guayas','G'),array('13577','64','Loja','L'),array('13578','64','Canar','F'),array('13579','64','Chimborazo','H'),array('13580','64','Esmeraldas','E'),array('13581','64','Imbabura','I'),array('13582','64','Los Rios','R'),array('13583','64','Manabi','M'),array('13584','64','Morona-Santiago','S'),array('13585','64','Orellana','D'),array('13586','64','Pichincha','P'),array('13587','64','Tungurahua','T'),array('21342','64','Santa Elena','1.10.2001'),array('21343','64','Santo Domingo de los Tsachilas','1.10.2002'),array('13588','65','Al Wadi al Jadid','WA'),array('13589','65','al-Uqsur','LX'),array('13590','65','Shamal Sina','SI'),array('13591','65','Al Minya','MN'),array('13592','65','Kafr ash Shaykh','KF'),array('13593','65','Bur Said','PT'),array('13594','65','Dumyat','DT'),array('13595','65','Al Iskandariyah','AL'),array('13596','65','Al Jizah','GZ'),array('13597','65','Matruh','MT'),array('13598','65','Al Qahirah','C'),array('13599','65','Qina','KN'),array('13600','65','Ash Sharqiyah','SH'),array('13601','65','As Suways','SU'),array('13602','65','Aswan','AS'),array('13603','65','Bani Suwayf','BN'),array('13604','65','Asyut','AS'),array('13605','65','Al Bahr al Ahmar','BA'),array('13606','65','Al Buhayrah','BH'),array('13607','65','Ad Daqahliyah','DK'),array('13608','65','Al Fayyum','FY'),array('13609','65','Al Gharbiyah','GH'),array('13610','65','Al Ismailiyah','IS'),array('13611','65','Janub Sina','JS'),array('13612','65','Al Minufiyah','MN'),array('13613','65','Al Qalyubiyah','KB'),array('13614','65','Suhaj','SH'),array('13615','66','Usulutan','US'),array('13616','66','San Vicente','SV'),array('13617','66','Morazan','MO'),array('13618','66','Chalatenango','CH'),array('13619','66','Ahuachapan','AH'),array('13620','66','Cabanas','CA'),array('13621','66','Cuscatlan','CU'),array('13622','66','La Paz','PA'),array('13623','66','La Union','UN'),array('13624','66','San Miguel','SM'),array('13625','66','Santa Ana','SA'),array('13626','66','Sonsonate','SO'),array('13627','66','La Libertad','LI'),array('13628','66','San Salvador','SS'),array('13629','67','Wele-Nzas','WN'),array('13630','67','Kie-Ntem','KN'),array('13631','67','Litoral','LI'),array('13632','67','Bioko Norte','BN'),array('13633','67','Centro Sur','CS'),array('13634','67','Bioko Sur','BS'),array('13635','67','Annobon','AN'),array('19440','67','Region Continental','C'),array('19441','67','Region Insular','I'),array('13636','68','Semenawi Keyih Bahri [Semien-Keih-Bahri]','SK'),array('13637','68','Gash-Barka','GB'),array('13638','68','Anseba','AN'),array('13639','68','Debubawi Keyih Bahri [Debub-Keih-Bahri]','DK'),array('13640','68','Maakel [Maekel]','MA'),array('13641','68','Debub','DU'),array('13642','69','Vorumaa','86'),array('13643','69','Raplamaa','70'),array('13644','69','Viljandimaa','84'),array('13645','69','Saaremaa','74'),array('13646','69','Ida-Virumaa','44'),array('13647','69','Jogevamaa','49'),array('13648','69','Laanemaa','57'),array('13649','69','Parnumaa','67'),array('13650','69','Polvamaa','65'),array('13651','69','Valgamaa','82'),array('13652','69','Jarvamaa','51'),array('13653','69','Harjumaa','37'),array('13654','69','Hiiumaa','39'),array('13655','69','Laane-Virumaa','59'),array('13656','69','Tartumaa','78'),array('13657','70','YeDebub Biheroch Bihereseboch na Hizboch','SN'),array('13658','70','Amara','AM'),array('13659','70','Tigray','TI'),array('13661','70','Adis Abeba','AA'),array('13662','70','Afar','AF'),array('13663','70','Binshangul Gumuz','BE'),array('13664','70','Sumale','SO'),array('13665','70','Hareri Hizb','HA'),array('13666','70','Gambela Hizboch','GA'),array('13667','70','Dire Dawa','DD'),array('13668','70','Oromiya','OR'),array('13681','73','Western','W'),array('13682','73','Eastern','E'),array('13683','73','Central','C'),array('13684','73','Northern','N'),array('18998','73','Rotuma','R'),array('13690','74','Lapin laani','LL'),array('13703','74','Ahvenanmaan laani','AL'),array('13706','74','Ita-Suomen laani','IS'),array('20230','74','Etela-Suomen laani','ES'),array('20233','74','Lansi-Suomen laani','LS'),array('20234','74','Oulun laani','OL'),array('13707','75','Yvelines','78'),array('13708','75','Vosges','88'),array('13709','75','Val-dOise','95'),array('13710','75','Seine-Maritime','76'),array('13711','75','Somme','80'),array('13712','75','Tarn-et-Garonne','82'),array('13713','75','Vaucluse','84'),array('13714','75','Savoie','73'),array('13717','75','Allier','3'),array('13718','75','Alpes-Maritimes','6'),array('13719','75','Ardennes','8'),array('13720','75','Aude','11'),array('13721','75','Bas-Rhin','67'),array('13722','75','Calvados','14'),array('13723','75','Charente','16'),array('13736','75','Ain','1'),array('13737','75','Aisne','2'),array('13738','75','Alpes-de-Haute-Provence','4'),array('13739','75','Ardeche','7'),array('13740','75','Ariege','9'),array('13741','75','Aube','10'),array('13742','75','Aveyron','12'),array('13743','75','Bouches-du-Rhone','13'),array('13744','75','Cantal','15'),array('13745','75','Charente-Maritime','17'),array('13746','75','Cher','18'),array('13747','75','Corse-du-Sud','2A'),array('13748','75','Haute-Corse','2B'),array('13749','75','Haute-Loire','43'),array('13750','75','Hautes-Alpes','5'),array('13751','75','Haute-Savoie','74'),array('13752','75','Hautes-Pyrenees','65'),array('13753','75','Haut-Rhin','68'),array('13754','75','Herault','34'),array('13755','75','Indre','36'),array('13756','75','Indre-et-Loire','37'),array('13757','75','Jura','39'),array('13758','75','Loire','42'),array('13759','75','Loiret','45'),array('13760','75','Loir-et-Cher','41'),array('13761','75','Lot-et-Garonne','47'),array('13762','75','Maine-et-Loire','49'),array('13763','75','Marne','51'),array('13764','75','Mayenne','53'),array('13765','75','Meuse','55'),array('13766','75','Moselle','57'),array('13767','75','Nord','59'),array('13768','75','Oise','60'),array('13769','75','Paris','75'),array('13770','75','Puy-de-Dome','63'),array('13771','75','Pyrenees-Orientales','66'),array('13772','75','Rhone','69'),array('13773','75','Sarthe','72'),array('13774','75','Seine-et-Marne','77'),array('13775','75','Seine-Saint-Denis','93'),array('13776','75','Tarn','81'),array('13777','75','Territoire de Belfort','90'),array('13778','75','Val-de-Marne','94'),array('13779','75','Var','83'),array('13780','75','Vendee','85'),array('13781','75','Vienne','86'),array('13782','75','Yonne','89'),array('13791','75','Correze','19'),array('13792','75','Cote-dOr','21'),array('13793','75','Cotes-dArmor','22'),array('13794','75','Creuse','23'),array('13795','75','Deux-Sevres','79'),array('13796','75','Dordogne','24'),array('13797','75','Doubs','25'),array('13798','75','Lozere','48'),array('13799','75','Manche','50'),array('13800','75','Meurthe-et-Moselle','54'),array('13801','75','Morbihan','56'),array('13802','75','Nievre','58'),array('13803','75','Orne','61'),array('13804','75','Pas-de-Calais','62'),array('13805','75','Pyrenees-Atlantiques','64'),array('13806','75','Saone-et-Loire','71'),array('13807','75','Haute-Marne','52'),array('13808','75','Haute-Saone','70'),array('13809','75','Haute-Vienne','87'),array('13810','75','Hauts-de-Seine','92'),array('13811','75','Ille-et-Vilaine','35'),array('13812','75','Isere','38'),array('13813','75','Landes','40'),array('13814','75','Loire-Atlantique','44'),array('13815','75','Lot','46'),array('13816','75','Drome','26'),array('13817','75','Essonne','91'),array('13818','75','Eure','27'),array('13819','75','Eure-et-Loir','28'),array('13820','75','Finistere','29'),array('13821','75','Gard','30'),array('13822','75','Gers','32'),array('13823','75','Gironde','33'),array('13824','75','Haute-Garonne','31'),array('18999','75','Mayotte array(see also separate entry under YT)','YT'),array('19000','75','Nouvelle-Caledonie array(see also separate entry under NC)','NC'),array('19001','75','Polynesie francaise array(see also separate entry under PF)','PF'),array('19002','75','Saint-Pierre-et-Miquelon array(see also separate entry under PM)','PM'),array('19003','75','Terres Australes Francaises array(see also separate entry under TF)','TF'),array('19004','75','Wallis et Futuna array(see also separate entry under WF)','WF'),array('13834','78','Ile Saint-Paul et Ile Amsterdam','1.10.2001'),array('13836','78','Crozet Islands','1.10.2002'),array('13837','78','Kerguelen','1.10.2003'),array('21356','78','Iles Eparses','1.10.2004'),array('13838','79','Woleu-Ntem','9'),array('13839','79','Estuaire','1'),array('13840','79','Ogooue-Maritime','8'),array('13841','79','Moyen-Ogooue','3'),array('13842','79','Ogooue-Ivindo','6'),array('13843','79','Ogooue-Lolo','7'),array('13844','79','Ngounie','4'),array('13845','79','Haut-Ogooue','2'),array('13846','79','Nyanga','5'),array('13877','80','MacCarthy Island','M'),array('13880','80','Banjul','B'),array('13881','80','Upper River','U'),array('13882','80','Western','W'),array('13885','80','North Bank','N'),array('13887','80','Lower River','L'),array('13895','81','Tbilisi','TB'),array('13896','81','Ajaria','AJ'),array('13897','81','Guria','GU'),array('13898','81','Kakheti','KA'),array('13899','81','Racha-Lechkhumi [and] Kvemo Svaneti','RL'),array('13900','81','Kvemo Kartli','KK'),array('13901','81','Imereti','IM'),array('13902','81','Abkhazia','AB'),array('13903','81','Samtskhe-Javakheti','SJ'),array('13904','81','Shida Kartli','SK'),array('13905','81','Mtskheta-Mtianeti','MM'),array('13906','81','Samegrelo-Zemo Svaneti','SZ'),array('14044','82','Bayern','BY'),array('14045','82','Brandenburg','BB'),array('14046','82','Hamburg','HH'),array('14047','82','Mecklenburg-Vorpommern','MV'),array('14048','82','Nordrhein-Westfalen','NW'),array('14049','82','Saarland','SL'),array('14050','82','Sachsen-Anhalt','ST'),array('14051','82','Thuringen','TH'),array('14337','82','Baden-Wurttemberg','BW'),array('14338','82','Berlin','BE'),array('14339','82','Bremen','HB'),array('14340','82','Hessen','HE'),array('14341','82','Niedersachsen','NI'),array('14342','82','Rheinland-Pfalz','RP'),array('14343','82','Sachsen','SN'),array('14344','82','Schleswig-Holstein','SH'),array('14397','83','Upper West','UW'),array('14398','83','Western','WP'),array('14399','83','Greater Accra','AA'),array('14400','83','Brong-Ahafo','BA'),array('14401','83','Volta','TV'),array('14402','83','Northern','NP'),array('14403','83','Ashanti','AH'),array('14404','83','Central','CP'),array('14405','83','Eastern','EP'),array('14406','83','Upper East','UE'),array('19166','85','Barking and Dagenham','BD'),array('19167','85','Barnet','BN'),array('19168','85','Barnsley','BN'),array('19172','85','Bexley','BE'),array('19173','85','Birmingham','BI'),array('19177','85','Bolton','BO'),array('19180','85','Bradford','BR'),array('19181','85','Brent','BE'),array('19185','85','Bromley','BR'),array('19187','85','Bury','BU'),array('19189','85','Calderdale','CL'),array('19191','85','Camden','CM'),array('19203','85','Coventry','CO'),array('19205','85','Croydon','CR'),array('19213','85','Doncaster','DN'),array('19216','85','Dudley','DU'),array('19221','85','Ealing','EA'),array('19230','85','Enfield','EN'),array('19236','85','Gateshead','GA'),array('19239','85','Greenwich','GR'),array('19241','85','Hackney','HC'),array('19243','85','Hammersmith and Fulham','HM'),array('19245','85','Haringey','HR'),array('19246','85','Harrow','HR'),array('19248','85','Havering','HA'),array('19252','85','Hillingdon','HI'),array('19253','85','Hounslow','HN'),array('19257','85','Isles of Scilly','IO'),array('19258','85','Islington','IS'),array('19259','85','Kensington and Chelsea','KE'),array('19262','85','Kingston upon Thames','KT'),array('19263','85','Kirklees','KI'),array('19264','85','Knowsley','KW'),array('19265','85','Lambeth','LB'),array('19268','85','Leeds','LD'),array('19271','85','Lewisham','LE'),array('19275','85','Liverpool','LI'),array('19282','85','Merton','MR'),array('19290','85','Newcastle upon Tyne','NE'),array('19291','85','Newham','NW'),array('19302','85','North Tyneside','NT'),array('19308','85','Oldham','OL'),array('19320','85','Redbridge','RD'),array('19324','85','Richmond upon Thames','RI'),array('19325','85','Rochdale','RC'),array('19326','85','Rotherham','RO'),array('19328','85','Salford','SL'),array('19329','85','Sandwell','SA'),array('19331','85','Sefton','SF'),array('19332','85','Sheffield','SH'),array('19336','85','Solihull','SO'),array('19341','85','South Tyneside','ST'),array('19344','85','Southwark','SW'),array('19345','85','St. Helens','SH'),array('19348','85','Stockport','SK'),array('19353','85','Sunderland','SN'),array('19355','85','Sutton','ST'),array('19358','85','Tameside','TA'),array('19363','85','Tower Hamlets','TW'),array('19364','85','Trafford','TR'),array('19366','85','Wakefield','WK'),array('19367','85','Walsall','WL'),array('19368','85','Waltham Forest','WF'),array('19369','85','Wandsworth','WN'),array('19376','85','Westminster','WS'),array('19377','85','Wigan','WG'),array('19380','85','Wirral','WR'),array('19382','85','Wolverhampton','WL'),array('47904','85','Kingston upon Hull, City of','KH'),array('47905','85','Kent','KE'),array('47906','85','Isle of Wight','IO'),array('47907','85','Hertfordshire','HR'),array('47908','85','Herefordshire, County of','HE'),array('47909','85','Hartlepool','HP'),array('47910','85','Hampshire','HA'),array('47911','85','Halton','HA'),array('47912','85','London, City of','LN'),array('47913','85','Gloucestershire','GL'),array('47914','85','Essex','ES'),array('47915','85','East Sussex','ES'),array('47916','85','East Riding of Yorkshire','ER'),array('47917','85','Durham','DU'),array('47918','85','Dorset','DO'),array('47919','85','Devon','DE'),array('47920','85','Derbyshire','DB'),array('47921','85','Derby','DE'),array('47922','85','Darlington','DA'),array('47923','85','Cumbria','CM'),array('47924','85','Cornwall','CO'),array('47925','85','Cheshire','CH'),array('47926','85','Cambridgeshire','CA'),array('47927','85','Buckinghamshire','BK'),array('47928','85','Bristol, City of','BS'),array('47929','85','Brighton and Hove','BN'),array('47930','85','Bracknell Forest','BR'),array('47931','85','Bournemouth','BM'),array('47932','85','Blackpool','BP'),array('47933','85','Blackburn with Darwen','BB'),array('47934','85','Bedfordshire','BD'),array('47935','85','Bath and North East Somerset','BA'),array('47936','85','Wrexham [Wrecsam GB-WRC]','WR'),array('47937','85','Vale of Glamorgan, The [Bro Morgannwg GB-BMG]','VG'),array('47938','85','Torfaen [Tor-faen]','TO'),array('47939','85','Swansea [Abertawe GB-ATA]','SW'),array('47940','85','Rhondda, Cynon, Taff [Rhondda, Cynon,Taf]','RC'),array('47941','85','Powys','PO'),array('47942','85','Pembrokeshire [Sir Benfro GB-BNF]','PE'),array('47943','85','Newport [Casnewydd GB-CNW]','NW'),array('47944','85','Neath Port Talbot [Castell-nedd Port Talbot GB-CTL]','NT'),array('47945','85','Monmouthshire [Sir Fynwy GB-FYN]','MO'),array('47946','85','Merthyr Tydfil [Merthyr Tudful GB-MTU]','MT'),array('47947','85','Gwynedd','GW'),array('47948','85','Flintshire [Sir y Fflint GB-FFL]','FL'),array('47949','85','Denbighshire [Sir Ddinbych GB-DDB]','DE'),array('47950','85','Conwy','CW'),array('47951','85','Ceredigion [Sir Ceredigion]','CG'),array('47952','85','Carmarthenshire [Sir Gaerfyrddin GB-GFY]','CM'),array('47953','85','Cardiff [Caerdydd GB-CRD]','CR'),array('47954','85','Caerphilly [Caerffili GB-CAF]','CA'),array('47955','85','Bridgend [Pen-y-bont ar Ogwr GB-POG]','BG'),array('47956','85','Blaenau Gwent','BG'),array('47957','85','Isle of Anglesey [Sir Ynys Mon GB-YNM]','AG'),array('47958','85','West Lothian','WL'),array('47959','85','West Dunbartonshire','WD'),array('47960','85','Stirling','ST'),array('47961','85','South Lanarkshire','SL'),array('47962','85','South Ayrshire','SA'),array('47963','85','Shetland Islands','ZE'),array('47964','85','Scottish Borders, The','SC'),array('47965','85','Renfrewshire','RF'),array('47966','85','Perth and Kinross','PK'),array('47967','85','Orkney Islands','OR'),array('47968','85','North Lanarkshire','NL'),array('47969','85','North Ayrshire','NA'),array('47970','85','Moray','MR'),array('47971','85','Midlothian','ML'),array('47972','85','Inverclyde','IV'),array('47973','85','Highland','HL'),array('47974','85','Glasgow City','GL'),array('47975','85','Fife','FI'),array('47976','85','Falkirk','FA'),array('47977','85','Eilean Siar','EL'),array('47978','85','Edinburgh, City of','ED'),array('47979','85','East Renfrewshire','ER'),array('47980','85','East Lothian','EL'),array('47981','85','East Dunbartonshire','ED'),array('47982','85','East Ayrshire','EA'),array('47983','85','Dundee City','DN'),array('47984','85','Dumfries and Galloway','DG'),array('47985','85','Clackmannanshire','CL'),array('47986','85','Argyll and Bute','AG'),array('47987','85','Angus','AN'),array('47988','85','Aberdeenshire','AB'),array('47989','85','Aberdeen City','AB'),array('47990','85','Strabane','ST'),array('47991','85','Omagh','OM'),array('47992','85','North Down','ND'),array('47993','85','Newtownabbey','NT'),array('47994','85','Newry and Mourne','NY'),array('47995','85','Moyle','MY'),array('47996','85','Magherafelt','MF'),array('47997','85','Derry','DR'),array('47998','85','Lisburn','LS'),array('47999','85','Limavady','LM'),array('48000','85','Larne','LR'),array('48001','85','Fermanagh','FE'),array('48002','85','Dungannon','DG'),array('48003','85','Down','DO'),array('48004','85','Craigavon','CG'),array('48005','85','Cookstown','CK'),array('48006','85','Coleraine','CL'),array('48007','85','Castlereagh','CS'),array('48008','85','Carrickfergus','CK'),array('48009','85','Belfast','BF'),array('48010','85','Banbridge','BN'),array('48011','85','Ballymoney','BL'),array('48012','85','Ballymena','BL'),array('48013','85','Armagh','AR'),array('48014','85','Ards','AR'),array('48015','85','Antrim','AN'),array('48016','85','York','YO'),array('48017','85','Worcestershire','WO'),array('48018','85','Wokingham','WO'),array('48019','85','Windsor and Maidenhead','WN'),array('48020','85','Wiltshire','WI'),array('48022','85','West Sussex','WS'),array('48024','85','West Berkshire','WB'),array('48025','85','Warwickshire','WA'),array('48026','85','Warrington','WR'),array('48028','85','Torbay','TO'),array('48029','85','Thurrock','TH'),array('48030','85','Telford and Wrekin','TF'),array('48031','85','Swindon','SW'),array('48032','85','Surrey','SR'),array('48033','85','Suffolk','SF'),array('48034','85','Stoke-on-Trent','ST'),array('48035','85','Stockton-on-Tees','ST'),array('48036','85','Staffordshire','ST'),array('48037','85','Southend-on-Sea','SO'),array('48038','85','Southampton','ST'),array('48040','85','South Gloucestershire','SG'),array('48041','85','Somerset','SO'),array('48042','85','Slough','SL'),array('48043','85','Shropshire','SH'),array('48044','85','Rutland','RU'),array('48045','85','Redcar and Cleveland','RC'),array('48046','85','Reading','RD'),array('48047','85','Portsmouth','PO'),array('48048','85','Poole','PO'),array('48049','85','Plymouth','PL'),array('48050','85','Peterborough','PT'),array('48051','85','Oxfordshire','OX'),array('48052','85','Nottinghamshire','NT'),array('48053','85','Nottingham','NG'),array('48054','85','Northumberland','NB'),array('48055','85','Northamptonshire','NT'),array('48056','85','North Yorkshire','NY'),array('48057','85','North Somerset','NS'),array('48058','85','North Lincolnshire','NL'),array('48059','85','North East Lincolnshire','NE'),array('48060','85','Norfolk','NF'),array('48061','85','Milton Keynes','MI'),array('48062','85','Middlesbrough','MD'),array('48064','85','Medway','MD'),array('48065','85','Luton','LU'),array('48066','85','Manchester','MA'),array('48067','85','Lincolnshire','LI'),array('48068','85','Leicestershire','LE'),array('48069','85','Leicester','LC'),array('48070','85','Lancashire','LA'),array('14408','86','Xanthi','72'),array('14409','86','Trikala','44'),array('14410','86','Thesprotia','32'),array('14411','86','Samos','84'),array('14412','86','Pieria','61'),array('14413','86','Lesvos','83'),array('14414','86','Achaia','13'),array('14415','86','Argolis','11'),array('14416','86','Attiki','A1'),array('14417','86','Agio Oros','69'),array('14418','86','Evrytania','5'),array('14419','86','Evvoia','4'),array('14420','86','Fthiotis','6'),array('14421','86','Chalkidiki','64'),array('14422','86','Chios','85'),array('14423','86','Aitolia-Akarnania','1'),array('14424','86','Arkadia','12'),array('14425','86','Arta','31'),array('14426','86','Dodekanisos','81'),array('14427','86','Drama','52'),array('14428','86','Evros','71'),array('14429','86','Florina','63'),array('14430','86','Fokis','7'),array('14431','86','Grevena','51'),array('14432','86','Chania','94'),array('14433','86','Ileia','14'),array('14434','86','Irakleion','91'),array('14435','86','Karditsa','41'),array('14436','86','Kavalla','55'),array('14437','86','Kyklades','82'),array('14438','86','Korinthia','15'),array('14439','86','Lakonia','16'),array('14440','86','Lasithion','92'),array('14441','86','Lefkas','24'),array('14442','86','Messinia','17'),array('14443','86','Pella','59'),array('14444','86','Preveza','34'),array('14445','86','Rodopi','73'),array('14446','86','Serrai','62'),array('14447','86','Thessaloniki','54'),array('14448','86','Voiotia','3'),array('14449','86','Zakynthos','21'),array('14450','86','Imathia','53'),array('14451','86','Ioannina','33'),array('14452','86','Kastoria','56'),array('14453','86','Kefallinia','23'),array('14454','86','Kerkyra','22'),array('14455','86','Kilkis','57'),array('14456','86','Kozani','58'),array('14457','86','Larisa','42'),array('14458','86','Magnisia','43'),array('14459','86','Rethymnon','93'),array('14480','88','Saint Mark','5'),array('14481','88','Southern Grenadine Islands','10'),array('14482','88','Saint Patrick','6'),array('14483','88','Saint John','4'),array('14484','88','Saint Andrew','1'),array('14485','88','Saint George','3'),array('14486','88','Saint David','2'),array('14521','91','Totonicapan','TO'),array('14522','91','Solola','SO'),array('14523','91','San Marcos','SM'),array('14524','91','Retalhuleu','RE'),array('14525','91','Quetzaltenango','QZ'),array('14526','91','Baja Verapaz','BV'),array('14527','91','Chiquimula','CQ'),array('14528','91','Escuintla','ES'),array('14529','91','Guatemala','GU'),array('14530','91','Zacapa','ZA'),array('14531','91','Alta Verapaz','AV'),array('14532','91','Chimaltenango','CM'),array('14533','91','El Progreso','PR'),array('14534','91','Huehuetenango','HU'),array('14535','91','Izabal','IZ'),array('14536','91','Jalapa','JA'),array('14537','91','Jutiapa','JU'),array('14538','91','Peten','PE'),array('14539','91','Quiche','QC'),array('14540','91','Sacatepequez','SA'),array('14541','91','Santa Rosa','SR'),array('14542','91','Suchitepequez','SU'),array('14556','93','Tougue','TO'),array('14557','93','Pita','PI'),array('14558','93','Mandiana','MD'),array('14559','93','Mali','ML'),array('14560','93','Kouroussa','KO'),array('14561','93','Kerouane','KE'),array('14565','93','Beyla','BE'),array('14566','93','Boffa','BF'),array('14567','93','Boke','BK'),array('14568','93','Conakry','C'),array('14569','93','Coyah','CO'),array('14570','93','Dalaba','DL'),array('14571','93','Forecariah','FO'),array('14572','93','Gaoual','GA'),array('14573','93','Dubreka','DU'),array('14575','93','Dabola','DB'),array('14576','93','Dinguiraye','DI'),array('14577','93','Faranah','FA'),array('14578','93','Fria','FR'),array('14579','93','Guekedou','GU'),array('14580','93','Kankan','KA'),array('14581','93','Kindia','KD'),array('14582','93','Koubia','KB'),array('14583','93','Koundara','KN'),array('14584','93','Labe','LA'),array('14585','93','Lola','LO'),array('14586','93','Macenta','MC'),array('14587','93','Mamou','MM'),array('14588','93','Nzerekore','NZ'),array('14589','93','Siguiri','SI'),array('14590','93','Telimele','TE'),array('14591','93','Yomou','YO'),array('14592','93','Kissidougou','KS'),array('14593','93','Lelouma','LE'),array('14594','94','Quinara','QU'),array('14595','94','Bafata','BA'),array('14596','94','Oio','OI'),array('14597','94','Bissau','BS'),array('14598','94','Biombo','BM'),array('14599','94','Cacheu','CA'),array('14600','94','Tombali','TO'),array('14601','94','Bolama','BL'),array('14602','94','Gabu','GA'),array('14603','95','Upper Demerara-Berbice','UD'),array('14604','95','Pomeroon-Supenaam','PM'),array('14605','95','Barima-Waini','BA'),array('14606','95','Demerara-Mahaica','DE'),array('14607','95','Essequibo Islands-West Demerara','ES'),array('14608','95','Mahaica-Berbice','MA'),array('14609','95','Potaro-Siparuni','PT'),array('14610','95','Upper Takutu-Upper Essequibo','UT'),array('14611','95','East Berbice-Corentyne','EB'),array('14612','95','Cuyuni-Mazaruni','CU'),array('14613','96','Sud','SD'),array('14614','96','Nord-Ouest','NO'),array('14615','96','Ouest','OU'),array('14616','96','Nord','ND'),array('14617','96','Centre','CE'),array('14618','96','Nord-Est','NE'),array('14619','96','Sud-Est','SE'),array('14620','96','Grande-Anse','GA'),array('14621','96','Artibonite','AR'),array('14622','98','Valle','VA'),array('14623','98','Intibuca','IN'),array('14624','98','Choluteca','CH'),array('14625','98','Colon','CL'),array('14626','98','Copan','CP'),array('14628','98','Francisco Morazan','FM'),array('14629','98','Gracias a Dios','GD'),array('14630','98','Islas de la Bahia','IB'),array('14631','98','Lempira','LE'),array('14632','98','Olancho','OL'),array('14633','98','Santa Barbara','SB'),array('14634','98','Yoro','YO'),array('14635','98','Atlantida','AT'),array('14636','98','Comayagua','CM'),array('14637','98','Cortes','CR'),array('14638','98','El Paraiso','EP'),array('14639','98','La Paz','LP'),array('14640','98','Ocotepeque','OC'),array('14641','100','Zala','ZA'),array('14642','100','Tolna','TO'),array('14643','100','Pest','PE'),array('14644','100','Komarom-Esztergom','KE'),array('14645','100','Fejer','FE'),array('14646','100','Baranya','BA'),array('14647','100','Bacs-Kiskun','BK'),array('14648','100','Bekes','BE'),array('14649','100','Budapest','BU'),array('14650','100','Csongrad','CS'),array('14651','100','Gyor-Moson-Sopron','GS'),array('14652','100','Heves','HE'),array('14653','100','Jasz-Nagykun-Szolnok','JN'),array('14654','100','Nograd','NO'),array('14655','100','Somogy','SO'),array('14656','100','Szabolcs-Szatmar-Bereg','SZ'),array('14657','100','Vas','VA'),array('14658','100','Veszprem','VE'),array('14660','100','Borsod-Abauj-Zemplen','BZ'),array('14661','100','Hajdu-Bihar','HB'),array('19442','100','Bekescsaba','BC'),array('19443','100','Debrecen','DE'),array('19444','100','Dunaujvaros','DU'),array('19445','100','Eger','EG'),array('19446','100','Gyor','GY'),array('19447','100','Hodmezovasarhely','HV'),array('19448','100','Kaposvar','KV'),array('19449','100','Kecskemet','KM'),array('19450','100','Miskolc','MI'),array('19451','100','Nagykanizsa','NK'),array('19452','100','Nyiregyhaza','NY'),array('19453','100','Pecs','PS'),array('19454','100','Salgotarjan','ST'),array('19455','100','Sopron','SN'),array('19456','100','Szeged','SD'),array('19457','100','Szekesfehervar','SF'),array('19458','100','Szekszard','SS'),array('19459','100','Szolnok','SK'),array('19460','100','Szombathely','SH'),array('19461','100','Tatabanya','TB'),array('19462','100','Veszprem City','VM'),array('19463','100','Zalaegerszeg','ZE'),array('21352','100','Erd','1.10.2001'),array('14662','101','Vesturland','3'),array('14663','101','Vestfiroir','4'),array('14664','101','Norourland vestra','5'),array('14666','101','Hofuoborgarsvaeoi utan Reykjavikur','1'),array('14667','101','Suournes','2'),array('14668','101','Suourland','8'),array('14669','101','Norourland eystra','6'),array('14670','101','Austurland','7'),array('19009','101','Reykjavik','0'),array('14671','102','Uttaranchal','UL'),array('14672','102','Himachal Pradesh','HP'),array('14673','102','Andaman and Nicobar Islands','AN'),array('14674','102','Arunachal Pradesh','AR'),array('14675','102','Assam','AS'),array('14676','102','Bihar','BR'),array('14677','102','Chhattisgarh','CT'),array('14678','102','Dadra and Nagar Haveli','DN'),array('14679','102','Delhi','DL'),array('14680','102','Gujarat','GJ'),array('14681','102','Haryana','HR'),array('14682','102','Jammu and Kashmir','JK'),array('14683','102','Karnataka','KA'),array('14684','102','Kerala','KL'),array('14685','102','Madhya Pradesh','MP'),array('14686','102','Maharashtra','MH'),array('14687','102','Meghalaya','ML'),array('14688','102','Nagaland','NL'),array('14689','102','Orissa','OR'),array('14690','102','Punjab','PB'),array('14691','102','Rajasthan','RJ'),array('14692','102','Tamil Nadu','TN'),array('14693','102','Tripura','TR'),array('14694','102','Uttar Pradesh','UP'),array('14695','102','Andhra Pradesh','AP'),array('14696','102','West Bengal','WB'),array('14697','102','Chandigarh','CH'),array('14698','102','Daman and Diu','DD'),array('14699','102','Goa','GA'),array('14700','102','Jharkhand','JH'),array('14701','102','Sikkim','SK'),array('14702','102','Mizoram','MZ'),array('14703','102','Manipur','MN'),array('14704','102','Lakshadweep','LD'),array('14705','102','Pondicherry','PY'),array('14706','103','Sumatera Utara','SU'),array('14707','103','Sulawesi Selatan','SN'),array('14708','103','Riau','RI'),array('14709','103','Nusa Tenggara Timur','NT'),array('14710','103','Maluku Utara','MU'),array('14711','103','Gorontalo','GO'),array('14712','103','Jambi','JA'),array('14713','103','Jawa Tengah','JT'),array('14714','103','Kalimantan Barat','KB'),array('14715','103','Kalimantan Selatan','KS'),array('14716','103','Sulawesi Utara','SA'),array('14717','103','Sumatera Selatan','SS'),array('14718','103','Yogyakarta','YO'),array('14719','103','Bali','BA'),array('14720','103','Aceh','AC'),array('14721','103','Bangka Belitung','BB'),array('14722','103','Bengkulu','BE'),array('14723','103','Banten','BT'),array('14724','103','Jakarta Raya','JK'),array('14725','103','Jawa Barat','JB'),array('14726','103','Jawa Timur','JI'),array('14727','103','Kalimantan Tengah','KT'),array('14728','103','Kalimantan Timur','KI'),array('14729','103','Lampung','LA'),array('14730','103','Maluku','MA'),array('14731','103','Nusa Tenggara Barat','NB'),array('14732','103','Papua','PA'),array('14733','103','Kepulauan Riau','KR'),array('14734','103','Sulawesi Tengah','ST'),array('14735','103','Sumatera Barat','SB'),array('14736','103','Sulawesi Tenggara','SG'),array('19010','103','Papua Barat','1.10.2001'),array('19011','103','Sulawesi Barat','SR'),array('14737','104','Zanjan','11'),array('14738','104','Qom','26'),array('14739','104','Kermanshah','17'),array('14740','104','Khorasan','9'),array('14741','104','Khuzestan','10'),array('14742','104','Kohkiluyeh va Buyer Ahmad','18'),array('14743','104','Kordestan','16'),array('14744','104','Lorestan','20'),array('14745','104','Markazi','22'),array('14746','104','Mazandaran','21'),array('14747','104','Qazvin','28'),array('14748','104','Ardabil','3'),array('14749','104','Azarbayjan-e Sharqi','1'),array('14750','104','Chahar Mahall va Bakhtiari','8'),array('14751','104','Fars','14'),array('14752','104','Hamadan','24'),array('14753','104','Ilam','5'),array('14754','104','Semnan','12'),array('14755','104','Tehran','7'),array('14756','104','Azarbayjan-e Gharbi','2'),array('14757','104','Bushehr','6'),array('14758','104','Esfahan','4'),array('14759','104','Gilan','19'),array('14760','104','Golestan','27'),array('14761','104','Hormozgan','23'),array('14762','104','Kerman','15'),array('14763','104','Yazd','25'),array('14764','104','Sistan va Baluchestan','13'),array('19012','104','Khorasan-e Janubi','29'),array('19013','104','Khorasan-e Razavi','30'),array('19014','104','Khorasan-e Shemali','31'),array('14765','105','At Tamim','TS'),array('14766','105','Al Qadisiyah','QA'),array('14767','105','Salah ad Din','SD'),array('14768','105','An Najaf','NA'),array('14769','105','Arbil','AR'),array('14770','105','Baghdad','BG'),array('14771','105','Al Anbar','AN'),array('14772','105','Babil','BB'),array('14773','105','Al Basrah','BA'),array('14774','105','Dahuk','DA'),array('14775','105','Diyala','DI'),array('14776','105','Karbala','KA'),array('14777','105','Al Muthanna','MU'),array('14778','105','Ninawa','NI'),array('14779','105','As Sulaymaniyah','SU'),array('14780','105','Wasit','WA'),array('14781','105','Dhi Qar','DQ'),array('14782','105','Maysan','MA'),array('14783','106','Wexford','WX'),array('14784','106','Waterford','WD'),array('14786','106','Monaghan','MN'),array('14787','106','Longford','LD'),array('14788','106','Kildare','KE'),array('14789','106','Meath','MH'),array('14790','106','Offaly','OY'),array('14791','106','Sligo','SO'),array('14792','106','Tipperary','TA'),array('14793','106','Westmeath','WH'),array('14794','106','Wicklow','WW'),array('14795','106','Cavan','CN'),array('14796','106','Donegal','DL'),array('14797','106','Galway','G'),array('14798','106','Carlow','CW'),array('14799','106','Clare','CE'),array('14800','106','Cork','C'),array('14801','106','Dublin','D'),array('14802','106','Kerry','KY'),array('14803','106','Kilkenny','KK'),array('14804','106','Leitrim','LM'),array('14805','106','Limerick','LK'),array('14806','106','Louth','LH'),array('14807','106','Laois','LS'),array('14808','106','Mayo','MO'),array('14809','106','Roscommon','RN'),array('14847','108','HaDarom','D'),array('14848','108','HaZafon','Z'),array('14850','108','Tel-Aviv','TA'),array('14877','108','HaMerkaz','M'),array('14878','108','Haifa','HA'),array('14879','108','Yerushalayim','JM'),array('19465','109','Agrigento','AG'),array('19466','109','Alessandria','AL'),array('19467','109','Ancona','AN'),array('19468','109','Aosta','AO'),array('19469','109','Arezzo','AR'),array('19470','109','Ascoli Piceno','AP'),array('19471','109','Asti','AT'),array('19472','109','Avellino','AV'),array('19473','109','Bari','BA'),array('19474','109','Belluno','BL'),array('19475','109','Benevento','BN'),array('19476','109','Bergamo','BG'),array('19477','109','Biella','BI'),array('19478','109','Bologna','BO'),array('19479','109','Bolzano','BZ'),array('19480','109','Brescia','BS'),array('19481','109','Brindisi','BR'),array('19482','109','Cagliari','CA'),array('19483','109','Caltanissetta','CL'),array('19484','109','Campobasso','CB'),array('19485','109','Carbonia-Iglesias','CI'),array('19486','109','Caserta','CE'),array('19487','109','Catania','CT'),array('19488','109','Catanzaro','CZ'),array('19489','109','Chieti','CH'),array('19490','109','Como','CO'),array('19491','109','Cosenza','CS'),array('19492','109','Cremona','CR'),array('19493','109','Crotone','KR'),array('19494','109','Cuneo','CN'),array('19495','109','Enna','EN'),array('19496','109','Ferrara','FE'),array('19497','109','Firenze','FI'),array('19498','109','Foggia','FG'),array('19499','109','Forlì','FO'),array('19500','109','Frosinone','FR'),array('19501','109','Genova','GE'),array('19502','109','Gorizia','GO'),array('19503','109','Grosseto','GR'),array('19504','109','Imperia','IM'),array('19505','109','Isernia','IS'),array('19506','109','La Spezia','SP'),array('19507','109','LAquila','AQ'),array('19508','109','Latina','LT'),array('19509','109','Lecce','LE'),array('19510','109','Lecco','LC'),array('19511','109','Livorno','LI'),array('19512','109','Lodi','LO'),array('19513','109','Lucca','LU'),array('19514','109','Macerata','MC'),array('19515','109','Mantova','MN'),array('19516','109','Massa-Carrara','MS'),array('19517','109','Matera','MT'),array('19518','109','Medio Campidano','MA'),array('19519','109','Messina','ME'),array('19520','109','Milano','MI'),array('19521','109','Modena','MO'),array('19522','109','Napoli','NA'),array('19523','109','Novara','NO'),array('19524','109','Nuoro','NU'),array('19525','109','Ogliastra','OG'),array('19526','109','Olbia-Tempio','OL'),array('19527','109','Oristano','OR'),array('19528','109','Padova','PD'),array('19529','109','Palermo','PA'),array('19530','109','Parma','PR'),array('19531','109','Pavia','PV'),array('19532','109','Perugia','PG'),array('19533','109','Pesaro e Urbino','PS'),array('19534','109','Pescara','PE'),array('19535','109','Piacenza','PC'),array('19536','109','Pisa','PI'),array('19537','109','Pistoia','PT'),array('19538','109','Pordenone','PN'),array('19539','109','Potenza','PZ'),array('19540','109','Prato','PO'),array('19541','109','Ragusa','RG'),array('19542','109','Ravenna','RA'),array('19543','109','Reggio Calabria','RC'),array('19544','109','Reggio Emilia','RE'),array('19545','109','Rieti','RI'),array('19546','109','Rimini','RN'),array('19547','109','Roma','RM'),array('19548','109','Rovigo','RO'),array('19549','109','Salerno','SA'),array('19550','109','Sassari','SS'),array('19551','109','Savona','SV'),array('19552','109','Siena','SI'),array('19553','109','Siracusa','SR'),array('19554','109','Sondrio','SO'),array('19555','109','Taranto','TA'),array('19556','109','Teramo','TE'),array('19557','109','Terni','TR'),array('19558','109','Torino','TO'),array('19559','109','Trapani','TP'),array('19560','109','Trento','TN'),array('19561','109','Treviso','TV'),array('19562','109','Trieste','TS'),array('19563','109','Udine','UD'),array('19564','109','Varese','VA'),array('19565','109','Venezia','VE'),array('19566','109','Verbano-Cusio-Ossola','VB'),array('19567','109','Vercelli','VC'),array('19568','109','Verona','VR'),array('19569','109','Vibo Valentia','VV'),array('19570','109','Vicenza','VI'),array('19571','109','Viterbo','VT'),array('14902','110','Saint Thomas','3'),array('14903','110','Saint Elizabeth','11'),array('14904','110','Saint Ann','6'),array('14905','110','Clarendon','13'),array('14906','110','Kingston','1'),array('14907','110','Portland','4'),array('14908','110','Saint Andrew','2'),array('14909','110','Saint Catherine','14'),array('14910','110','Saint James','8'),array('14911','110','Saint Mary','5'),array('14912','110','Trelawny','7'),array('14913','110','Westmoreland','10'),array('14914','110','Manchester','12'),array('14915','110','Hanover','9'),array('14916','111','Yamagata','6'),array('14917','111','Tottori','31'),array('14918','111','Totigi [Tochigi]','9'),array('14919','111','Siga [Shiga]','25'),array('14920','111','oita [Oita]','44'),array('14921','111','Miyagi','4'),array('14922','111','Saitama','11'),array('14923','111','Simane [Shimane]','32'),array('14924','111','Sizuoka [Shizuoka]','22'),array('14925','111','Tokusima [Tokushima]','36'),array('14926','111','Tokyo [Tokyo]','13'),array('14927','111','Toyama','16'),array('14928','111','Wakayama','30'),array('14929','111','Yamaguti [Yamaguchi]','35'),array('14930','111','Yamanasi [Yamanashi]','19'),array('14931','111','Aiti [Aichi]','23'),array('14932','111','Aomori','2'),array('14933','111','Tiba [Chiba]','12'),array('14934','111','Hukui [Fukui]','18'),array('14935','111','Hukuoka [Fukuoka]','40'),array('14936','111','Gihu [Gifu]','21'),array('14937','111','Gunma','10'),array('14938','111','Hirosima [Hiroshima]','34'),array('14939','111','Hyogo [Hyogo]','28'),array('14940','111','Isikawa [Ishikawa]','17'),array('14941','111','Iwate','3'),array('14942','111','Kagawa','37'),array('14943','111','Kanagawa','14'),array('14944','111','Koti [Kochi]','39'),array('14945','111','Kyoto [Kyoto]','26'),array('14946','111','Mie','24'),array('14947','111','Miyazaki','45'),array('14948','111','Nagano','20'),array('14949','111','Nara','29'),array('14950','111','Niigata','15'),array('14951','111','Okayama','33'),array('14952','111','Okinawa','47'),array('14953','111','Saga','41'),array('14954','111','Akita','5'),array('14955','111','Ehime','38'),array('14956','111','Hukusima [Fukushima]','7'),array('14957','111','Hokkaido [Hokkaido]','1'),array('14958','111','Ibaraki','8'),array('14959','111','Kagosima [Kagoshima]','46'),array('14960','111','Kumamoto','43'),array('14961','111','Nagasaki','42'),array('14962','111','osaka [Osaka]','27'),array('14975','112','At Tafilah','AT'),array('14976','112','Az Zarqa','AZ'),array('14977','112','Maan','MN'),array('14978','112','Amman','AM'),array('14979','112','Al Balqa','BA'),array('14980','112','Jarash','JA'),array('14981','112','Al Mafraq','MA'),array('14982','112','Ajlun','AJ'),array('14983','112','Madaba','MD'),array('14984','112','Al Karak','KA'),array('14985','112','Aqaba','AQ'),array('14986','112','Irbid','IR'),array('14987','113','Zhambyl oblysy','ZH'),array('14988','113','Batys Qazaqstan oblysy','ZA'),array('14989','113','Soltustik Qazaqstan oblysy','SE'),array('14990','113','Qyzylorda oblysy','KZ'),array('14991','113','Aqmola oblysy','AK'),array('14992','113','Aqtobe oblysy','AK'),array('14993','113','Almaty','AL'),array('14994','113','Atyrau oblysy','AT'),array('14995','113','Mangghystau oblysy','MA'),array('14996','113','Shyghys Qazaqstan oblysy','VO'),array('14997','113','Qaraghandy oblysy','KA'),array('14998','113','Pavlodar oblysy','PA'),array('14999','113','Ongtustik Qazaqstan oblysy','YU'),array('15000','113','Qostanay oblysy','KU'),array('20264','113','Almaty oblysy','AL'),array('20265','113','Astana','AS'),array('21376','113','Bayqongyr','BA'),array('15001','114','Nyanza','60'),array('15003','114','Western','90'),array('15004','114','North-Eastern','50'),array('15005','114','Coast','30'),array('15006','114','Eastern','40'),array('15007','114','Rift Valley','70'),array('15009','114','Central','20'),array('15010','114','Nairobi Municipality','11'),array('15018','115','Line Islands','L'),array('15033','115','Phoenix Islands','P'),array('19016','115','Gilbert Islands','G'),array('15053','116','Kangwon-do','KA'),array('21363','116','Pyonganbuk-do','PY'),array('21364','116','Pyongannam-do','PY'),array('21365','116','Yanggang-do','YA'),array('21366','116','Hwanghaenam-do','HW'),array('21367','116','Hwanghaebuk-do','HW'),array('21368','116','Hamgyongnam-do','HA'),array('21369','116','Hamgyongbuk-do','HA'),array('21370','116','Chagang-do','CH'),array('21371','116','Rason','1.10.2001'),array('21372','116','Pyongyang-si','PY'),array('21373','116','Kaesong-si','KA'),array('21374','116','Najin Sonbong-si','NA'),array('21375','116','Nampo-si','NA'),array('15042','117','Gangweondo [Kang-won-do]','42'),array('20246','117','Seoul Teugbyeolsi [Seoul-Tukpyolshi]','11'),array('20247','117','Busan Gwangyeogsi [Pusan-Kwangyokshi]','26'),array('20248','117','Daegu Gwangyeogsi [Taegu-Kwangyokshi]','27'),array('20249','117','Incheon Gwangyeogsi [Inchn-Kwangyokshi]','28'),array('20250','117','Gwangju Gwangyeogsi [Kwangju-Kwangyokshi]','29'),array('20251','117','Daejeon Gwangyeogsi [Taejon-Kwangyokshi]','30'),array('20252','117','Ulsan Gwangyeogsi [Ulsan-Kwangyokshi]','31'),array('20253','117','Gyeonggido [Kyonggi-do]','41'),array('20255','117','Chungcheongbugdo [Chungchongbuk-do]','43'),array('20256','117','Chungcheongnamdo [Chungchongnam-do]','44'),array('20257','117','Jeonrabugdo[Chollabuk-do]','45'),array('20258','117','Jeonranamdo [Chollanam-do]','46'),array('20259','117','Gyeongsangbugdo [Kyongsangbuk-do]','47'),array('20260','117','Gyeongsangnamdo [Kyongsangnam-do]','48'),array('20261','117','Jejudo [Cheju-do]','49'),array('15063','118','Al Jahrah','JA'),array('15064','118','Al Ahmadi','AH'),array('15065','118','Mubarak al-Kabir','MU'),array('15066','118','Al Kuwayt','KU'),array('15067','118','Hawalli','HA'),array('15068','118','Al Farwaniyah','FA'),array('15069','119','Osh','O'),array('15070','119','Batken','B'),array('15071','119','Naryn','N'),array('15072','119','Bishkek','GB'),array('15074','119','Ysyk-Kol','Y'),array('15075','119','Talas','T'),array('15077','119','Jalal-Abad','J'),array('15078','119','Chu','C'),array('15079','120','Xiangkhoang [Xieng Khouang]','XI'),array('15080','120','Attapu [Attopeu]','AT'),array('15081','120','Bokeo','BK'),array('15082','120','Champasak [Champassak]','CH'),array('15083','120','Louang Namtha','LM'),array('15084','120','Oudomxai [Oudomsai]','OU'),array('15085','120','Phongsali [Phong Saly]','PH'),array('15086','120','Savannakhet','SV'),array('15087','120','Vientiane Prefecture','VT'),array('15088','120','Xaignabouli [Sayaboury]','XA'),array('15089','120','Bolikhamxai [Borikhane]','BL'),array('15090','120','Xekong [Sekong]','XE'),array('15091','120','Salavan [Saravane]','SL'),array('15092','120','Louangphabang [Louang Prabang]','LP'),array('15093','120','Houaphan','HO'),array('15094','120','Khammouan','KH'),array('15095','120','Vientiane','VI'),array('15096','120','Xaisomboun','XN'),array('15097','121','Ventspils Aprinkis','VE'),array('15098','121','Ogres Aprinkis','OG'),array('15099','121','Rezekne','RE'),array('15100','121','Rezeknes Aprinkis','RE'),array('15101','121','Rigas Aprinkis','RI'),array('15102','121','Saldus Aprinkis','SA'),array('15103','121','Tukuma Aprinkis','TU'),array('15104','121','Valkas Aprinkis','VK'),array('15105','121','Ventspils','VE'),array('15106','121','Aizkraukles Aprinkis','AI'),array('15107','121','Aluksnes Aprinkis','AL'),array('15108','121','Balvu Aprinkis','BL'),array('15109','121','Bauskas Aprinkis','BU'),array('15110','121','Cesu Aprinkis','CE'),array('15111','121','Daugavpils','DG'),array('15112','121','Daugavpils Aprinkis','DA'),array('15113','121','Dobeles Aprinkis','DO'),array('15114','121','Jekabpils Aprinkis','JK'),array('15115','121','Kraslavas Aprinkis','KR'),array('15116','121','Kuldigas Aprinkis','KU'),array('15117','121','Liepajas Aprinkis','LE'),array('15118','121','Limbazu Aprinkis','LM'),array('15119','121','Madonas Aprinkis','MA'),array('15121','121','Riga','RI'),array('15122','121','Preilu Aprinkis','PR'),array('15123','121','Ludzas Aprinkis','LU'),array('15124','121','Gulbenes Aprinkis','GU'),array('15125','121','Jelgava','JE'),array('15126','121','Jelgavas Aprinkis','JL'),array('15127','121','Jurmala','JU'),array('15128','121','Liepaja','LP'),array('15129','121','Talsu Aprinkis','TA'),array('15130','121','Valmieras Aprinkis','VM'),array('15131','122','Loubnane ech Chemali','AS'),array('15132','122','Nabatiye','NA'),array('15133','122','Jabal Loubnane','JL'),array('15134','122','Beirut','BA'),array('15135','122','El Beqaa','BI'),array('15136','122','Loubnane ej Jnoubi','JA'),array('15137','123','Qachas Nek','H'),array('15138','123','Berea','D'),array('15139','123','Butha-Buthe','B'),array('15140','123','Mafeteng','E'),array('15141','123','Mohales Hoek','F'),array('15142','123','Mokhotlong','J'),array('15143','123','Quthing','G'),array('15144','123','Thaba-Tseka','K'),array('15145','123','Leribe','C'),array('15146','123','Maseru','A'),array('15147','124','Sinoe','SI'),array('15148','124','Bong','BG'),array('15149','124','Rivercess','RI'),array('15150','124','Maryland','MY'),array('15151','124','Grand Gedeh','GG'),array('15152','124','Bomi','BM'),array('15153','124','Grand Bassa','GB'),array('15154','124','Lofa','LO'),array('15155','124','Nimba','NI'),array('15156','124','Grand Cape Mount','CM'),array('15157','124','Montserrado','MO'),array('15158','124','Margibi','MG'),array('19021','124','Gbarpolu','1.10.2001'),array('19022','124','River Gee','1.10.2002'),array('19023','124','Grand Kru','GK'),array('15159','125','Yafran-Jadu','YJ'),array('15160','125','Al Marqab','MB'),array('15161','125','Misratah','MI'),array('15162','125','Nalut','NL'),array('15163','125','Al Qubbah','QB'),array('15164','125','Sabratah Surman','SS'),array('15165','125','Tarabulus','TB'),array('15166','125','Wadi al ayat','WD'),array('15167','125','Al Waah','WA'),array('15168','125','Az Zawiyah','ZA'),array('15169','125','Ajdabiya','AJ'),array('15170','125','Bani Walid','BW'),array('15171','125','Al Butnan','BU'),array('15172','125','Ghadamis','GD'),array('15173','125','Ghat','GT'),array('15174','125','Al Jabal al Akhar','JA'),array('15175','125','Al Jufrah','JU'),array('15176','125','Al Kufrah','KF'),array('15177','125','Banghazi','BA'),array('15178','125','Darnah','DR'),array('15179','125','Gharyan','GR'),array('15180','125','Al izam al Akhar','HZ'),array('15181','125','Al Jifarah','JI'),array('15182','125','Al Marj','MJ'),array('15183','125','Surt','SR'),array('15184','125','Sabha','SB'),array('15185','125','An Nuqat al Khams','NQ'),array('15186','125','Murzuq','MQ'),array('15187','125','Mizdah','MZ'),array('15188','125','Tarhunah-Masallatah','TM'),array('15189','125','Ash Shati','SH'),array('20286','125','Jaghbub','JB'),array('20297','125','Al Qatrun','QT'),array('20303','125','Tajura wa an Nawai Arba','TN'),array('15190','126','Vaduz','11'),array('15191','126','Ruggell','6'),array('15192','126','Gamprin','3'),array('15193','126','Balzers','1'),array('15194','126','Eschen','2'),array('15195','126','Mauren','4'),array('15196','126','Planken','5'),array('15197','126','Schaan','7'),array('15198','126','Triesen','9'),array('15199','126','Triesenberg','10'),array('15200','126','Schellenberg','8'),array('15201','127','Vilniaus Apskritis','VL'),array('15202','127','Panevezio Apskritis','PN'),array('15203','127','Utenos Apskritis','UT'),array('15204','127','siauliu Apskritis','SA'),array('15205','127','Kauno Apskritis','KU'),array('15206','127','Marijampoles Apskritis','MR'),array('15207','127','Telsiu Apskritis','TE'),array('15208','127','Klaipedos Apskritis','KL'),array('15209','127','Alytaus Apskritis','AL'),array('15210','127','Taurages Apskritis','TA'),array('15215','128','Grevenmacher','G'),array('15216','128','Diekirch','D'),array('15220','128','Luxembourg array(fr)','L'),array('15223','130','Veles','VE'),array('15224','130','Berovo','BR'),array('15225','130','Bitola','TL'),array('15227','130','Debar','DB'),array('15228','130','Delcevo','DL'),array('15229','130','Demir Hisar','DM'),array('15230','130','Gevgelija','GV'),array('15231','130','Kavadarci','AV'),array('15232','130','Kocani','OC'),array('15233','130','Gostivar','GT'),array('15234','130','Kicevo','KH'),array('15235','130','Kratovo','KY'),array('15236','130','Krusevo','KS'),array('15237','130','Negotino','NG'),array('15238','130','Ohrid','OD'),array('15239','130','Probistip','PT'),array('15240','130','Resen','RE'),array('15241','130','stip','ST'),array('15242','130','Struga','UG'),array('15243','130','Sveti Nikole','SL'),array('15244','130','Valandovo','VA'),array('15245','130','Vinica','NI'),array('15246','130','Skopje','1.10.2001'),array('15247','130','Radovis','RV'),array('15248','130','Prilep','PP'),array('15249','130','Kriva Palanka','KZ'),array('15250','130','Kumanovo','UM'),array('15251','130','Strumica','RU'),array('15252','130','Tetovo','ET'),array('20121','130','Aerodrom *','AD'),array('20122','130','Aracinovo','AR'),array('20123','130','Bogdanci','BG'),array('20124','130','Bogovinje','VJ'),array('20125','130','Bosilovo','BS'),array('20126','130','Brvenica','BN'),array('20127','130','Butel *','BU'),array('20128','130','Cair *','CI'),array('20129','130','Caska','CA'),array('20130','130','Centar *','CE'),array('20131','130','Centar zupa','CZ'),array('20132','130','Cesinovo-Oblesevo','CH'),array('20133','130','Cucer Sandevo','CS'),array('20134','130','Demir Kapija','DK'),array('20135','130','Dojran','SD'),array('20136','130','Dolneni','DE'),array('20137','130','Drugovo','DR'),array('20138','130','Debarca','DA'),array('20139','130','Kisela Voda *','VD'),array('20140','130','Konce','KN'),array('20141','130','Krivogastani','KG'),array('20142','130','Lipkovo','LI'),array('20143','130','Lozovo','LO'),array('20144','130','Makedonska Kamenica','MK'),array('20145','130','Makedonski Brod','MD'),array('20146','130','Mavrovo-i-Rostusa','MR'),array('20147','130','Mogila','MG'),array('20148','130','Novaci','NV'),array('20149','130','Novo Selo','NS'),array('20150','130','Oslomej','OS'),array('20151','130','Pehcevo','PH'),array('20152','130','Petrovec','PE'),array('20153','130','Plasnica','PN'),array('20154','130','Rankovce','RN'),array('20155','130','Rosoman','RM'),array('20156','130','Saraj *','AJ'),array('20157','130','Sopiste','SS'),array('20158','130','Staro Nagoricane','NA'),array('20159','130','Studenicani','SU'),array('20160','130','Tearce','TR'),array('20161','130','Vasilevo','VL'),array('20162','130','Vevcani','VV'),array('20163','130','Vranestica','VC'),array('20164','130','Vrapciste','VH'),array('20165','130','Zajas','ZA'),array('20166','130','Zelenikovo','ZK'),array('20167','130','Zrnovci','ZR'),array('20169','130','suto Orizari *','SO'),array('20170','130','zelino','ZE'),array('20310','130','Gazi Baba *','GB'),array('20311','130','Gjorce Petrov *','GP'),array('20312','130','Gradsko','GR'),array('20313','130','Ilinden','IL'),array('20314','130','Jegunovce','JG'),array('20315','130','Karbinci','KB'),array('20316','130','Karpos *','KX'),array('15253','131','Toamasina','A'),array('15254','131','Antsiranana','D'),array('15255','131','Antananarivo','T'),array('15256','131','Toliara','U'),array('15257','131','Mahajanga','M'),array('15258','131','Fianarantsoa','F'),array('15261','132','Blantyre','BL'),array('15262','132','Chiradzulu','CR'),array('15263','132','Dedza','DE'),array('15264','132','Dowa','DO'),array('15265','132','Kasungu','KS'),array('15267','132','Machinga','MH'),array('15268','132','Mangochi','MG'),array('15269','132','Mulanje','MU'),array('15270','132','Mwanza','MW'),array('15272','132','Nkhotakota','NK'),array('15273','132','Nsanje','NS'),array('15274','132','Ntchisi','NI'),array('15275','132','Phalombe','PH'),array('15276','132','Salima','SA'),array('15277','132','Thyolo','TH'),array('15278','132','Zomba','ZO'),array('15279','132','Balaka','BA'),array('15280','132','Chikwawa','CK'),array('15281','132','Chitipa','CT'),array('15282','132','Nkhata Bay','NB'),array('15283','132','Mzimba','MZ'),array('15284','132','Mchinji','MC'),array('15285','132','Karonga','KR'),array('15286','132','Lilongwe','LI'),array('15287','132','Ntcheu','NU'),array('15288','132','Rumphi','RU'),array('19024','132','Likoma Island','LK'),array('15289','133','Terengganu','11'),array('15290','133','Johor','1'),array('15291','133','Kelantan','3'),array('15292','133','Wilayah Persekutuan Labuan','15'),array('15293','133','Melaka','4'),array('15294','133','Pahang','6'),array('15295','133','Perak','8'),array('15296','133','Pulau Pinang','7'),array('15297','133','Sabah','12'),array('15298','133','Selangor','10'),array('15299','133','Kedah','2'),array('15300','133','Wilayah Persekutuan Kuala Lumpur','14'),array('15301','133','Negeri Sembilan','5'),array('15302','133','Perlis','9'),array('15303','133','Sarawak','13'),array('19025','133','Wilayah Persekutuan Putrajaya','16'),array('15304','134','Thaa','8'),array('15305','134','Kaafu','26'),array('15306','134','Gnaviyani','29'),array('15307','134','Alif','2'),array('15308','134','Alif Dhaal','1.10.2001'),array('15309','134','Baa','20'),array('15310','134','Dhaalu','17'),array('15311','134','Faafu','14'),array('15312','134','Gaaf Alif','27'),array('15313','134','Gaafu Dhaalu','28'),array('15314','134','Haa Alif','7'),array('15315','134','Haa Dhaalu','23'),array('15316','134','Laamu','5'),array('15317','134','Male','ML'),array('15318','134','Raa','13'),array('15319','134','Seenu','1'),array('15320','134','Vaavu','4'),array('15321','134','Lhaviyani','3'),array('15322','134','Shaviyani','24'),array('15323','134','Noonu','25'),array('15324','134','Meemu','12'),array('15325','135','Tombouctou','6'),array('15326','135','Mopti','5'),array('15327','135','Bamako','BK'),array('15328','135','Kidal','8'),array('15329','135','Gao','7'),array('15330','135','Kayes','1'),array('15331','135','Koulikoro','2'),array('15332','135','Segou','4'),array('15333','135','Sikasso','3'),array('15340','137','Wotje','WT'),array('15341','137','Wotho','WT'),array('15342','137','Ujelang','UJ'),array('15344','137','Namu','NM'),array('15345','137','Majuro','MA'),array('15347','137','Ailuk','AL'),array('15348','137','Arno','AR'),array('15351','137','Ebon','EB'),array('15353','137','Jaluit','JA'),array('15355','137','Kwajalein','KW'),array('15356','137','Lib','LI'),array('15357','137','Likiep','LI'),array('15358','137','Maloelap','MA'),array('15359','137','Mili','MI'),array('15360','137','Namorik','NM'),array('15361','137','Rongelap','RO'),array('15362','137','Ailinglapalap','AL'),array('15363','137','Aur','AU'),array('15365','137','Eniwetok','EN'),array('15367','137','Kili','KI'),array('15368','137','Lae','LA'),array('15369','137','Mejit','ME'),array('15371','137','Ujae','UJ'),array('15372','137','Utirik','UT'),array('15377','139','Trarza','6'),array('15378','139','Assaba','3'),array('15379','139','Adrar','7'),array('15380','139','Dakhlet Nouadhibou','8'),array('15381','139','Hodh el Gharbi','2'),array('15382','139','Inchiri','12'),array('15383','139','Tiris Zemmour','11'),array('15384','139','Brakna','5'),array('15385','139','Tagant','9'),array('15386','139','Hodh ech Chargui','1'),array('15387','139','Gorgol','4'),array('15388','139','Guidimaka','10'),array('15389','139','Nouakchott','NK'),array('15390','140','Savanne','SA'),array('15391','140','Plaines Wilhems','PW'),array('15392','140','Black River','BL'),array('15393','140','Grand Port','GP'),array('15394','140','Moka','MO'),array('15395','140','Flacq','FL'),array('15396','140','Pamplemousses','PA'),array('15397','140','Port Louis City','PL'),array('15398','140','Rodrigues Island','RO'),array('15399','140','Riviere du Rempart','RR'),array('19026','140','Agalega Islands','AG'),array('19027','140','Beau Bassin-Rose Hill','BR'),array('19028','140','Cargados Carajos Shoals [Saint Brandon Islands]','CC'),array('19029','140','Curepipe','CU'),array('19030','140','Port Louis District','PU'),array('19032','140','Vacoas-Phoenix','VP'),array('19033','140','Quatre Bornes','QB'),array('15402','142','Yucatan','YU'),array('15403','142','Nuevo Leon','NL'),array('15404','142','Puebla','PU'),array('15405','142','Queretaro','QU'),array('15406','142','San Luis Potosi','SL'),array('15407','142','Sinaloa','SI'),array('15408','142','Tabasco','TA'),array('15409','142','Tlaxcala','TL'),array('15410','142','Veracruz','VE'),array('15411','142','Zacatecas','ZA'),array('15412','142','Baja California','BC'),array('15413','142','Baja California Sur','BC'),array('15414','142','Chiapas','CH'),array('15415','142','Coahuila','CO'),array('15416','142','Colima','CO'),array('15417','142','Durango','DU'),array('15418','142','Guanajuato','GU'),array('15419','142','Hidalgo','HI'),array('15420','142','Jalisco','JA'),array('15421','142','Michoacan','MI'),array('15422','142','Morelos','MO'),array('15423','142','Aguascalientes','AG'),array('15424','142','Campeche','CA'),array('15425','142','Chihuahua','CH'),array('15426','142','Distrito Federal','DI'),array('15427','142','Guerrero','GR'),array('15428','142','Mexico','ME'),array('15429','142','Nayarit','NA'),array('15430','142','Oaxaca','OA'),array('15431','142','Tamaulipas','TA'),array('15432','142','Quintana Roo','RO'),array('15433','142','Sonora','SO'),array('15434','143','Pohnpei','PN'),array('15436','143','Kosrae','KS'),array('15437','143','Chuuk','TR'),array('15438','143','Yap','YA'),array('15446','144','Gagauzia, Unitate Teritoriala Autonoma array(UTAG)','GA'),array('15451','144','Orhei','OR'),array('15453','144','Balti','BA'),array('15455','144','Cahul','CA'),array('15459','144','Chisinau','CU'),array('15466','144','Soroca','SO'),array('15469','144','Tighina [Bender]','TI'),array('15470','144','Ungheni','UN'),array('15477','144','Edinet','ED'),array('15481','144','Taraclia','TA'),array('20171','144','Lapusna','LA'),array('20172','144','Stinga Nistrului, unitatea teritoriala din','SN'),array('20309','144','Chisinau City','CH'),array('15486','146','Ulaanbaatar','1'),array('15487','146','Selenge','4'),array('15488','146','Hovsgol','4'),array('15489','146','Dundgovi','5'),array('15490','146','Bayan-olgiy','7'),array('15491','146','Bayanhongor','6'),array('15492','146','Bulgan','6'),array('15493','146','Darhan uul','3'),array('15494','146','Dornogovi','6'),array('15495','146','Govi-Altay','6'),array('15496','146','Hentiy','3'),array('15497','146','Hovd','4'),array('15498','146','omnogovi','5'),array('15499','146','ovorhangay','5'),array('15500','146','Suhbaatar','5'),array('15501','146','Tov','4'),array('15502','146','Uvs','4'),array('15503','146','Dzavhan','5'),array('15504','146','Arhangay','7'),array('15505','146','Dornod','6'),array('15506','146','Govi-Sumber','6'),array('15507','146','Orhon','3'),array('42597','147','savnik','18'),array('42598','147','Cetinje','6'),array('42599','147','Herceg-Novi','8'),array('42600','147','Ulcinj','20'),array('42601','147','Tivat','19'),array('42602','147','Rozaje','17'),array('42603','147','Podgorica','16'),array('42604','147','Pljevlja','14'),array('42605','147','Pluzine','15'),array('42606','147','Plav','13'),array('42607','147','Niksic','12'),array('42608','147','Mojkovac','11'),array('42609','147','Kotor','10'),array('42610','147','Kolasin','9'),array('42611','147','zabljak','21'),array('42612','147','Danilovgrad','7'),array('42613','147','Budva','5'),array('42614','147','Bijelo Polje','4'),array('42615','147','Berane','3'),array('42616','147','Bar','2'),array('42617','147','Andrijevica','1'),array('15516','149','Al Hoceima','HO'),array('15517','149','Tiznit','TI'),array('15518','149','Ait Baha','BA'),array('15520','149','Guelmim','GU'),array('15521','149','Tata','TA'),array('15522','149','Chichaoua','CH'),array('15523','149','Essaouira','ES'),array('15524','149','El Hajeb','HA'),array('15525','149','Ifrane','IF'),array('15526','149','Berkane','BE'),array('15527','149','Nador','NA'),array('15532','149','Rabat-Sale*','RB'),array('15535','149','Safi','SA'),array('15536','149','Fes*','FE'),array('15538','149','Sidi Kacem','SI'),array('15541','149','Assa-Zag','AS'),array('15542','149','Tan-Tan','TN'),array('15543','149','Al Haouz','HA'),array('15544','149','Kelaat Sraghna','KE'),array('15545','149','Marrakech*','MA'),array('15546','149','Meknes*','ME'),array('15547','149','Errachidia','ER'),array('15548','149','Khenifra','KH'),array('15549','149','Figuig','FI'),array('15550','149','Jerada','JR'),array('15551','149','Oujda*','OU'),array('15552','149','Khemisset','KH'),array('15554','149','Agadir*','AG'),array('15555','149','Ait Melloul','ME'),array('15556','149','Taroudannt','TA'),array('15558','149','Beni Mellal','BE'),array('15559','149','Chefchaouene','CH'),array('15560','149','Larache','LA'),array('15561','149','Tetouan*','TE'),array('15562','149','Taounate','TA'),array('15563','149','Taza','TA'),array('15572','149','Ben Slimane','BE'),array('15573','149','Khouribga','KH'),array('15574','149','Settat','SE'),array('15575','149','El Jadida','JD'),array('15576','149','Boulemane','BO'),array('15577','149','Sefrou','SE'),array('15578','149','Kenitra','KE'),array('15579','149','Casablanca [Dar el Beida]*','CA'),array('15582','149','Ouarzazate','OU'),array('15583','149','Azilal','AZ'),array('15584','149','Tanger','TN'),array('20173','149','Boujdour array(EH)','BO'),array('20174','149','Es Smara array(EH)','ES'),array('20175','149','Laayoune* array(EH)','LA'),array('20176','149','Oued ed Dahab array(EH)','OU'),array('21378','149','Laayoune-Boujdour-Sakia El Hamra','1.10.2001'),array('15589','150','Inhambane','I'),array('15590','150','Manica','B'),array('15591','150','Maputo','L'),array('15592','150','Niassa','A'),array('15593','150','Tete','T'),array('15599','150','Cabo Delgado','P'),array('15602','150','Gaza','G'),array('15603','150','Maputo City','MP'),array('15604','150','Nampula','N'),array('15605','150','Sofala','S'),array('15606','150','Zambezia','Q'),array('15607','151','Tanintharyi','5'),array('15608','151','Ayeyarwady','7'),array('15609','151','Bago','2'),array('15610','151','Kachin','11'),array('15611','151','Kayin','13'),array('15612','151','Magway','3'),array('15613','151','Mon','15'),array('15614','151','Sagaing','1'),array('15615','151','Shan','17'),array('15616','151','Yangon','6'),array('15617','151','Chin','14'),array('15618','151','Kayah','12'),array('15619','151','Rakhine','16'),array('15620','151','Mandalay','4'),array('15621','152','Oshikoto','OT'),array('15622','152','Omaheke','OH'),array('15623','152','Hardap','HA'),array('15624','152','Khomas','KH'),array('15625','152','Caprivi','CA'),array('15626','152','Erongo','ER'),array('15627','152','Karas','KA'),array('15628','152','Okavango','OK'),array('15629','152','Kunene','KU'),array('15630','152','Ohangwena','OW'),array('15631','152','Omusati','OS'),array('15632','152','Oshana','ON'),array('15633','152','Otjozondjupa','OD'),array('15635','153','Yaren','14'),array('15636','153','Nibok','12'),array('15637','153','Anabar','2'),array('15638','153','Uaboe','13'),array('15639','153','Ijuw','10'),array('15640','153','Buada','7'),array('15641','153','Anibare','4'),array('15642','153','Aiwo','1'),array('15643','153','Anetan','3'),array('15644','153','Boe','6'),array('15645','153','Ewa','9'),array('15646','153','Meneng','11'),array('15647','153','Baiti','5'),array('15648','153','Denigomodu','8'),array('20177','154','Bagmati','BA'),array('20178','154','Bheri','BH'),array('20179','154','Dhawalagiri','DH'),array('20180','154','Gandaki','GA'),array('20181','154','Janakpur','JA'),array('20182','154','Karnali','KA'),array('20183','154','Kosi [Koshi]','KO'),array('20184','154','Lumbini','LU'),array('20185','154','Mahakali','MA'),array('20186','154','Mechi','ME'),array('20187','154','Narayani','NA'),array('20188','154','Rapti','RA'),array('20189','154','Sagarmatha','SA'),array('20190','154','Seti','SE'),array('15725','155','Utrecht','UT'),array('15726','155','Gelderland','GE'),array('15727','155','Drenthe','DR'),array('15728','155','Zeeland','ZE'),array('15729','155','Noord-Brabant','NB'),array('15730','155','Friesland','FR'),array('15731','155','Flevoland','FL'),array('15732','155','Groningen','GR'),array('15733','155','Overijssel','OV'),array('15734','155','Zuid-Holland','ZH'),array('15735','155','Limburg','LI'),array('15736','155','Noord-Holland','NH'),array('15746','158','Waikato','WK'),array('15747','158','Northland','NT'),array('15748','158','Auckland','AU'),array('15749','158','Gisborne','GI'),array('15750','158','Manawatu-Wanganui','MW'),array('15751','158','Taranaki','TK'),array('15753','158','Bay of Plenty','BO'),array('15754','158','Canterbury','CA'),array('15755','158','Hawkess Bay','HK'),array('15756','158','Marlborough','MB'),array('15757','158','Nelson','NS'),array('15758','158','Otago','OT'),array('15759','158','Southland','ST'),array('15760','158','Tasman','TA'),array('15761','158','Wellington','WG'),array('15762','158','West Coast','WT'),array('19036','158','Chatham Islands','1.10.2001'),array('15763','159','Rio San Juan','SJ'),array('15764','159','Masaya','MS'),array('15765','159','Chontales','CO'),array('15766','159','Carazo','CA'),array('15767','159','Nueva Segovia','NS'),array('15768','159','Managua','MN'),array('15769','159','Jinotega','JI'),array('15770','159','Chinandega','CI'),array('15771','159','Atlantico Sur*','AS'),array('15772','159','Boaco','BO'),array('15773','159','Esteli','ES'),array('15774','159','Leon','LE'),array('15775','159','Matagalpa','MT'),array('15776','159','Rivas','RI'),array('15777','159','Granada','GR'),array('15778','159','Madriz','MD'),array('15779','159','Atlantico Norte*','AN'),array('15782','160','Agadez','1'),array('15783','160','Diffa','2'),array('15784','160','Dosso','3'),array('15785','160','Maradi','4'),array('15786','160','Niamey','8'),array('15787','160','Tahoua','5'),array('15788','160','Tillaberi','6'),array('15789','160','Zinder','7'),array('15792','161','Zamfara','ZA'),array('15793','161','Taraba','TA'),array('15794','161','Nassarawa','NA'),array('15795','161','Ondo','ON'),array('15796','161','Plateau','PL'),array('15797','161','Kogi','KO'),array('15798','161','Imo','IM'),array('15799','161','Delta','DE'),array('15801','161','Abuja Capital Territory','FC'),array('15802','161','Adamawa','AD'),array('15803','161','Akwa Ibom','AK'),array('15804','161','Anambra','AN'),array('15805','161','Bauchi','BA'),array('15806','161','Borno','BO'),array('15807','161','Ekiti','EK'),array('15808','161','Kebbi','KE'),array('15809','161','Kwara','KW'),array('15810','161','Lagos','LA'),array('15811','161','Niger','NI'),array('15812','161','Ogun','OG'),array('15813','161','Osun','OS'),array('15814','161','Oyo','OY'),array('15815','161','Rivers','RI'),array('15816','161','Sokoto','SO'),array('15817','161','Benue','BE'),array('15818','161','Cross River','CR'),array('15819','161','Ebonyi','EB'),array('15820','161','Edo','ED'),array('15821','161','Enugu','EN'),array('15822','161','Gombe','GO'),array('15823','161','Jigawa','JI'),array('15824','161','Kaduna','KD'),array('15825','161','Katsina','KT'),array('15826','161','Bayelsa','BY'),array('15827','161','Yobe','YO'),array('15828','161','Kano','KN'),array('21217','161','Abia','AB'),array('15848','165','Vest-Agder','10'),array('15849','165','Sor-Trondelag','16'),array('15850','165','ostfold','1'),array('15851','165','Nord-Trondelag','17'),array('15852','165','Finnmark','20'),array('15853','165','Aust-Agder','9'),array('15854','165','Buskerud','6'),array('15855','165','Hedmark','4'),array('15856','165','More og Romsdal','15'),array('15857','165','Nordland','18'),array('15858','165','Oppland','5'),array('15859','165','Oslo','3'),array('15860','165','Rogaland','11'),array('15861','165','Sogn og Fjordane','14'),array('15862','165','Telemark','8'),array('15863','165','Troms','19'),array('15864','165','Vestfold','7'),array('15866','165','Akershus','2'),array('15867','165','Hordaland','12'),array('19038','165','Jan Mayen array(Arctic Region) array(See also country code SJ)','22'),array('19039','165','Svalbard array(Arctic Region) array(See also country code SJ)','21'),array('15868','166','Adh Dhahirah','ZA'),array('15869','166','Dhofar','JA'),array('15870','166','Ash Sharqiyah','SH'),array('15871','166','Ad Dakhiliyah','DA'),array('15872','166','Al Wusta','WU'),array('15873','166','Al Batinah','BA'),array('15874','166','Musandam','MU'),array('15875','166','Masqat','MA'),array('21361','166','Al Buraymi','1.10.2001'),array('15876','167','Punjab','PB'),array('15877','167','Northern Areas','NA'),array('15878','167','Federally Administered Tribal Areas','TA'),array('15879','167','North-West Frontier','NW'),array('15880','167','Sind array(en)','SD'),array('15881','167','Baluchistan array(en)','BA'),array('15882','167','Azad Kashmir','JK'),array('15883','167','Islamabad','IS'),array('15884','168','Sonsorol','37'),array('15885','168','Ngeremlengui','22'),array('15886','168','Hatobohei','5'),array('15887','168','Aimeliik','0'),array('15888','168','Melekeok','21'),array('15889','168','Angaur','1'),array('15890','168','Kayangel','10'),array('15891','168','Koror','15'),array('15892','168','Ngaraard','21'),array('15893','168','Ngardmau','22'),array('15894','168','Ngatpang','22'),array('15895','168','Ngchesar','22'),array('15896','168','Ngiwal','22'),array('15897','168','Peleliu','35'),array('15898','168','Airai','0'),array('15899','168','Ngarchelong','21'),array('15916','170','Panama','8'),array('15917','170','Los Santos','7'),array('15920','170','Chiriqui','4'),array('15921','170','Colon','3'),array('15922','170','Darien','5'),array('15923','170','Herrera','6'),array('15925','170','Comarca de San Blas','0'),array('15927','170','Veraguas','9'),array('15928','170','Bocas del Toro','1'),array('15929','170','Cocle','2'),array('15931','171','Chimbu','CP'),array('15932','171','New Ireland','NI'),array('15933','171','Manus','MR'),array('15934','171','Enga','EP'),array('15935','171','Central','CP'),array('15936','171','Eastern Highlands','EH'),array('15937','171','East Sepik','ES'),array('15938','171','Western','WP'),array('15939','171','Madang','MP'),array('15940','171','Milne Bay','MB'),array('15941','171','Morobe','MP'),array('15942','171','North Solomons','NS'),array('15943','171','Sandaun [West Sepik]','SA'),array('15944','171','Southern Highlands','SH'),array('15945','171','West New Britain','WB'),array('15946','171','East New Britain','EB'),array('15947','171','Gulf','GP'),array('15948','171','National Capital District array(Port Moresby)','NC'),array('15949','171','Northern','NP'),array('15950','171','Western Highlands','WH'),array('15951','172','Paraguari','9'),array('15952','172','Central','11'),array('15953','172','Boqueron','19'),array('15954','172','Asuncion','AS'),array('15955','172','Caaguazu','5'),array('15956','172','Canindeyu','14'),array('15957','172','Concepcion','1'),array('15958','172','Cordillera','3'),array('15959','172','Itapua','7'),array('15960','172','neembucu','12'),array('15961','172','Presidente Hayes','15'),array('15962','172','San Pedro','2'),array('15963','172','Alto Paraguay','16'),array('15964','172','Alto Parana','10'),array('15965','172','Amambay','13'),array('15966','172','Caazapa','6'),array('15967','172','Guaira','4'),array('15968','172','Misiones','8'),array('15969','173','Lima','LI'),array('15970','173','Madre de Dios','MD'),array('15971','173','Ica','IC'),array('15972','173','Arequipa','AR'),array('15973','173','Lambayeque','LA'),array('15974','173','Loreto','LO'),array('15975','173','Moquegua','MO'),array('15976','173','Piura','PI'),array('15977','173','Puno','PU'),array('15978','173','Tacna','TA'),array('15979','173','Tumbes','TU'),array('15981','173','Ancash','AN'),array('15982','173','Amazonas','AM'),array('15983','173','Apurimac','AP'),array('15984','173','Ayacucho','AY'),array('15985','173','Cajamarca','CA'),array('15986','173','Huancavelica','HU'),array('15987','173','Huanuco','HU'),array('15988','173','Junin','JU'),array('15989','173','Cuzco [Cusco]','CU'),array('15990','173','La Libertad','LA'),array('15991','173','Pasco','PA'),array('15992','173','El Callao','CA'),array('15993','173','Ucayali','UC'),array('15994','173','San Martin','SA'),array('42646','173','Lima Metropolitana','1.10.2001'),array('16144','174','Quirino','QU'),array('16301','174','Lanao del Sur','LA'),array('16302','174','Sulu','SL'),array('16303','174','Albay','AL'),array('16304','174','Camarines Norte','CA'),array('16305','174','Catanduanes','CA'),array('16306','174','Sorsogon','SO'),array('16307','174','Batanes','BT'),array('16308','174','Isabela','IS'),array('16310','174','Agusan del Norte','AG'),array('16311','174','Surigao del Norte','SU'),array('16312','174','Bataan','BA'),array('16313','174','Nueva Ecija','NU'),array('16314','174','Pampanga','PA'),array('16315','174','Benguet','BE'),array('16316','174','Ifugao','IF'),array('16317','174','Mountain Province','MO'),array('16318','174','Eastern Samar','EA'),array('16320','174','Western Samar','WS'),array('16321','174','Ilocos Norte','IL'),array('16322','174','La Union','LU'),array('16323','174','Pangasinan','PA'),array('16333','174','Bukidnon','BU'),array('16334','174','Camiguin','CA'),array('16335','174','Misamis Oriental','MS'),array('16336','174','Davao del Norte','DA'),array('16337','174','Davao Oriental','DA'),array('16338','174','South Cotabato','SC'),array('16340','174','Cavite','CA'),array('16341','174','Laguna','LA'),array('16342','174','Mindoro Occidental','MD'),array('16343','174','Palawan','PL'),array('16346','174','Zamboanga del Norte','ZA'),array('16347','174','Aklan','AK'),array('16348','174','Antique','AN'),array('16349','174','Guimaras','GU'),array('16350','174','Negros Occidental','NE'),array('16521','174','Dinagat','1.10.2001'),array('16765','174','Leyte','LE'),array('17082','174','Romblon','RO'),array('17115','174','Aurora','AU'),array('17214','174','Abra','AB'),array('17215','174','Apayao','AP'),array('17216','174','Kalinga','KA'),array('17217','174','Biliran','BI'),array('17218','174','Northern Samar','NS'),array('17219','174','Southern Leyte','SL'),array('17220','174','Ilocos Sur','IL'),array('17229','174','Misamis Occidental','MS'),array('17230','174','Compostela Valley','CO'),array('17231','174','Davao del Sur','DA'),array('17232','174','Sarangani','SA'),array('17233','174','Batangas','BT'),array('17234','174','Marinduque','MA'),array('17235','174','Mindoro Oriental','MD'),array('17237','174','Basilan','BA'),array('17238','174','Zamboanga del Sur','ZA'),array('17239','174','Capiz','CA'),array('17240','174','Iloilo','IL'),array('17287','174','Maguindanao','MA'),array('17288','174','Tawi-Tawi','TA'),array('17289','174','Camarines Sur','CA'),array('17290','174','Masbate','MA'),array('17291','174','Cagayan','CA'),array('17292','174','Nueva Vizcaya','NU'),array('17293','174','Agusan del Sur','AG'),array('17294','174','Surigao del Sur','SU'),array('17295','174','Bulacan','BU'),array('17296','174','Tarlac','TA'),array('17297','174','Zambales','ZM'),array('17298','174','North Cotabato','NC'),array('17300','174','Lanao del Norte','LA'),array('17302','174','Sultan Kudarat','SU'),array('17303','174','Bohol','BO'),array('17304','174','Cebu','CE'),array('17305','174','Negros Oriental','NE'),array('17306','174','Siquijor','SI'),array('17583','174','Rizal','RI'),array('17595','174','Quezon','QU'),array('17672','174','Zamboanga Sibuguey [Zamboanga Sibugay]','ZS'),array('21362','174','Shariff Kabunsuan','1.10.2002'),array('48079','174','','MN'),array('17730','176','Zachodniopomorskie','ZP'),array('17731','176','Dolnoslaskie','DS'),array('17732','176','Kujawsko-pomorskie','KP'),array('17733','176','Lubelskie','LU'),array('17734','176','Lodzkie','LD'),array('17735','176','Mazowieckie','MZ'),array('17736','176','Podkarpackie','PK'),array('17737','176','Pomorskie','PM'),array('17738','176','Swietokrzyskie','SK'),array('17739','176','Wielkopolskie','WP'),array('17740','176','Lubuskie','LB'),array('17741','176','Warminsko-mazurskie','WN'),array('17742','176','Podlaskie','PD'),array('17743','176','Opolskie','OP'),array('17744','176','Malopolskie','MA'),array('17745','176','Slaskie','SL'),array('17748','177','Regiao Autonoma dos Acores','20'),array('17751','177','Regiao Autonoma da Madeira','30'),array('19045','177','Aveiro','1'),array('19046','177','Beja','2'),array('19047','177','Braga','3'),array('19048','177','Braganca','4'),array('19049','177','Castelo Branco','5'),array('19050','177','Coimbra','6'),array('19051','177','evora','7'),array('19052','177','Faro','8'),array('19053','177','Guarda','9'),array('19054','177','Leiria','10'),array('19055','177','Lisboa','11'),array('19056','177','Portalegre','12'),array('19057','177','Porto','13'),array('19058','177','Santarem','14'),array('19059','177','Setubal','15'),array('19060','177','Viana do Castelo','16'),array('19061','177','Vila Real','17'),array('19062','177','Viseu','18'),array('17762','179','Umm Salal','US'),array('17763','179','Al Wakrah','WA'),array('17764','179','Al Jumayliyah','JU'),array('17765','179','Al Khawr','KH'),array('17766','179','Madinat ash Shamal','MS'),array('17767','179','Umm Said','1.10.2001'),array('17768','179','Jariyan al Batnah','JB'),array('17769','179','Ad Dawhah','DA'),array('17770','179','Al Ghuwayriyah','GH'),array('17771','179','Ar Rayyan','RA'),array('17781','181','Vrancea','VN'),array('17782','181','Ialomita','IL'),array('17783','181','Brasov','BV'),array('17784','181','Buzau','BZ'),array('17785','181','Caras-Severin','CS'),array('17786','181','Constanta','CT'),array('17787','181','Dambovita','DB'),array('17788','181','Dolj','DJ'),array('17789','181','Giurgiu','GR'),array('17790','181','Gorj','GJ'),array('17791','181','Hunedoara','HD'),array('17792','181','Iasi','IS'),array('17793','181','Maramures','MM'),array('17794','181','Alba','AB'),array('17795','181','Arad','AR'),array('17796','181','Arges','AG'),array('17797','181','Bacau','BC'),array('17798','181','Bihor','BH'),array('17799','181','Bistrita-Nasaud','BN'),array('17800','181','Botosani','BT'),array('17801','181','Braila','BR'),array('17802','181','Bucuresti','B'),array('17803','181','Calarasi','CL'),array('17804','181','Cluj','CJ'),array('17805','181','Covasna','CV'),array('17806','181','Galati','GL'),array('17807','181','Harghita','HR'),array('17808','181','Mehedinti','MH'),array('17809','181','Neamt','NT'),array('17810','181','Prahova','PH'),array('17811','181','Salaj','SJ'),array('17812','181','Sibiu','SB'),array('17813','181','Suceava','SV'),array('17814','181','Timis','TM'),array('17815','181','Tulcea','TL'),array('17816','181','Vaslui','VS'),array('17817','181','Ilfov','IF'),array('17818','181','Valcea','VL'),array('17819','181','Satu Mare','SM'),array('17820','181','Olt','OT'),array('17821','181','Mures','MS'),array('17822','181','Teleorman','TR'),array('17823','182','Vologodskaya oblast','VL'),array('17824','182','Tatarstan, Respublika','TA'),array('17825','182','Primorskiy kray','PR'),array('17826','182','Ryazanskaya oblast','RY'),array('17827','182','Sakha, Respublika [Yakutiya]','SA'),array('17828','182','Sakhalinskaya oblast','SA'),array('17829','182','Sankt-Peterburg','SP'),array('17830','182','Smolenskaya oblast','SM'),array('17831','182','Stavropolskiy kray','ST'),array('17832','182','Sverdlovskaya oblast','SV'),array('17833','182','Tambovskaya oblast','TA'),array('17834','182','Mariy El, Respublika','ME'),array('17835','182','Moskva','MO'),array('17836','182','Moskovskaya oblast','MO'),array('17837','182','Nenetskiy avtonomnyy okrug','NE'),array('17838','182','Nizhegorodskaya oblast','NI'),array('17839','182','Novosibirskaya oblast','NV'),array('17840','182','Orenburgskaya oblast','OR'),array('17841','182','Orlovskaya oblast','OR'),array('17842','182','Perm','PE'),array('17843','182','Kemerovskaya oblast','KE'),array('17844','182','Kirovskaya oblast','KI'),array('17845','182','Komi, Respublika','KO'),array('17846','182','Komi-Permyak','1.10.2001'),array('17847','182','Kostromskaya oblast','KO'),array('17848','182','Krasnoyarskiy kray','KY'),array('17849','182','Kurganskaya oblast','KG'),array('17850','182','Leningradskaya oblast','LE'),array('17851','182','Magadanskaya oblast','MA'),array('17852','182','Severnaya Osetiya, Respublika [Alaniya] [Respublika Severnaya Osetiya-Alaniya]','SE'),array('17853','182','Arkhangelskaya oblast','AR'),array('17854','182','Belgorodskaya oblast','BE'),array('17855','182','Chechenskaya Respublika','CE'),array('17856','182','Chuvashskaya Respublika','CU'),array('17857','182','Altay, Respublika','AL'),array('17858','182','Khanty-Mansiyskiy avtonomnyy okrug [Yugra]','KH'),array('17859','182','Ivanovskaya oblast','IV'),array('17860','182','Koryakskiy avtonomnyy okrug','KO'),array('17861','182','Krasnodarskiy kray','KD'),array('17862','182','Kurskaya oblast','KR'),array('17863','182','Lipetskaya oblast','LI'),array('17864','182','Mordoviya, Respublika','MO'),array('17865','182','Murmanskaya oblast','MU'),array('17866','182','Novgorodskaya oblast','NG'),array('17867','182','Omskaya oblast','OM'),array('17868','182','Penzenskaya oblast','PN'),array('17869','182','Pskovskaya oblast','PS'),array('17870','182','Rostovskaya oblast','RO'),array('17871','182','Samarskaya oblast','SA'),array('17872','182','Saratovskaya oblast','SA'),array('17873','182','Taymyrskiy array(Dolgano-Nenetskiy) avtonomnyy okrug','TA'),array('17874','182','Tyumenskaya oblast','TY'),array('17875','182','Tulskaya oblast','TU'),array('17876','182','Udmurtskaya Respublika','UD'),array('17877','182','Vladimirskaya oblast','VL'),array('17878','182','Voronezhskaya oblast','VO'),array('17879','182','Adygeya, Respublika','AD'),array('17880','182','Aginskiy Buryatskiy avtonomnyy okrug','AG'),array('17881','182','Altayskiy kray','AL'),array('17882','182','Amurskaya oblast','AM'),array('17883','182','Astrakhanskaya oblast','AS'),array('17884','182','Bashkortostan, Respublika','BA'),array('17885','182','Bryanskaya oblast','BR'),array('17886','182','Buryatiya, Respublika','BU'),array('17887','182','Chelyabinskaya oblast','CH'),array('17888','182','Chitinskaya oblast','CH'),array('17889','182','Chukotskiy avtonomnyy okrug','CH'),array('17890','182','Dagestan, Respublika','DA'),array('17891','182','Evenkiyskiy avtonomnyy okrug','EV'),array('17892','182','Khabarovskiy kray','KH'),array('17893','182','Khakasiya, Respublika','KK'),array('17894','182','Ingushskaya Respublika [Respublika Ingushetiya]','IN'),array('17895','182','Irkutskaya oblast','IR'),array('17896','182','Yamalo-Nenetskiy avtonomnyy okrug','YA'),array('17897','182','Yaroslavskaya oblast','YA'),array('17898','182','Yevreyskaya avtonomnaya oblast','YE'),array('17899','182','Kabardino-Balkarskaya Respublika','KB'),array('17900','182','Kaliningradskaya oblast','KG'),array('17901','182','Kalmykiya, Respublika','KL'),array('17902','182','Kaluzhskaya oblast','KL'),array('17903','182','Kamchatskaya oblast','KA'),array('17904','182','Karachayevo-Cherkesskaya Respublika','KC'),array('17905','182','Kareliya, Respublika','KR'),array('17906','182','Tomskaya oblast','TO'),array('17907','182','Volgogradskaya oblast','VG'),array('17908','182','Ulyanovskaya oblast','UL'),array('17909','182','Tyva, Respublika [Tuva]','TY'),array('17910','182','Tverskaya oblast','TV'),array('17911','182','Ust-Ordynskiy Buryatskiy avtonomnyy okrug','UO'),array('17912','183','Sud','5'),array('17923','183','Ville de Kigali','1'),array('19063','183','Est','2'),array('19064','183','Nord','3'),array('19065','183','Ouest','4'),array('17925','185','Tristan da Cunha','TA'),array('17926','185','Ascension','AC'),array('17930','185','Saint Helena','SH'),array('17931','186','Trinity Palmetto Point','15'),array('17932','186','Saint John Capisterre','6'),array('17933','186','Christ Church Nichola Town','1'),array('17934','186','Saint George Basseterre','3'),array('17935','186','Saint James Windward','5'),array('17936','186','Saint John Figtree','7'),array('17937','186','Saint Paul Capisterre','9'),array('17938','186','Saint Peter Basseterre','11'),array('17939','186','Saint Thomas Middle Island','13'),array('17940','186','Saint Anne Sandy Point','2'),array('17941','186','Saint George Gingerland','4'),array('17942','186','Saint Mary Cayon','8'),array('17943','186','Saint Thomas Lowland','12'),array('17944','186','Saint Paul Charlestown','10'),array('17957','190','Saint George','4'),array('17958','190','Grenadines','6'),array('17959','190','Saint David','3'),array('17960','190','Saint Patrick','5'),array('17962','190','Saint Andrew','2'),array('17963','190','Charlotte','1'),array('20647','191','Aana','AA'),array('20648','191','Aiga-i-le-Tai','AL'),array('20649','191','Atua','AT'),array('20650','191','Faasaleleaga','FA'),array('20651','191','Gagaemauga','GE'),array('20652','191','Gagaifomauga','GI'),array('20653','191','Palauli','PA'),array('20654','191','Satupaitea','SA'),array('20655','191','Tuamasaga','TU'),array('20656','191','Vaa-o-Fonoti','VF'),array('20657','191','Vaisigano','VS'),array('17968','192','Serravalle','9'),array('17969','192','Fiorentino','5'),array('17970','192','Domagnano','3'),array('17971','192','Borgo Maggiore','6'),array('17972','192','Acquaviva','1'),array('17973','192','Chiesanuova','2'),array('17974','192','Faetano','4'),array('17975','192','Montegiardino','8'),array('17976','192','San Marino','7'),array('20324','193','Principe','P'),array('20325','193','Sao Tome','S'),array('17977','194','Tabuk','7'),array('17978','194','Ar Riya','1'),array('17979','194','Al Madinah','3'),array('17980','194','Al Baah','11'),array('17981','194','ail','6'),array('17982','194','Al Jawf','12'),array('17983','194','Najran','10'),array('17984','194','Asir','14'),array('17985','194','Al udud ash Shamaliyah','8'),array('17986','194','Jizan','9'),array('17987','194','Makkah','2'),array('17988','194','Al Qasim','5'),array('17989','194','Ash Sharqiyah','4'),array('17990','195','Ziguinchor','ZG'),array('17991','195','Diourbel','DB'),array('17992','195','Saint-Louis','SL'),array('17993','195','Kolda','KD'),array('17994','195','Matam','MT'),array('17995','195','Thies','TH'),array('17996','195','Louga','LG'),array('17997','195','Fatick','FK'),array('17998','195','Dakar','DK'),array('17999','195','Kaolack','KL'),array('18000','195','Tambacounda','TC'),array('18004','196','Kosovo','25'),array('19066','196','Bor','14'),array('19067','196','Branicevo','11'),array('19068','196','Jablanica','23'),array('19069','196','Juzna Backa','6'),array('19070','196','Juzni Banat','4'),array('19071','196','Kolubara','9'),array('19073','196','Kosovo-Pomoravlje','29'),array('19074','196','Kosovska Mitrovica','28'),array('19075','196','Macva','8'),array('19076','196','Moravica','17'),array('19077','196','Nisava','20'),array('19078','196','Pcinja','24'),array('19079','196','Pec','26'),array('19080','196','Pirot','22'),array('19081','196','Podunavlje','10'),array('19082','196','Pomoravlje','13'),array('19083','196','Prizren','27'),array('19084','196','Rasina','19'),array('19085','196','Raska','18'),array('19086','196','Severna Backa','1'),array('19087','196','Severni Banat','3'),array('19088','196','Srednji Banat','2'),array('19089','196','Srem','7'),array('19090','196','sumadija','12'),array('19091','196','Toplica','21'),array('19092','196','Zajecar','15'),array('19093','196','Zapadna Backa','5'),array('19094','196','Zlatibor','16'),array('47890','196','Belgrade','0'),array('18005','197','Takamaka','23'),array('18006','197','Baie Lazare','6'),array('18007','197','Grand Anse array(Praslin)','14'),array('18009','197','Mont Buxton','17'),array('18011','197','Pointe La Rue','20'),array('18012','197','Port Glaud','21'),array('18013','197','Saint Louis','22'),array('18014','197','Anse aux Pins','1'),array('18015','197','Anse Royale','5'),array('18017','197','Anse Boileau','2'),array('18018','197','Anse etoile','3'),array('18019','197','Anse Louis','4'),array('18020','197','Baie Sainte Anne','7'),array('18021','197','Beau Vallon','8'),array('18022','197','Bel Ombre','10'),array('18023','197','La Riviere Anglaise','16'),array('18024','197','Glacis','12'),array('18025','197','Bel Air','9'),array('18026','197','Plaisance','19'),array('18027','197','La Digue','15'),array('18028','197','Grand Anse array(Mahe)','13'),array('18029','197','Cascade','11'),array('18030','197','Mont Fleuri','18'),array('18033','198','Northern','N'),array('18034','198','Western Area array(Freetown)','W'),array('18044','198','Eastern','E'),array('18045','198','Southern','S'),array('48078','199','Singapore - No State','1.10.2001'),array('18052','200','Trenciansky kraj','TC'),array('18053','200','Bratislavsky kraj','BL'),array('18054','200','Nitriansky kraj','NI'),array('18055','200','Presovsky kraj','PV'),array('18056','200','Trnavsky kraj','TA'),array('18057','200','zilinsky kraj','ZI'),array('18059','200','Kosicky kraj','KI'),array('18060','200','Banskobystricky kraj','BC'),array('19899','201','Brezice','0'),array('19900','201','Cankova','15'),array('19901','201','Celje','1'),array('19902','201','Cerklje na Gorenjskem','1'),array('19903','201','Cerknica','1'),array('19904','201','Cerkno','1'),array('19905','201','Cerkvenjak','15'),array('19906','201','Crensovci','1'),array('19907','201','Crna na Koroskem','1'),array('19908','201','Crnomelj','1'),array('19909','201','Destrnik','1'),array('19910','201','Divaca','1'),array('19911','201','Dobje','15'),array('19912','201','Dobrepolje','2'),array('19913','201','Dobrna','15'),array('19914','201','Dobrova-Polhov Gradec','2'),array('19915','201','Dobrovnik/Dobronak','15'),array('19916','201','Dol pri Ljubljani','2'),array('19917','201','Dolenjske Toplice','15'),array('19918','201','Domzale','2'),array('19919','201','Dornava','2'),array('19920','201','Dravograd','2'),array('19921','201','Duplek','2'),array('19922','201','Gorenja vas-Poljane','2'),array('19923','201','Gorisnica','2'),array('19924','201','Gornja Radgona','2'),array('19925','201','Gornji Grad','3'),array('19926','201','Gornji Petrovci','3'),array('19927','201','Grad','15'),array('19928','201','Grosuplje','3'),array('19929','201','Hajdina','15'),array('19930','201','Hoce-Slivnica','16'),array('19931','201','Hodos/Hodos','16'),array('19932','201','Horjul','16'),array('19933','201','Hrastnik','3'),array('19934','201','Hrpelje-Kozina','3'),array('19935','201','Idrija','3'),array('19936','201','Ig','3'),array('19937','201','Ilirska Bistrica','3'),array('19938','201','Ivancna Gorica','3'),array('19939','201','Izola/Isola','4'),array('19940','201','Jesenice','4'),array('19941','201','Jezersko','16'),array('19942','201','Jursinci','4'),array('19943','201','Kamnik','4'),array('19944','201','Kanal','4'),array('19945','201','Kidricevo','4'),array('19946','201','Kobarid','4'),array('19947','201','Kobilje','4'),array('19948','201','Kocevje','4'),array('19949','201','Komen','4'),array('19950','201','Komenda','16'),array('19951','201','Koper/Capodistria','5'),array('19952','201','Kostel','16'),array('19953','201','Kozje','5'),array('19954','201','Kranj','5'),array('19955','201','Kranjska Gora','5'),array('19956','201','Krizevci','16'),array('19957','201','Krsko','5'),array('19958','201','Kungota','5'),array('19959','201','Kuzma','5'),array('19960','201','Lasko','5'),array('19961','201','Lenart','5'),array('19962','201','Lendava/Lendva','5'),array('19963','201','Litija','6'),array('19964','201','Ljubljana','6'),array('19965','201','Ljubno','6'),array('19966','201','Ljutomer','6'),array('19967','201','Logatec','6'),array('19968','201','Loska dolina','6'),array('19969','201','Loski Potok','6'),array('19970','201','Lovrenc na Pohorju','16'),array('19971','201','Luce','6'),array('19972','201','Lukovica','6'),array('19973','201','Majsperk','6'),array('19974','201','Maribor','7'),array('19975','201','Markovci','16'),array('19976','201','Medvode','7'),array('19977','201','Menges','7'),array('19978','201','Metlika','7'),array('19979','201','Mezica','7'),array('19980','201','Miklavz na Dravskem polju','16'),array('19981','201','Miren-Kostanjevica','7'),array('19982','201','Mirna Pec','17'),array('19983','201','Mislinja','7'),array('19984','201','Moravce','7'),array('19985','201','Moravske Toplice','7'),array('19986','201','Mozirje','7'),array('19987','201','Murska Sobota','8'),array('19988','201','Muta','8'),array('19989','201','Naklo','8'),array('19990','201','Nazarje','8'),array('19991','201','Nova Gorica','8'),array('19992','201','Novo mesto','8'),array('19993','201','Odranci','8'),array('19994','201','Oplotnica','17'),array('19995','201','Ormoz','8'),array('19996','201','Osilnica','8'),array('19997','201','Pesnica','8'),array('19998','201','Piran/Pirano','9'),array('19999','201','Pivka','9'),array('20000','201','Podcetrtek','9'),array('20001','201','Podlehnik','17'),array('20002','201','Podvelka','9'),array('20003','201','Polzela','17'),array('20004','201','Postojna','9'),array('20005','201','Prebold','17'),array('20006','201','Preddvor','9'),array('20007','201','Prevalje','17'),array('20008','201','Ptuj','9'),array('20009','201','Puconci','9'),array('20010','201','Race-Fram','9'),array('20011','201','Radece','9'),array('20012','201','Radenci','10'),array('20013','201','Radlje ob Dravi','10'),array('20014','201','Radovljica','10'),array('20015','201','Ravne na Koroskem','10'),array('20016','201','Razkrizje','17'),array('20017','201','Ribnica','10'),array('20018','201','Ribnica na Pohorju','17'),array('20019','201','Rogaska Slatina','10'),array('20020','201','Rogasovci','10'),array('20021','201','Rogatec','10'),array('20022','201','Ruse','10'),array('20023','201','Selnica ob Dravi','17'),array('20024','201','Semic','10'),array('20025','201','Sevnica','11'),array('20026','201','Sezana','11'),array('20027','201','Slovenj Gradec','11'),array('20028','201','Slovenska Bistrica','11'),array('20029','201','Slovenske Konjice','11'),array('20030','201','Sodrazica','17'),array('20031','201','Solcava','18'),array('20032','201','Starse','11'),array('20033','201','Sveta Ana','18'),array('20034','201','Sveti Andraz v Slovenskih goricah','18'),array('20035','201','Sveti Jurij','11'),array('20036','201','salovci','3'),array('20037','201','sempeter-Vrtojba','18'),array('20038','201','sencur','11'),array('20039','201','sentilj','11'),array('20040','201','sentjernej','11'),array('20041','201','sentjur pri Celju','12'),array('20042','201','skocjan','12'),array('20043','201','skofja Loka','12'),array('20044','201','skofljica','12'),array('20045','201','smarje pri Jelsah','12'),array('20046','201','smartno ob Paki','12'),array('20047','201','smartno pri Litiji','19'),array('20048','201','sostanj','12'),array('20049','201','store','12'),array('20050','201','Tabor','18'),array('20051','201','Tisina','1'),array('20052','201','Tolmin','12'),array('20053','201','Trbovlje','12'),array('20054','201','Trebnje','13'),array('20055','201','Trnovska vas','18'),array('20056','201','Trzic','13'),array('20057','201','Trzin','18'),array('20058','201','Turnisce','13'),array('20059','201','Velenje','13'),array('20060','201','Velika Polana','18'),array('20061','201','Velike Lasce','13'),array('20062','201','Verzej','18'),array('20063','201','Videm','13'),array('20064','201','Vipava','13'),array('20065','201','Vitanje','13'),array('20066','201','Vodice','13'),array('20067','201','Vojnik','13'),array('20068','201','Vransko','18'),array('20069','201','Vrhnika','14'),array('20070','201','Vuzenica','14'),array('20071','201','Zagorje ob Savi','14'),array('20072','201','Zavrc','14'),array('20073','201','Zrece','14'),array('20074','201','zalec','19'),array('20075','201','zelezniki','14'),array('20076','201','zetale','19'),array('20077','201','ziri','14'),array('20078','201','zirovnica','19'),array('20079','201','zuzemberk','19'),array('20197','201','Ajdovscina','0'),array('20198','201','Beltinci','0'),array('20199','201','Benedikt','14'),array('20200','201','Bistrica ob Sotli','14'),array('20201','201','Bled','0'),array('20202','201','Bloke','15'),array('20203','201','Bohinj','0'),array('20204','201','Borovnica','0'),array('20205','201','Bovec','0'),array('20206','201','Braslovce','15'),array('20207','201','Brda','0'),array('20208','201','Brezovica','0'),array('18073','202','Temotu','TE'),array('18074','202','Central','CE'),array('18075','202','Choiseul','CH'),array('18076','202','Guadalcanal','GU'),array('18077','202','Western','WE'),array('18078','202','Rennell and Bellona','RB'),array('18079','202','Capital Territory array(Honiara)','CT'),array('18080','202','Makira','MK'),array('18081','202','Isabel','IS'),array('18082','202','Malaita','ML'),array('18083','203','Sool','SO'),array('18084','203','Galguduud','GA'),array('18085','203','Gedo','GE'),array('18086','203','Jubbada Dhexe','JD'),array('18087','203','Jubbada Hoose','JH'),array('18088','203','Nugaal','NU'),array('18089','203','Shabeellaha Hoose','SH'),array('18090','203','Sanaag','SA'),array('18091','203','Togdheer','TO'),array('18092','203','Woqooyi Galbeed','WO'),array('18093','203','Awdal','AW'),array('18094','203','Bakool','BK'),array('18095','203','Bari','BR'),array('18096','203','Mudug','MU'),array('18097','203','Bay','BY'),array('18098','203','Banaadir','BN'),array('18099','203','Hiiraan','HI'),array('18100','203','Shabeellaha Dhexe','SD'),array('18101','204','North-West','NW'),array('18102','204','Mpumalanga','MP'),array('18103','204','Eastern Cape','EC'),array('18104','204','Free State','FS'),array('18105','204','Kwazulu-Natal','NL'),array('18106','204','Limpopo','LP'),array('18107','204','Northern Cape','NC'),array('18108','204','Western Cape','WC'),array('18109','204','Gauteng','GT'),array('18110','206','Zaragoza','Z'),array('18111','206','Valencia','V'),array('18112','206','Tarragona','T'),array('18113','206','Vizcaya','BI'),array('18114','206','Zamora','ZA'),array('18115','206','Segovia','SG'),array('18116','206','Ourense','OR'),array('18117','206','Soria','SO'),array('18118','206','Teruel','TE'),array('18119','206','Toledo','TO'),array('18120','206','Valladolid','VA'),array('18121','206','alava','VI'),array('18122','206','Asturias','O'),array('18123','206','Baleares','PM'),array('18124','206','Burgos','BU'),array('18125','206','Cantabria','S'),array('18126','206','Ciudad Real','CR'),array('18127','206','Cordoba','CO'),array('18128','206','Girona','GI'),array('18129','206','Granada','GR'),array('18130','206','Guipuzcoa','SS'),array('18131','206','Huesca','HU'),array('18132','206','Jaen','J'),array('18133','206','Las Palmas','GC'),array('18134','206','Lleida','L'),array('18135','206','A Coruna','C'),array('18136','206','Alicante','A'),array('18137','206','Albacete','AB'),array('18138','206','Almeria','AL'),array('18139','206','avila','AV'),array('18140','206','Badajoz','BA'),array('18141','206','Barcelona','B'),array('18142','206','Caceres','CC'),array('18143','206','Cadiz','CA'),array('18144','206','Castellon','CS'),array('18145','206','Lugo','LU'),array('18146','206','Malaga','MA'),array('18148','206','Navarra','NA'),array('18149','206','Palencia','P'),array('18150','206','Pontevedra','PO'),array('18151','206','Santa Cruz de Tenerife','TF'),array('18152','206','Sevilla','SE'),array('18154','206','Cuenca','CU'),array('18155','206','Guadalajara','GU'),array('18156','206','Huelva','H'),array('18157','206','La Rioja','LO'),array('18158','206','Leon','LE'),array('18159','206','Madrid','M'),array('18160','206','Murcia','MU'),array('18161','206','Salamanca','SA'),array('42627','206','Melilla','ML'),array('42631','206','Ceuta','CE'),array('18162','207','Vavuniya','44'),array('18163','207','Mullaittivu','45'),array('18164','207','Matara','32'),array('18165','207','Polonnaruwa','72'),array('18166','207','Ratnapura','91'),array('18167','207','Kandy','21'),array('18168','207','Kilinochchi','42'),array('18169','207','Matale','22'),array('18170','207','Monaragala','82'),array('18171','207','Nuwara Eliya','23'),array('18172','207','Puttalam','62'),array('18173','207','Trincomalee','53'),array('18174','207','Jaffna','41'),array('18175','207','Anuradhapura','71'),array('18176','207','Gampaha','12'),array('18177','207','Kalutara','13'),array('18178','207','Ampara','52'),array('18179','207','Badulla','81'),array('18180','207','Galle','31'),array('18181','207','Hambantota','33'),array('18182','207','Kegalla','92'),array('18183','207','Colombo','11'),array('18184','207','Batticaloa','51'),array('18185','207','Mannar','43'),array('18186','207','Kurunegala','61'),array('18187','208','Al Wadah','22'),array('18188','208','Shamal Bar al Ghazal','15'),array('18189','208','Al Qaarif','6'),array('18190','208','Ash Shamaliyah','1'),array('18191','208','Sharq al Istiwaiyah','19'),array('18192','208','An Nil al Abya','8'),array('18193','208','Al Jazirah','7'),array('18194','208','Aali an Nil','23'),array('18195','208','Bar al Jabal','17'),array('18196','208','Gharb Bar al Ghazal','14'),array('18197','208','Al Khartum','3'),array('18198','208','Janub Kurdufan','13'),array('18199','208','Junqali','20'),array('18200','208','An Nil','4'),array('18201','208','An Nil al Azraq','24'),array('18202','208','Shamal Darfur','2'),array('18203','208','Shamal Kurdufan','9'),array('18204','208','Sinnar','25'),array('18205','208','Warab','21'),array('18206','208','Al Bar al Amar','26'),array('18207','208','Al Buayrat','18'),array('18208','208','Gharb al Istiwaiyah','16'),array('18209','208','Gharb Darfur','12'),array('18210','208','Gharb Kurdufan','10'),array('18211','208','Janub Darfur','11'),array('18212','208','Kassala','5'),array('18213','209','Sipaliwini','SI'),array('18214','209','Commewijne','CM'),array('18215','209','Coronie','CR'),array('18216','209','Nickerie','NI'),array('18217','209','Paramaribo','PM'),array('18218','209','Saramacca','SA'),array('18219','209','Wanica','WA'),array('18220','209','Brokopondo','BR'),array('18221','209','Marowijne','MA'),array('18222','209','Para','PR'),array('18225','211','Manzini','MA'),array('18226','211','Hhohho','HH'),array('18227','211','Shiselweni','SH'),array('18228','211','Lubombo','LU'),array('18230','212','ostergotlands lan [SE-05]','E'),array('18231','212','Sodermanlands lan [SE-04]','D'),array('18232','212','Uppsala lan [SE-03]','C'),array('18233','212','Varmlands lan [SE-17]','S'),array('18234','212','Vasternorrlands lan [SE-22]','Y'),array('18235','212','Vastra Gotalands lan [SE-14]','O'),array('18240','212','Blekinge lan [SE-10]','K'),array('18241','212','Gavleborgs lan [SE-21]','X'),array('18242','212','Hallands lan [SE-13]','N'),array('18243','212','Jamtlands lan [SE-23]','Z'),array('18244','212','Kalmar lan [SE-08]','H'),array('18245','212','Kronobergs lan [SE-07]','G'),array('18246','212','orebro lan [SE-18]','T'),array('18247','212','Skane lan [SE-12]','M'),array('18248','212','Dalarnas lan [SE-20]','W'),array('18249','212','Gotlands lan [SE-09]','I'),array('18250','212','Jonkopings lan [SE-06]','F'),array('18251','212','Norrbottens lan [SE-25]','BD'),array('18252','212','Stockholms lan [SE-01]','AB'),array('18253','212','Vastmanlands lan [SE-19]','U'),array('18254','212','Vasterbottens lan [SE-24]','AC'),array('18255','213','Vaud array(fr)','VD'),array('18256','213','Zurich array(de)','ZH'),array('18257','213','Aargau array(de)','AG'),array('18258','213','Appenzell Innerrhoden array(de)','AI'),array('18259','213','Basel-Stadt array(de)','BS'),array('18260','213','Fribourg array(fr)','FR'),array('18261','213','Glarus array(de)','GL'),array('18262','213','Jura array(fr)','JU'),array('18263','213','Neuchatel array(fr)','NE'),array('18264','213','Obwalden array(de)','OW'),array('18265','213','Graubunden array(de)','GR'),array('18266','213','Luzern array(de)','LU'),array('18267','213','Nidwalden array(de)','NW'),array('18268','213','Sankt Gallen array(de)','SG'),array('18269','213','Schwyz array(de)','SZ'),array('18270','213','Solothurn array(de)','SO'),array('18271','213','Ticino array(it)','TI'),array('18272','213','Valais array(fr)','VS'),array('18273','213','Zug array(de)','ZG'),array('18274','213','Appenzell Ausserrhoden array(de)','AR'),array('18275','213','Basel-Landschaft array(de)','BL'),array('18276','213','Bern array(de)','BE'),array('18277','213','Geneve array(fr)','GE'),array('18278','213','Uri array(de)','UR'),array('18279','213','Schaffhausen array(de)','SH'),array('18280','213','Thurgau array(de)','TG'),array('18281','214','Tartus','TA'),array('18282','214','Ar Raqqah','RA'),array('18283','214','Dimashq','DI'),array('18284','214','ims','HI'),array('18285','214','alab','HL'),array('18286','214','Dara','DR'),array('18287','214','Rif Dimashq','RD'),array('18288','214','Al asakah','HA'),array('18289','214','Al Ladhiqiyah','LA'),array('18290','214','Al Qunaytirah','QU'),array('18291','214','As Suwayda','SU'),array('18292','214','Dayr az Zawr','DY'),array('18293','214','amah','HM'),array('18294','214','Idlib','ID'),array('18302','215','Yunlin','YU'),array('18303','215','Taoyuan','TA'),array('18304','215','Taitung','TT'),array('18305','215','Taipei','TP'),array('18306','215','Tainan','TN'),array('18307','215','Taichung','TX'),array('18308','215','Chiayi Municipality','CY'),array('18309','215','Hsinchu Municipality','HS'),array('18310','215','Hsinchu','HS'),array('18311','215','Ilan','IL'),array('18312','215','Changhua','CH'),array('18313','215','Chiayi','CY'),array('18314','215','Hualien','HU'),array('18315','215','Kaohsiung','KH'),array('18316','215','Keelung Municipality','KE'),array('18317','215','Miaoli','MI'),array('18318','215','Pingtung','PI'),array('18319','215','Tainan Municipality','TN'),array('18320','215','Kaohsiung Special Municipality','KH'),array('18323','215','Nantou','NA'),array('18324','215','Penghu','PE'),array('18325','215','Taichung Municipality','TX'),array('18326','215','Taipei Special Municipality','TP'),array('18327','216','Khatlon','KT'),array('18329','216','','1.10.2001'),array('18330','216','Sughd','SU'),array('18331','216','Gorno-Badakhshan','GB'),array('18333','217','Kaskazini Pemba','6'),array('18334','217','Tanga','25'),array('18335','217','Singida','23'),array('18336','217','Rukwa','20'),array('18337','217','Mbeya','14'),array('18338','217','Kagera','5'),array('18339','217','Kigoma','8'),array('18340','217','Kilimanjaro','9'),array('18341','217','Manyara','26'),array('18342','217','Mara','13'),array('18343','217','Morogoro','16'),array('18344','217','Mwanza','18'),array('18345','217','Pwani','19'),array('18346','217','Ruvuma','21'),array('18347','217','Shinyanga','22'),array('18348','217','Tabora','24'),array('18349','217','Arusha','1'),array('18350','217','Dar es Salaam','2'),array('18351','217','Dodoma','3'),array('18352','217','Iringa','4'),array('18353','217','Lindi','12'),array('18354','217','Mtwara','17'),array('19095','217','Kaskazini Unguja','7'),array('19096','217','Kusini Pemba','10'),array('19097','217','Kusini Unguja','11'),array('19098','217','Mjini Magharibi','15'),array('18355','218','Yasothon','35'),array('18356','218','Surat Thani','84'),array('18357','218','Phichit','66'),array('18358','218','Phra Nakhon Si Ayutthaya','14'),array('18359','218','Prachin Buri','25'),array('18360','218','Ratchaburi','70'),array('18361','218','Roi Et','45'),array('18362','218','Samut Prakan','11'),array('18363','218','Samut Songkhram','75'),array('18364','218','Sing Buri','17'),array('18365','218','Sukhothai','64'),array('18366','218','Loei','42'),array('18367','218','Maha Sarakham','44'),array('18368','218','Nakhon Nayok','26'),array('18369','218','Nakhon Ratchasima','30'),array('18370','218','Nakhon Si Thammarat','80'),array('18371','218','Nong Bua Lam Phu','39'),array('18372','218','Nonthaburi','12'),array('18373','218','Phangnga','82'),array('18374','218','Phayao','56'),array('18375','218','Si Sa Ket','33'),array('18376','218','Songkhla','90'),array('18377','218','Suphan Buri','72'),array('18378','218','Surin','32'),array('18379','218','Tak','63'),array('18380','218','Trat','23'),array('18381','218','Ubon Ratchathani','34'),array('18382','218','Uthai Thani','61'),array('18383','218','Yala','95'),array('18384','218','Nong Khai','43'),array('18385','218','Pathum Thani','13'),array('18386','218','Pattani','94'),array('18387','218','Phatthalung','93'),array('18388','218','Phetchabun','67'),array('18389','218','Phetchaburi','76'),array('18390','218','Phitsanulok','65'),array('18391','218','Phrae','54'),array('18392','218','Phuket','83'),array('18393','218','Chaiyaphum','36'),array('18394','218','Chanthaburi','22'),array('18395','218','Chiang Rai','57'),array('18396','218','Chumphon','86'),array('18397','218','Kamphaeng Phet','62'),array('18398','218','Kanchanaburi','71'),array('18399','218','Krabi','81'),array('18400','218','Lampang','52'),array('18401','218','Lamphun','51'),array('18402','218','Amnat Charoen','37'),array('18403','218','Ang Thong','15'),array('18404','218','Chachoengsao','24'),array('18405','218','Lop Buri','16'),array('18406','218','Mae Hong Son','58'),array('18407','218','Mukdahan','49'),array('18408','218','Nakhon Pathom','73'),array('18409','218','Nakhon Phanom','48'),array('18410','218','Nakhon Sawan','60'),array('18411','218','Nan','55'),array('18412','218','Narathiwat','96'),array('18413','218','Prachuap Khiri Khan','77'),array('18414','218','Ranong','85'),array('18415','218','Rayong','21'),array('18416','218','Sa Kaeo','27'),array('18417','218','Sakon Nakhon','47'),array('18418','218','Samut Sakhon','74'),array('18419','218','Saraburi','19'),array('18420','218','Satun','91'),array('18421','218','Buri Ram','31'),array('18422','218','Chai Nat','18'),array('18423','218','Chiang Mai','50'),array('18424','218','Chon Buri','20'),array('18425','218','Kalasin','46'),array('18426','218','Khon Kaen','40'),array('18427','218','Krung Thep Maha Nakhon [Bangkok]','10'),array('18428','218','Trang','92'),array('18429','218','Uttaradit','53'),array('18430','218','Udon Thani','41'),array('20407','218','Phatthaya','S'),array('13552','219','Manufahi','MF'),array('13553','219','Ainaro','AN'),array('13554','219','Aileu','AL'),array('13555','219','Oecussi','OE'),array('13556','219','Bobonaro','BO'),array('13557','219','Cova Lima','CO'),array('13558','219','Ermera','ER'),array('13559','219','Liquica','LI'),array('13560','219','Manatuto','MT'),array('13561','219','Viqueque','VI'),array('13562','219','Baucau','BA'),array('13563','219','Lautem','LA'),array('13564','219','Dili','DI'),array('18431','220','Savannes','S'),array('18432','220','Kara','K'),array('18433','220','Centre','C'),array('18434','220','Plateaux','P'),array('18435','220','Maritime array(Region)','M'),array('18439','222','Vavau','5'),array('18440','222','Haapai','2'),array('18441','222','Tongatapu','4'),array('18442','222','Eua','1'),array('18443','222','Niuas','3'),array('18445','223','Princes Town','PR'),array('18446','223','Arima','AR'),array('18447','223','Couva-Tabaquite-Talparo','CT'),array('18448','223','Diego Martin','DM'),array('18449','223','Penal-Debe','PE'),array('18450','223','Port of Spain','PO'),array('18451','223','San Fernando','SF'),array('18452','223','San Juan-Laventille','SJ'),array('18453','223','Siparia','SI'),array('18454','223','Tunapuna-Piarco','TU'),array('18455','223','Rio Claro-Mayaro','RC'),array('18456','223','Chaguanas','CH'),array('18457','223','Point Fortin','PT'),array('18458','223','Sangre Grande','SG'),array('20483','223','Eastern Tobago','ET'),array('20488','223','Western Tobago','WT'),array('18459','224','Zaghouan','22'),array('18460','224','Tataouine','83'),array('18461','224','Siliana','34'),array('18462','224','Sfax','61'),array('18463','224','LAriana','12'),array('18464','224','Ben Arous','13'),array('18465','224','Jendouba','32'),array('18466','224','Medenine','82'),array('18467','224','La Manouba','14'),array('18468','224','Nabeul','21'),array('18469','224','Beja','31'),array('18470','224','Bizerte','23'),array('18471','224','Le Kef','33'),array('18472','224','Mahdia','53'),array('18473','224','Monastir','52'),array('18474','224','Gabes','81'),array('18475','224','Gafsa','71'),array('18476','224','Kasserine','42'),array('18477','224','Kairouan','41'),array('18478','224','Kebili','73'),array('18479','224','Sidi Bouzid','43'),array('18480','224','Sousse','51'),array('18481','224','Tozeur','72'),array('18482','224','Tunis','11'),array('18483','225','Zonguldak','67'),array('18484','225','Osmaniye','80'),array('18485','225','Mardin','47'),array('18486','225','Kirklareli','39'),array('18487','225','Siirt','56'),array('18488','225','Sirnak','73'),array('18489','225','Tekirdag','59'),array('18490','225','Tokat','60'),array('18491','225','Trabzon','61'),array('18492','225','Usak','64'),array('18493','225','Van','65'),array('18494','225','Yozgat','66'),array('18495','225','Diyarbakir','21'),array('18496','225','Malatya','44'),array('18497','225','Manisa','45'),array('18498','225','Mugla','48'),array('18499','225','Mus','49'),array('18500','225','Nigde','51'),array('18501','225','Ordu','52'),array('18502','225','Rize','53'),array('18503','225','Sakarya','54'),array('18504','225','Sanliurfa','63'),array('18505','225','Erzincan','24'),array('18506','225','Erzurum','25'),array('18507','225','Gaziantep','27'),array('18508','225','Gumushane','29'),array('18509','225','Hakkari','30'),array('18510','225','Hatay','31'),array('18511','225','Igdir','76'),array('18512','225','Istanbul','34'),array('18513','225','Izmir','35'),array('18514','225','Aksaray','68'),array('18515','225','Amasya','5'),array('18516','225','Antalya','7'),array('18517','225','Ardahan','75'),array('18518','225','Aydin','9'),array('18519','225','Balikesir','10'),array('18520','225','Batman','72'),array('18521','225','Bayburt','69'),array('18522','225','Bingol','12'),array('18523','225','Adiyaman','2'),array('18524','225','Afyon','3'),array('18525','225','Bitlis','13'),array('18526','225','Bolu','14'),array('18527','225','Bursa','16'),array('18528','225','cankiri','18'),array('18529','225','corum','19'),array('18530','225','Denizli','20'),array('18531','225','Duzce','81'),array('18532','225','Edirne','22'),array('18533','225','Karabuk','78'),array('18534','225','Karaman','70'),array('18535','225','Kastamonu','37'),array('18536','225','Kayseri','38'),array('18537','225','Kirikkale','71'),array('18538','225','Kirsehir','40'),array('18539','225','Kocaeli','41'),array('18540','225','Konya','42'),array('18541','225','Elazig','23'),array('18542','225','Eskisehir','26'),array('18543','225','Giresun','28'),array('18544','225','Icel','33'),array('18545','225','Isparta','32'),array('18546','225','Kahramanmaras','46'),array('18547','225','Kars','36'),array('18548','225','Kilis','79'),array('18551','225','Adana','1'),array('18552','225','Agri','4'),array('18553','225','Ankara','6'),array('18554','225','Artvin','8'),array('18555','225','Bartin','74'),array('18556','225','Bilecik','11'),array('18557','225','Burdur','15'),array('18558','225','canakkale','17'),array('18559','225','Kutahya','43'),array('18560','225','Nevsehir','50'),array('18561','225','Samsun','55'),array('18562','225','Tunceli','62'),array('18563','225','Sivas','58'),array('18564','225','Sinop','57'),array('18565','225','Yalova','77'),array('18566','226','Mary','M'),array('18567','226','','X~'),array('18568','226','Balkan','B'),array('18569','226','Ahal','A'),array('18571','226','Dasoguz','D'),array('18572','226','Lebap','L'),array('18579','228','Nukufetau','NK'),array('18580','228','Nanumanga','NM'),array('18581','228','Nanumea','NM'),array('18582','228','Niutao','NI'),array('18583','228','Nui','NI'),array('18584','228','Nukulaelae','NK'),array('18585','228','Vaitupu','VA'),array('18586','228','Funafuti','FU'),array('20519','229','Kalangala','10'),array('20520','229','Kampala','10'),array('20521','229','Kiboga','10'),array('20522','229','Luwero','10'),array('20523','229','Masaka','10'),array('20524','229','Mpigi','10'),array('20525','229','Mubende','10'),array('20526','229','Mukono','10'),array('20527','229','Nakasongola','10'),array('20528','229','Rakai','11'),array('20529','229','Sembabule','11'),array('20530','229','Kayunga','11'),array('20531','229','Wakiso','11'),array('20532','229','Bugiri','20'),array('20533','229','Busia','20'),array('20534','229','Iganga','20'),array('20535','229','Jinja','20'),array('20536','229','Kamuli','20'),array('20537','229','Kapchorwa','20'),array('20538','229','Katakwi','20'),array('20539','229','Kumi','20'),array('20540','229','Mbale','20'),array('20541','229','Pallisa','21'),array('20542','229','Soroti','21'),array('20543','229','Tororo','21'),array('20544','229','Kaberamaido','21'),array('20545','229','Mayuge','21'),array('20546','229','Sironko','21'),array('20547','229','Adjumani','30'),array('20548','229','Apac','30'),array('20549','229','Arua','30'),array('20550','229','Gulu','30'),array('20551','229','Kitgum','30'),array('20552','229','Kotido','30'),array('20553','229','Lira','30'),array('20554','229','Moroto','30'),array('20555','229','Moyo','30'),array('20556','229','Nebbi','31'),array('20557','229','Nakapiripirit','31'),array('20558','229','Pader','31'),array('20559','229','Yumbe','31'),array('20560','229','Bundibugyo','40'),array('20561','229','Bushenyi','40'),array('20562','229','Hoima','40'),array('20563','229','Kabale','40'),array('20564','229','Kabarole','40'),array('20565','229','Kasese','40'),array('20566','229','Kibaale','40'),array('20567','229','Kisoro','40'),array('20568','229','Masindi','40'),array('20569','229','Mbarara','41'),array('20570','229','Ntungamo','41'),array('20571','229','Rukungiri','41'),array('20572','229','Kamwenge','41'),array('20573','229','Kanungu','41'),array('20574','229','Kyenjojo','41'),array('18592','230','Zhytomyrska Oblast','18'),array('18593','230','Vinnytska Oblast','5'),array('18594','230','Cherkaska Oblast','71'),array('18595','230','Chernihivska Oblast','74'),array('18596','230','Chernivetska Oblast','77'),array('18597','230','Donetska Oblast','14'),array('18598','230','Ivano-Frankivska Oblast','26'),array('18599','230','Kharkivska Oblast','63'),array('18600','230','Khersonska Oblast','65'),array('18601','230','Kirovohradska Oblast','35'),array('18602','230','Respublika Krym','43'),array('18603','230','Dnipropetrovska Oblast','12'),array('18604','230','Khmelnytska Oblast','68'),array('18605','230','Luhanska Oblast','9'),array('18606','230','Odeska Oblast','51'),array('18607','230','Kyiv','30'),array('18608','230','Kyivska Oblast','32'),array('18609','230','Lvivska Oblast','46'),array('18610','230','Mykolaivska Oblast','48'),array('18611','230','Poltavska Oblast','53'),array('18612','230','Rivnenska Oblast','56'),array('18613','230','Sevastopol','40'),array('18614','230','Sumska Oblast','59'),array('18615','230','Ternopilska Oblast','61'),array('18616','230','Zaporizka Oblast','23'),array('18617','230','Volynska Oblast','7'),array('18618','230','Zakarpatska Oblast','21'),array('18620','231','Ras al Khaymah','RK'),array('18622','231','Abu Zaby [Abu Dhabi]','AZ'),array('20215','231','Ajman','AJ'),array('20217','231','Dubayy [Dubai]','DU'),array('20218','231','Al Fujayrah','FU'),array('20219','231','Ash Shariqah [Sharjah]','SH'),array('20220','231','Umm al Qaywayn','UQ'),array('18631','233','Wake Island','79'),array('18632','233','Palmyra Atoll','95'),array('18633','233','Navassa Island','76'),array('18634','233','Midway Islands','71'),array('18635','233','Johnston Atoll','67'),array('18636','233','Howland Island','84'),array('18637','233','Baker Island','81'),array('18638','233','Jarvis Island','86'),array('18639','233','Kingman Reef','89'),array('18691','234','Tacuarembo','TA'),array('18692','234','San Jose','SJ'),array('18693','234','Rivera','RV'),array('18694','234','Paysandu','PA'),array('18695','234','Flores','FS'),array('18696','234','Artigas','AR'),array('18697','234','','1.10.2001'),array('18698','234','','1.10.2003'),array('18699','234','Durazno','DU'),array('18700','234','Florida','FD'),array('18701','234','Maldonado','MA'),array('18702','234','Montevideo','MO'),array('18703','234','Rio Negro','RN'),array('18704','234','Rocha','RO'),array('18705','234','Salto','SA'),array('18706','234','Soriano','SO'),array('18707','234','Treinta y Tres','TT'),array('18708','234','','1.10.2002'),array('18709','234','Lavalleja','LA'),array('18710','235','Surxondaryo','SU'),array('18711','235','Sirdaryo','SI'),array('18712','235','Navoiy','NW'),array('18713','235','Qoraqalpogiston Respublikasi','QR'),array('18714','235','Fargona','FA'),array('18715','235','Andijon','AN'),array('18717','235','Buxoro','BU'),array('18718','235','Qashqadaryo','QA'),array('18719','235','Namangan','NG'),array('18720','235','Samarqand','SA'),array('18721','235','Toshkent','TO'),array('18723','235','Jizzax','JI'),array('18724','235','Xorazm','XO'),array('20580','235','Toshkent City','TK'),array('18725','236','Tafea','TA'),array('18726','236','Malampa','MA'),array('18727','236','Shefa','SE'),array('18728','236','Penama','PA'),array('18729','236','Torba','TO'),array('18730','236','Sanma','SA'),array('18733','238','Sucre','R'),array('18734','238','Nueva Esparta','O'),array('18735','238','Amazonas','Z'),array('18736','238','Aragua','D'),array('18737','238','Bolivar','F'),array('18738','238','Delta Amacuro','Y'),array('18739','238','Distrito Federal','A'),array('18740','238','Guarico','J'),array('18741','238','Lara','K'),array('18742','238','Merida','L'),array('18743','238','Miranda','M'),array('18744','238','Monagas','N'),array('18745','238','Anzoategui','B'),array('18746','238','Apure','C'),array('18747','238','Barinas','E'),array('18748','238','Carabobo','G'),array('18749','238','Cojedes','H'),array('18750','238','Dependencias Federales','W'),array('18751','238','Falcon','I'),array('18752','238','Portuguesa','P'),array('20680','238','Yaracuy','U'),array('20681','238','Tachira','S'),array('20682','238','Trujillo','T'),array('20683','238','Vargas','X'),array('20684','238','Zulia','V'),array('18732','239','Bac Lieu','55'),array('18753','239','An Giang','44'),array('18754','239','Bac Giang','54'),array('18755','239','Bac Can','53'),array('18756','239','Ba Ria - Vung Tau','43'),array('18763','239','Thai Nguyen','69'),array('20584','239','Lai Chau','1'),array('20585','239','Lao Cai','2'),array('20586','239','Ha Giang','3'),array('20587','239','Cao Bang','4'),array('20588','239','Son La','5'),array('20589','239','Yen Bai','6'),array('20590','239','Tuyen Quang','7'),array('20591','239','Lang Son','9'),array('20592','239','Quang Ninh','13'),array('20593','239','Hoa Binh','14'),array('20594','239','Ha Tay','15'),array('20595','239','Ninh Binh','18'),array('20596','239','Thai Binh','20'),array('20597','239','Thanh Hoa','21'),array('20598','239','Nghe An','22'),array('20599','239','Ha Tinh','23'),array('20600','239','Quang Binh','24'),array('20601','239','Quang Tri','25'),array('20602','239','Thua Thien-Hue','26'),array('20603','239','Quang Nam','27'),array('20604','239','Kon Tum','28'),array('20605','239','Quang Ngai','29'),array('20606','239','Gia Lai','30'),array('20607','239','Binh Dinh','31'),array('20608','239','Phu Yen','32'),array('20609','239','Dac Lac','33'),array('20610','239','Khanh Hoa','34'),array('20611','239','Lam Dong','35'),array('20612','239','Ninh Thuan','36'),array('20613','239','Tay Ninh','37'),array('20614','239','Dong Nai','39'),array('20615','239','Binh Thuan','40'),array('20616','239','Long An','41'),array('20617','239','Dong Thap','45'),array('20618','239','Tien Giang','46'),array('20619','239','Kien Giang','47'),array('20620','239','Can Tho','48'),array('20621','239','Vinh Long','49'),array('20622','239','Ben Tre','50'),array('20623','239','Tra Vinh','51'),array('20624','239','Soc Trang','52'),array('20625','239','Bac Ninh','56'),array('20626','239','Binh Duong','57'),array('20627','239','Binh Phuoc','58'),array('20628','239','Ca Mau','59'),array('20629','239','Da Nang, thanh pho','60'),array('20630','239','Hai Duong','61'),array('20631','239','Hai Phong, thanh pho','62'),array('20632','239','Ha Nam','63'),array('20633','239','Ha Noi, thu do','64'),array('20634','239','Ho Chi Minh, thanh pho [Sai Gon]','65'),array('20635','239','Hung Yen','66'),array('20636','239','Nam Dinh','67'),array('20637','239','Phu Tho','68'),array('20638','239','Vinh Phuc','70'),array('20639','239','Dien Bien','71'),array('20640','239','Dak Nong','72'),array('20641','239','Hau Giang','73'),array('18773','243','Laayoune','LA'),array('18774','243','Oued el Dahab','OU'),array('18775','243','Boujdour','BO'),array('18777','243','Es Semara','ES'),array('18778','244','Taizz','TA'),array('18779','244','Sana','SN'),array('18780','244','Shabwah','SH'),array('18781','244','Al Mahwit','MW'),array('18782','244','Laij','LA'),array('18783','244','Adan','AD'),array('18784','244','Al Baya','BA'),array('18785','244','Hadramawt','HD'),array('18786','244','Hajjah','HJ'),array('18787','244','Abyan','AB'),array('18789','244','Dhamar','DH'),array('18790','244','Al udaydah','HU'),array('18791','244','Ibb','IB'),array('18792','244','Al Jawf','JA'),array('18793','244','Al Mahrah','MR'),array('18794','244','Marib','MA'),array('18795','244','Sadah','SD'),array('20660','244','Amran','AM'),array('20662','244','Ad Dali','DA'),array('18796','245','Western','1'),array('18798','245','Northern','5'),array('18800','245','Copperbelt','8'),array('18801','245','Lusaka','9'),array('18802','245','Southern','7'),array('18803','245','Luapula','4'),array('18804','245','North-Western','6'),array('20690','245','Central','2'),array('21381','245','Eastern','3'),array('21280','246','Manicaland','MA'),array('21281','246','Midlands','MI'),array('21282','246','Mashonaland Central','MC'),array('21283','246','Mashonaland East','ME'),array('21284','246','Mashonaland West','MW'),array('21285','246','Matabeleland North','MN'),array('21286','246','Matabeleland South','MS'),array('21287','246','Masvingo','MV'),array('21379','246','Harare','HA'),array('21380','246','Bulawayo','BU')
33
+ );
34
+
35
+ public static $countries = array(
36
+ array('1','UNITED STATES','US','USA','.us','1'),array('2','AFGHANISTAN','AF','AFG','.af','93'),array('3','ALAND ISLANDS','AX','ALA','.ax','0'),array('4','ALBANIA','AL','ALB','.al','355'),array('5','ALGERIA array(El Djazaïr)','DZ','DZA','.dz','213'),array('6','AMERICAN SAMOA','AS','ASM','.as','1'),array('7','ANDORRA','AD','AND','.ad','376'),array('8','ANGOLA','AO','AGO','.ao','244'),array('9','ANGUILLA','AI','AIA','.ai','1264'),array('10','ANTARCTICA','AQ','ATA','.aq','0'),array('11','ANTIGUA AND BARBUDA','AG','ATG','.ag','1268'),array('12','ARGENTINA','AR','ARG','.ar','54'),array('13','ARMENIA','AM','ARM','.am','7'),array('14','ARUBA','AW','ABW','.aw','297'),array('15','AUSTRALIA','AU','AUS','.au','61'),array('16','AUSTRIA','AT','AUT','.at','43'),array('17','AZERBAIJAN','AZ','AZE','.az','994'),array('18','BAHAMAS','BS','BHS','.bs','1242'),array('19','BAHRAIN','BH','BHR','.bh','973'),array('20','BANGLADESH','BD','BGD','.bd','880'),array('21','BARBADOS','BB','BRB','.bb','1246'),array('22','BELARUS','BY','BLR','.by','375'),array('23','BELGIUM','BE','BEL','.be','32'),array('24','BELIZE','BZ','BLZ','.bz','501'),array('25','BENIN','BJ','BEN','.bj','229'),array('26','BERMUDA','BM','BMU','.bm','1441'),array('27','BHUTAN','BT','BTN','.bt','975'),array('28','BOLIVIA','BO','BOL','.bo','591'),array('29','BOSNIA AND HERZEGOVINA','BA','BIH','.ba','387'),array('30','BOTSWANA','BW','BWA','.bw','267'),array('31','BOUVET ISLAND','BV','BVT','.bv','0'),array('32','BRAZIL','BR','BRA','.br','55'),array('33','BRITISH INDIAN OCEAN TERRITORY','IO','IOT','.io','0'),array('34','BRUNEI DARUSSALAM','BN','BRN','.bn','673'),array('35','BULGARIA','BG','BGR','.bg','359'),array('36','BURKINA FASO','BF','BFA','.bf','226'),array('37','BURUNDI','BI','BDI','.bi','257'),array('38','CAMBODIA','KH','KHM','.kh','855'),array('39','CAMEROON','CM','CMR','.cm','237'),array('40','CANADA','CA','CAN','.ca','1'),array('41','CAPE VERDE','CV','CPV','.cv','238'),array('42','CAYMAN ISLANDS','KY','CYM','.ky','1345'),array('43','CENTRAL AFRICAN REPUBLIC','CF','CAF','.cf','236'),array('44','CHAD array(Tchad)','TD','TCD','.td','235'),array('45','CHILE','CL','CHL','.cl','56'),array('46','CHINA','CN','CHN','.cn','86'),array('47','CHRISTMAS ISLAND','CX','CXR','.cx','0'),array('48','COCOS array(KEELING) ISLANDS','CC','CCK','.cc','0'),array('49','COLOMBIA','CO','COL','.co','57'),array('50','COMOROS','KM','COM','.km','269'),array('51','CONGO, REPUBLIC OF','CG','COG','.cg','242'),array('52','CONGO, THE DEMOCRATIC REPUBLIC OF THE array(formerly Zaire)','CD','COD','.cd','243'),array('53','COOK ISLANDS','CK','COK','.ck','682'),array('54','COSTA RICA','CR','CRI','.cr','506'),array('55','COTE DIVOIRE array(Ivory Coast)','CI','CIV','.ci','225'),array('56','CROATIA array(Hrvatska)','HR','HRV','.hr','385'),array('57','CUBA','CU','CUB','.cu','53'),array('58','CYPRUS','CY','CYP','.cy','357'),array('59','CZECH REPUBLIC','CZ','CZE','.cz','420'),array('60','DENMARK','DK','DNK','.dk','45'),array('61','DJIBOUTI','DJ','DJI','.dj','253'),array('62','DOMINICA','DM','DMA','.dm','1767'),array('63','DOMINICAN REPUBLIC','DO','DOM','.do','1809'),array('64','ECUADOR','EC','ECU','.ec','593'),array('65','EGYPT','EG','EGY','.eg','20'),array('66','EL SALVADOR','SV','SLV','.sv','503'),array('67','EQUATORIAL GUINEA','GQ','GNQ','.gq','240'),array('68','ERITREA','ER','ERI','.er','291'),array('69','ESTONIA','EE','EST','.ee','372'),array('70','ETHIOPIA','ET','ETH','.et','251'),array('71','FAEROE ISLANDS','FO','FRO','.fo','298'),array('72','FALKLAND ISLANDS array(MALVINAS)','FK','FLK','.fk','500'),array('73','FIJI','FJ','FJI','.fj','679'),array('74','FINLAND','FI','FIN','.fi','358'),array('75','FRANCE','FR','FRA','.fr','33'),array('76','FRENCH GUIANA','GF','GUF','.gf','594'),array('77','FRENCH POLYNESIA','PF','PYF','.pf','689'),array('78','FRENCH SOUTHERN TERRITORIES','TF','ATF','.tf','0'),array('79','GABON','GA','GAB','.ga','241'),array('80','GAMBIA, THE','GM','GMB','.gm','220'),array('81','GEORGIA','GE','GEO','.ge','0'),array('82','GERMANY array(Deutschland)','DE','DEU','.de','49'),array('83','GHANA','GH','GHA','.gh','233'),array('84','GIBRALTAR','GI','GIB','.gi','350'),array('85','GREAT BRITAIN','GB','GBR','.uk','44'),array('86','GREECE','GR','GRC','.gr','30'),array('87','GREENLAND','GL','GRL','.gl','299'),array('88','GRENADA','GD','GRD','.gd','1473'),array('89','GUADELOUPE','GP','GLP','.gp','590'),array('90','GUAM','GU','GUM','.gu','1671'),array('91','GUATEMALA','GT','GTM','.gt','502'),array('92','GUERNSEY','GG','GGY','.gg','0'),array('93','GUINEA','GN','GIN','.gn','224'),array('94','GUINEA-BISSAU','GW','GNB','.gw','245'),array('95','GUYANA','GY','GUY','.gy','592'),array('96','HAITI','HT','HTI','.ht','509'),array('97','HEARD ISLAND AND MCDONALD ISLANDS','HM','HMD','.hm','0'),array('98','HONDURAS','HN','HND','.hn','504'),array('99','HONG KONG array(Special Administrative Region of China)','HK','HKG','.hk','852'),array('100','HUNGARY','HU','HUN','.hu','36'),array('101','ICELAND','IS','ISL','.is','354'),array('102','INDIA','IN','IND','.in','91'),array('103','INDONESIA','ID','IDN','.id','62'),array('104','IRAN array(Islamic Republic of Iran)','IR','IRN','.ir','98'),array('105','IRAQ','IQ','IRQ','.iq','964'),array('106','IRELAND','IE','IRL','.ie','353'),array('107','ISLE OF MAN','IM','IMN','.im','0'),array('108','ISRAEL','IL','ISR','.il','972'),array('109','ITALY','IT','ITA','.it','39'),array('110','JAMAICA','JM','JAM','.jm','1876'),array('111','JAPAN','JP','JPN','.jp','81'),array('112','JORDAN array(Hashemite Kingdom of Jordan)','JO','JOR','.jo','962'),array('113','KAZAKHSTAN','KZ','KAZ','.kz','7'),array('114','KENYA','KE','KEN','.ke','254'),array('115','KIRIBATI','KI','KIR','.ki','686'),array('116','KOREA array(Democratic Peoples Republic of [North] Korea)','KP','PRK','.kp','850'),array('117','KOREA array(Republic of [South] Korea)','KR','KOR','.kr','82'),array('118','KUWAIT','KW','KWT','.kw','965'),array('119','KYRGYZSTAN','KG','KGZ','.kg','996'),array('120','LAO PEOPLES DEMOCRATIC REPUBLIC','LA','LAO','.la','856'),array('121','LATVIA','LV','LVA','.lv','371'),array('122','LEBANON','LB','LBN','.lb','961'),array('123','LESOTHO','LS','LSO','.ls','266'),array('124','LIBERIA','LR','LBR','.lr','231'),array('125','LIBYA array(Libyan Arab Jamahirya)','LY','LBY','.ly','218'),array('126','LIECHTENSTEIN array(Furstentum Liechtenstein)','LI','LIE','.li','423'),array('127','LITHUANIA','LT','LTU','.lt','370'),array('128','LUXEMBOURG','LU','LUX','.lu','352'),array('129','MACAO array(Special Administrative Region of China)','MO','MAC','.mo','853'),array('130','MACEDONIA array(Former Yugoslav Republic of Macedonia)','MK','MKD','.mk','389'),array('131','MADAGASCAR','MG','MDG','.mg','261'),array('132','MALAWI','MW','MWI','.mw','265'),array('133','MALAYSIA','MY','MYS','.my','60'),array('134','MALDIVES','MV','MDV','.mv','960'),array('135','MALI','ML','MLI','.ml','223'),array('136','MALTA','MT','MLT','.mt','356'),array('137','MARSHALL ISLANDS','MH','MHL','.mh','692'),array('138','MARTINIQUE','MQ','MTQ','.mq','596'),array('139','MAURITANIA','MR','MRT','.mr','222'),array('140','MAURITIUS','MU','MUS','.mu','230'),array('141','MAYOTTE','YT','MYT','.yt','269'),array('142','MEXICO','MX','MEX','.mx','52'),array('143','MICRONESIA array(Federated States of Micronesia)','FM','FSM','.fm','691'),array('144','MOLDOVA','MD','MDA','.md','373'),array('145','MONACO','MC','MCO','.mc','377'),array('146','MONGOLIA','MN','MNG','.mn','976'),array('147','MONTENEGRO','ME','MNE','.me','382'),array('148','MONTSERRAT','MS','MSR','.ms','1664'),array('149','MOROCCO','MA','MAR','.ma','212'),array('150','MOZAMBIQUE array(Moçambique)','MZ','MOZ','.mz','258'),array('151','MYANMAR array(formerly Burma)','MM','MMR','.mm','95'),array('152','NAMIBIA','NA','NAM','.na','264'),array('153','NAURU','NR','NRU','.nr','674'),array('154','NEPAL','NP','NPL','.np','977'),array('155','NETHERLANDS','NL','NLD','.nl','31'),array('156','NETHERLANDS ANTILLES','AN','ANT','.an','599'),array('157','NEW CALEDONIA','NC','NCL','.nc','687'),array('158','NEW ZEALAND','NZ','NZL','.nz','64'),array('159','NICARAGUA','NI','NIC','.ni','505'),array('160','NIGER','NE','NER','.ne','227'),array('161','NIGERIA','NG','NGA','.ng','234'),array('162','NIUE','NU','NIU','.nu','683'),array('163','NORFOLK ISLAND','NF','NFK','.nf','0'),array('164','NORTHERN MARIANA ISLANDS','MP','MNP','.mp','1670'),array('165','NORWAY','NO','NOR','.no','47'),array('166','OMAN','OM','OMN','.om','968'),array('167','PAKISTAN','PK','PAK','.pk','92'),array('168','PALAU','PW','PLW','.pw','680'),array('169','PALESTINIAN TERRITORIES','PS','PSE','.ps','970'),array('170','PANAMA','PA','PAN','.pa','507'),array('171','PAPUA NEW GUINEA','PG','PNG','.pg','675'),array('172','PARAGUAY','PY','PRY','.py','595'),array('173','PERU','PE','PER','.pe','51'),array('174','PHILIPPINES','PH','PHL','.ph','63'),array('175','PITCAIRN','PN','PCN','.pn','0'),array('176','POLAND','PL','POL','.pl','48'),array('177','PORTUGAL','PT','PRT','.pt','351'),array('178','PUERTO RICO','PR','PRI','.pr','1'),array('179','QATAR','QA','QAT','.qa','974'),array('180','REUNION','RE','REU','.re','262'),array('181','ROMANIA','RO','ROU','.ro','40'),array('182','RUSSIAN FEDERATION','RU','RUS','.ru','7'),array('183','RWANDA','RW','RWA','.rw','250'),array('184','SAINT BARTHÉLEMY','BL','BLM','.bl','0'),array('185','SAINT HELENA','SH','SHN','.sh','290'),array('186','SAINT KITTS AND NEVIS','KN','KNA','.kn','1869'),array('187','SAINT LUCIA','LC','LCA','.lc','1758'),array('188','SAINT MARTIN array(French portion)','MF','MAF','.mf','0'),array('189','SAINT PIERRE AND MIQUELON','PM','SPM','.pm','508'),array('190','SAINT VINCENT AND THE GRENADINES','VC','VCT','.vc','1784'),array('191','SAMOA array(formerly Western Samoa)','WS','WSM','.ws','685'),array('192','SAN MARINO array(Republic of)','SM','SMR','.sm','378'),array('193','SAO TOME AND PRINCIPE','ST','STP','.st','239'),array('194','SAUDI ARABIA array(Kingdom of Saudi Arabia)','SA','SAU','.sa','966'),array('195','SENEGAL','SN','SEN','.sn','221'),array('196','SERBIA array(Republic of Serbia)','RS','SRB','.rs','381'),array('197','SEYCHELLES','SC','SYC','.sc','248'),array('198','SIERRA LEONE','SL','SLE','.sl','232'),array('199','SINGAPORE','SG','SGP','.sg','65'),array('200','SLOVAKIA array(Slovak Republic)','SK','SVK','.sk','421'),array('201','SLOVENIA','SI','SVN','.si','386'),array('202','SOLOMON ISLANDS','SB','SLB','.sb','677'),array('203','SOMALIA','SO','SOM','.so','252'),array('204','SOUTH AFRICA array(Zuid Afrika)','ZA','ZAF','.za','27'),array('205','SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS','GS','SGS','.gs','0'),array('206','SPAIN array(España)','ES','ESP','.es','34'),array('207','SRI LANKA array(formerly Ceylon)','LK','LKA','.lk','94'),array('208','SUDAN','SD','SDN','.sd','249'),array('209','SURINAME','SR','SUR','.sr','597'),array('210','SVALBARD AND JAN MAYEN','SJ','SJM','.sj','0'),array('211','SWAZILAND','SZ','SWZ','.sz','268'),array('212','SWEDEN','SE','SWE','.se','46'),array('213','SWITZERLAND array(Confederation of Helvetia)','CH','CHE','.ch','41'),array('214','SYRIAN ARAB REPUBLIC','SY','SYR','.sy','963'),array('215','TAIWAN array(\Chinese Taipei\" for IOC)"','TW','TWN','.tw','886'),array('216','TAJIKISTAN','TJ','TJK','.tj','992'),array('217','TANZANIA','TZ','TZA','.tz','255'),array('218','THAILAND','TH','THA','.th','66'),array('219','TIMOR-LESTE array(formerly East Timor)','TL','TLS','.tp','670'),array('220','TOGO','TG','TGO','.tg','228'),array('221','TOKELAU','TK','TKL','.tk','690'),array('222','TONGA','TO','TON','.to','676'),array('223','TRINIDAD AND TOBAGO','TT','TTO','.tt','1868'),array('224','TUNISIA','TN','TUN','.tn','216'),array('225','TURKEY','TR','TUR','.tr','90'),array('226','TURKMENISTAN','TM','TKM','.tm','993'),array('227','TURKS AND CAICOS ISLANDS','TC','TCA','.tc','1649'),array('228','TUVALU','TV','TUV','.tv','688'),array('229','UGANDA','UG','UGA','.ug','256'),array('230','UKRAINE','UA','UKR','.ua','380'),array('231','UNITED ARAB EMIRATES','AE','ARE','.ae','971'),array('232','UNITED KINGDOM array(Great Britain)','GB','GBR','.uk','44'),array('233','UNITED STATES MINOR OUTLYING ISLANDS','UM','UMI','.um','1'),array('234','URUGUAY','UY','URY','.uy','598'),array('235','UZBEKISTAN','UZ','UZB','.uz','998'),array('236','VANUATU','VU','VUT','.vu','678'),array('237','VATICAN CITY array(Holy See)','VA','VAT','.va','379'),array('238','VENEZUELA','VE','VEN','.ve','58'),array('239','VIET NAM','VN','VNM','.vn','84'),array('240','VIRGIN ISLANDS, BRITISH','VG','VGB','.vg','1284'),array('241','VIRGIN ISLANDS, U.S.','VI','VIR','.vi','1340'),array('242','WALLIS AND FUTUNA','WF','WLF','.wf','681'),array('243','WESTERN SAHARA array(formerly Spanish Sahara)','EH','ESH','.eh','0'),array('244','YEMEN array(Yemen Arab Republic)','YE','YEM','.ye','967'),array('245','ZAMBIA array(formerly Northern Rhodesia)','ZM','ZMB','.zm','260'),array('246','ZIMBABWE','ZW','ZWE','.zw','263')
37
+ );
38
+
39
+ public static function getCustomerStateCode($country_id, $state_code, $state_name){
40
+ foreach (self::$states as $s){
41
+ if ($s[1] == $country_id && $s[3] == $state_code)
42
+ return $s[3];
43
+ }
44
+ foreach (self::$states as $s){
45
+ if ($s[1] == $country_id && strpos($s[2], $state_name) !== false)
46
+ return $s[3];
47
+ }
48
+ return $state_code ? $state_code : '';
49
+ }
50
+
51
+ public static function getCustomerCountryCode($country_code){
52
+ return self::getCustomerCountry($country_code);
53
+ }
54
+
55
+ public static function getCustomerCountryId($country_code){
56
+ return self::getCustomerCountry($country_code, 'id');
57
+ }
58
+
59
+ public static function getCustomerCountryPhoneNumber($country_code){
60
+ return self::getCustomerCountry($country_code, 'number');
61
+ }
62
+
63
+ public static function getCustomerCountry($country_code, $type = 'code'){
64
+ $ind = 3;
65
+ switch ($type){
66
+ case 'code': $ind = 3; break;
67
+ case 'id': $ind = 0; break;
68
+ case 'number': $ind = 5; break;
69
+ }
70
+ foreach (self::$countries as $c){
71
+ if ($c[2] == $country_code)
72
+ return $c[$ind];
73
+ }
74
+ return $country_code;
75
+ }
76
+
77
+ }
app/code/community/Modulesgarden/Gpndata/Model/Notification.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-04, 09:32:27)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ abstract class Modulesgarden_Gpndata_Model_Notification {
30
+
31
+ protected $_notificationXml;
32
+
33
+ abstract public function isChecksumOk($config);
34
+ abstract public function process(Modulesgarden_Gpndata_Model_Notification_Response $response);
35
+
36
+ public function setXml(SimpleXMLElement $xml){
37
+ $this->_notificationXml = $xml;
38
+ }
39
+
40
+ public function getNotificationValue($key, $default = null){
41
+ if (!$this->_notificationXml)
42
+ Mage::throwException('Notification XML is not valid');
43
+
44
+ return isset($this->_notificationXml->$key) ? (string)$this->_notificationXml->$key : $default;
45
+ }
46
+
47
+ public static function factory($xml_string){
48
+ $notificationXml = simplexml_load_string($xml_string);
49
+ if (!$notificationXml)
50
+ Mage::throwException('Notification XML is not valid');
51
+
52
+ $obj = Mage::getModel('gpndata/notification_' . (string)$notificationXml->apiCmd);
53
+ if (!$obj)
54
+ Mage::throwException('Notification type is not implemented yet');
55
+
56
+ $obj->setXml($notificationXml);
57
+ return $obj;
58
+ }
59
+
60
+ public static function isProperIp($clientIp, $gateway_url){
61
+ $parse = parse_url($gateway_url);
62
+ $gateway_ip = gethostbyname($parse['host']);
63
+
64
+ return $clientIp == $gateway_ip;
65
+ }
66
+
67
+ protected function _parseMerchantTransId($merchanttransid){
68
+ $sub_merchanttransid = substr($merchanttransid, 8);
69
+ $fp = strpos($sub_merchanttransid, '_');
70
+ $lp = strrpos($sub_merchanttransid, '_');
71
+ if (!$fp || !$lp)
72
+ Mage::throwException('Merchant Transaction Id is not valid');
73
+
74
+ return array(
75
+ 'order_id' => substr($sub_merchanttransid, 0, $fp),
76
+ 'payment_id'=> substr($sub_merchanttransid, $fp+1, $lp-$fp-1),
77
+ );
78
+ }
79
+
80
+ }
app/code/community/Modulesgarden/Gpndata/Model/Notification/850.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-04, 10:59:27)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * Command Notification
31
+ * Description: Notifies the merchant about the result of a submitted charge as well as most other commands except for Refunds (760).
32
+ * The Notification will be sent to the Notification URL supplied by the merchant.
33
+ *
34
+ * RESPONSE 850
35
+ * <transaction>
36
+ * <result></result>
37
+ * <gatetransid></gatetransid>
38
+ * <merchanttransid></merchanttransid>
39
+ * <errorcode></errorcode>
40
+ * <errormessage></errormessage>
41
+ * </transaction>
42
+ */
43
+ class Modulesgarden_Gpndata_Model_Notification_850 extends Modulesgarden_Gpndata_Model_Notification {
44
+
45
+ public function isChecksumOk($config){
46
+ if (!$this->_notificationXml)
47
+ Mage::throwException('Notification XML is not valid');
48
+
49
+ $calculated = sha1(
50
+ $this->getNotificationValue('apiUser') .
51
+ $this->getNotificationValue('apiPassword') .
52
+ $this->getNotificationValue('apiCmd') .
53
+ $this->getNotificationValue('merchanttransid') .
54
+ $this->getNotificationValue('amount') .
55
+ $this->getNotificationValue('curcode') .
56
+ $config['api_key']
57
+ );
58
+
59
+ return $calculated == $this->getNotificationValue('checksum');
60
+ }
61
+
62
+ /**
63
+ * possible state:
64
+ * - AUTHORIZED: Funds from Customers Credit Card account
65
+ * - CAPTURED: Custo charged with the amount of the transaction.
66
+ * - DECLINED: transaction was declined.
67
+ * - CHARGEBACK: means that a charge back for the transaction was received by the gateway. Charge back notifications can be sent to the merchant at any time after the transaction was initially APPROVED.
68
+ * - PENDING: in time of 3DS?
69
+ * @param Modulesgarden_Gpndata_Model_Notification_Response $response
70
+ */
71
+ public function process(Modulesgarden_Gpndata_Model_Notification_Response $response){
72
+
73
+ // notification is asynchronous and order could not exist yet
74
+
75
+ $gatetransid = $this->getNotificationValue('gatetransid');
76
+ $merchanttransid = $this->getNotificationValue('merchanttransid');
77
+ $state = $this->getNotificationValue('state');
78
+ $transaction_details= $this->_parseMerchantTransId($merchanttransid);
79
+
80
+ // no success -> no transaction
81
+ if (in_array($state, array('PARTIAL_SUCCESS','PENDING','CANCELED','CANCELED_AUTO','ERROR','REFUNDED','DECLINED'))){
82
+ return $response
83
+ ->setResult('OK')
84
+ ->setGatetransid($gatetransid)
85
+ ->setMerchanttransid($merchanttransid);
86
+ }
87
+
88
+ if ($this->isRebill()){
89
+
90
+ $recurringProfile = Mage::getModel('sales/recurring_profile')->load( $transaction_details['order_id'] );
91
+ if ($recurringProfile->getMethodCode()){
92
+ $additionalInfo = $recurringProfile->getAdditionalInfo() ? $recurringProfile->getAdditionalInfo() : array();
93
+ $additionalInfo['gatetransid'] = $gatetransid;
94
+ $recurringProfile->setAdditionalInfo( serialize($additionalInfo));
95
+ $recurringProfile->save();
96
+
97
+ // add order assigned to the recurring profile with initial fee
98
+ if ($recurringProfile->getInitAmount()){
99
+ $productItemInfo = new Varien_Object;
100
+ $productItemInfo->setPaymentType(Mage_Sales_Model_Recurring_Profile::PAYMENT_TYPE_INITIAL);
101
+ $productItemInfo->setPrice($recurringProfile->getInitAmount());
102
+
103
+ $order = $recurringProfile->createOrder($productItemInfo);
104
+
105
+ $payment = $order->getPayment();
106
+ $payment->setTransactionId($gatetransid . '-initial')->setIsTransactionClosed(1);
107
+ $order->save();
108
+ $recurringProfile->addOrderRelation($order->getId());
109
+ $order->save();
110
+ $payment->save();
111
+
112
+ $transaction= Mage::getModel('sales/order_payment_transaction');
113
+ $transaction->setTxnId($gatetransid . '-initial');
114
+ $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
115
+ $transaction->setPaymentId($payment->getId());
116
+ $transaction->setOrderId($order->getId());
117
+ $transaction->setOrderPaymentObject($payment);
118
+ $transaction->setIsClosed( 1 );
119
+ $transaction->save();
120
+ }
121
+
122
+ return $response
123
+ ->setResult('OK')
124
+ ->setGatetransid($gatetransid)
125
+ ->setMerchanttransid($merchanttransid);
126
+
127
+ }
128
+ return $response
129
+ ->setResult('ERROR')
130
+ ->setGatetransid($gatetransid)
131
+ ->setMerchanttransid($merchanttransid)
132
+ ->setErrorcode(403)
133
+ ->setErrormessage('Recurring Profile #'.$transaction_details['order_id'].' is not created yet');
134
+ }
135
+
136
+
137
+
138
+ $order = Mage::getModel('sales/order')->load($transaction_details['order_id']);
139
+
140
+ if ($order->isEmpty()){
141
+ return $response
142
+ ->setResult('ERROR')
143
+ ->setGatetransid($gatetransid)
144
+ ->setMerchanttransid($merchanttransid)
145
+ ->setErrorcode(403)
146
+ ->setErrormessage('Order '.$transaction_details['order_id'].' is not created yet');
147
+ }
148
+
149
+ // PARTIAL_SUCCESS, DECLINED, CANCELED, CANCELED_AUTO, ERROR, REFUNDED
150
+ if (in_array($state, array('AUTHORIZED','CAPTURED','CHARGEBACK'))){
151
+
152
+ switch ($state){
153
+ case 'AUTHORIZED': $transactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH; break;
154
+ case 'CAPTURED': $transactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE; break;
155
+ case 'CHARGEBACK': $transactionType = Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID; break;
156
+ default: Mage::throwException('Unable to add transaction');
157
+ }
158
+
159
+ $payment = Mage::getModel('sales/order_payment')->load($transaction_details['payment_id']);
160
+ $transaction= Mage::getModel('sales/order_payment_transaction');
161
+ $transaction->setTxnId($merchanttransid);
162
+ $transaction->setPaymentId($transaction_details['payment_id']);
163
+ $transaction->setOrderId($transaction_details['order_id']);
164
+ $transaction->setOrderPaymentObject($payment);
165
+ $transaction->setTxnType($transactionType);
166
+ $transaction->setIsClosed( $transactionType == Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE ? 1 : 0 );
167
+ $transaction->setAdditionalInformation( Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, array(
168
+ 'gatetransid' => $gatetransid
169
+ ));
170
+
171
+ $parentTransaction = $payment->getTransaction($merchanttransid);
172
+ if ($parentTransaction){
173
+ $transaction->setParentTxnId($merchanttransid);
174
+ $transaction->setTxnId($gatetransid);
175
+ }
176
+
177
+ $transaction->save();
178
+ }
179
+
180
+ $response
181
+ ->setResult('OK')
182
+ ->setGatetransid($gatetransid)
183
+ ->setMerchanttransid($merchanttransid);
184
+ }
185
+
186
+ public function isRebill(){
187
+ return $this->getNotificationValue('merchantspecific3') == 'rebill';
188
+ }
189
+
190
+ }
app/code/community/Modulesgarden/Gpndata/Model/Notification/860.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-06, 11:02:40)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * Refund Notification.
31
+ * Description: Notifies the merchant about the result of a submitted refund. Direction: From Transaction Server to merchant Server.
32
+ *
33
+ * Request:
34
+ * <transaction>
35
+ * <apiUser></apiUser>
36
+ * <apiPassword></apiPassword>
37
+ * <apiCmd></apiCmd>
38
+ * <gatetransid></gatetransid>
39
+ * <amount></amount>
40
+ * <status></status>
41
+ * <reason></reason>
42
+ * <checksum></checksum>
43
+ * </transaction>
44
+ *
45
+ * Response:
46
+ * <transaction>
47
+ * <result></result>
48
+ * <gatetransid></gatetransid>
49
+ * <errorcode></errorcode>
50
+ * <errormessage></errormessage>
51
+ * </transaction>
52
+ */
53
+ class Modulesgarden_Gpndata_Model_Notification_860 extends Modulesgarden_Gpndata_Model_Notification {
54
+
55
+ public function isChecksumOk($config){
56
+ if (!$this->_notificationXml)
57
+ Mage::throwException('Notification XML is not valid');
58
+
59
+ $calculated = sha1(
60
+ $this->getNotificationValue('apiUser') .
61
+ $this->getNotificationValue('apiPassword') .
62
+ $this->getNotificationValue('apiCmd') .
63
+ $this->getNotificationValue('gatetransid') .
64
+ $this->getNotificationValue('amount') .
65
+ $this->getNotificationValue('status') .
66
+ $config['api_key']
67
+ );
68
+
69
+ return $calculated == $this->getNotificationValue('checksum');
70
+ }
71
+
72
+ public function process(Modulesgarden_Gpndata_Model_Notification_Response $response){
73
+ $gatetransid = $this->getNotificationValue('gatetransid');
74
+
75
+ if ($this->getNotificationValue('status') == 'OK' || $this->getNotificationValue('status') == 'SUCCESS'){
76
+
77
+ $transaction = Mage::getModel('sales/order_payment_transaction');
78
+ $transaction->loadByTxnId($gatetransid);
79
+
80
+ if (!$transaction->isEmpty()){
81
+
82
+ $payment = Mage::getModel('sales/order_payment')->load( $transaction->getPaymentId() );
83
+ $newTransaction = Mage::getModel('sales/order_payment_transaction');
84
+ $newTransaction->setTxnId($gatetransid . '_refund');
85
+ $newTransaction->setParentTxnId($transaction->getTxnId());
86
+ $newTransaction->setPaymentId($transaction->getPaymentId());
87
+ $newTransaction->setOrderId($transaction->getOrderId());
88
+ $newTransaction->setOrderPaymentObject($payment);
89
+ $newTransaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND);
90
+ $newTransaction->setIsClosed(1);
91
+ $newTransaction->setAdditionalInformation( Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, array(
92
+ 'reason' => $this->getNotificationValue('reason')
93
+ ));
94
+ $newTransaction->save();
95
+ }
96
+ }
97
+
98
+ $response
99
+ ->setResult('OK')
100
+ ->setGatetransid($gatetransid);
101
+ }
102
+
103
+ }
app/code/community/Modulesgarden/Gpndata/Model/Notification/870.php ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-11, 12:15:52)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * Rebill Notification
31
+ * Description: Notifies the merchant about the result of a submitted Rebill transaction.
32
+ *
33
+ * Request:
34
+ * <transaction>
35
+ * <apiUser></apiUser>
36
+ * <apiPassword></apiPassword>
37
+ * <apiCmd></apiCmd>
38
+ * <gatetransid></gatetransid>
39
+ * <gaterebillid></gaterebillid>
40
+ * <status></status>
41
+ * <reason></reason>
42
+ * <checksum></checksum>
43
+ * </transaction>
44
+ *
45
+ * Response:
46
+ * <transaction>
47
+ * <result></result>
48
+ * <gatetransid></gatetransid>
49
+ * <errorcode></errorcode>
50
+ * <errormessage></errormessage>
51
+ * </transaction>
52
+ */
53
+ class Modulesgarden_Gpndata_Model_Notification_870 extends Modulesgarden_Gpndata_Model_Notification {
54
+
55
+ public function isChecksumOk($config){
56
+ if (!$this->_notificationXml)
57
+ Mage::throwException('Notification XML is not valid');
58
+
59
+ $calculated = sha1(
60
+ $this->getNotificationValue('apiUser') .
61
+ $this->getNotificationValue('apiPassword') .
62
+ $this->getNotificationValue('apiCmd') .
63
+ $this->getNotificationValue('gaterebillid') .
64
+ $this->getNotificationValue('gatetransid') .
65
+ $this->getNotificationValue('status') .
66
+ $config['api_key']
67
+ );
68
+ return $calculated == $this->getNotificationValue('checksum');
69
+ }
70
+
71
+ public function process(Modulesgarden_Gpndata_Model_Notification_Response $response){
72
+
73
+ sleep(10);
74
+
75
+ $recurringProfileCollection = Mage::getModel('sales/recurring_profile')
76
+ ->getCollection()
77
+ ->addFieldToFilter('additional_info', array(
78
+ array('like' => '%'.$this->getNotificationValue('gaterebillid').'%'),
79
+ ));
80
+
81
+ $profile = $recurringProfileCollection->getFirstItem();
82
+
83
+ if ($profile->isEmpty()){
84
+ return $response
85
+ ->setResult('ERROR')
86
+ ->setErrorcode(403)
87
+ ->setErrormessage('Recurring Profile is not created yet');
88
+ }
89
+
90
+ if ($this->getNotificationValue('status') == 'CANCELED'){
91
+
92
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_CANCELED);
93
+ $profile->save();
94
+
95
+ } elseif ($this->getNotificationValue('status') == 'SUCCESS'){
96
+
97
+ $gatetransid = $this->getNotificationValue('gatetransid');
98
+
99
+ $order = $this->_createOrder($profile);
100
+
101
+ $payment = $order->getPayment();
102
+ $payment->setTransactionId($gatetransid . '-rebill')->setIsTransactionClosed(1);
103
+ $order->save();
104
+ $profile->addOrderRelation($order->getId());
105
+ //$payment->save();
106
+
107
+ $transaction= Mage::getModel('sales/order_payment_transaction');
108
+ $transaction->setTxnId($gatetransid . '-rebill');
109
+ $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
110
+ $transaction->setPaymentId($payment->getId());
111
+ $transaction->setOrderId($order->getId());
112
+ $transaction->setOrderPaymentObject($payment);
113
+ $transaction->setIsClosed( 1 );
114
+ $transaction->save();
115
+
116
+ } elseif ($this->getNotificationValue('status') == 'DECLINED'){
117
+
118
+ // failure -> save it
119
+ $additionalInfo = $profile->getAdditionalInfo() ? $profile->getAdditionalInfo() : array();
120
+ $additionalInfo['failures'] = isset($additionalInfo['failures']) ? ++$additionalInfo['failures'] : 1;
121
+
122
+ // suspend if failures limit occured
123
+ if ($profile->getSuspensionThreshold() && $additionalInfo['failures'] >= $profile->getSuspensionThreshold())
124
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_SUSPENDED);
125
+
126
+ $profile->setAdditionalInfo( serialize($additionalInfo));
127
+ $profile->save();
128
+ }
129
+
130
+ return $response
131
+ ->setResult('OK')
132
+ ->setGaterebillid( $this->getNotificationValue('gaterebillid') );
133
+ }
134
+
135
+ protected function _createOrder(Mage_Sales_Model_Recurring_Profile $profile){
136
+
137
+ $orderInfo = is_string($profile->getOrderInfo()) ? unserialize($profile->getOrderInfo()) : $profile->getOrderInfo();
138
+ $orderItemInfo = is_string($profile->getOrderItemInfo()) ? unserialize($profile->getOrderItemInfo()) : $profile->getOrderItemInfo();
139
+ $billingAddressInfo = is_string($profile->getBillingAddressInfo()) ? unserialize($profile->getBillingAddressInfo()) : $profile->getBillingAddressInfo();
140
+ $shippingAddressInfo= is_string($profile->getShippingAddressInfo()) ? unserialize($profile->getShippingAddressInfo()) : $profile->getShippingAddressInfo();
141
+
142
+ $item = Mage::getModel('sales/order_item')
143
+ ->setName( 'Rebill for Recurring Profile #' . $profile->getId())
144
+ ->setQtyOrdered( $orderItemInfo['qty'] )
145
+ ->setBaseOriginalPrice($profile->getBillingAmount() )
146
+ ->setPrice( $profile->getBillingAmount() )
147
+ ->setBasePrice( $profile->getBillingAmount() )
148
+ ->setRowTotal( $profile->getBillingAmount() )
149
+ ->setBaseRowTotal( $profile->getBillingAmount() )
150
+ ->setTaxAmount( $profile->getTaxAmount() )
151
+ ->setShippingAmount($profile->getShippingAmount() )
152
+ ->setPaymentType( Mage_Sales_Model_Recurring_Profile::PAYMENT_TYPE_REGULAR)
153
+ ->setIsVirtual( $orderItemInfo['is_virtual'] )
154
+ ->setWeight( $orderItemInfo['weight'] )
155
+ ->setId(null);
156
+
157
+ $grandTotal = $profile->getBillingAmount() + $profile->getShippingAmount() + $profile->getTaxAmount();
158
+
159
+ $order = Mage::getModel('sales/order');
160
+
161
+ $billingAddress = Mage::getModel('sales/order_address')
162
+ ->setData($billingAddressInfo)
163
+ ->setId(null);
164
+
165
+ $shippingAddress = Mage::getModel('sales/order_address')
166
+ ->setData($shippingAddressInfo)
167
+ ->setId(null);
168
+
169
+ $payment = Mage::getModel('sales/order_payment')
170
+ ->setMethod($profile->getMethodCode());
171
+
172
+ $transferDataKays = array(
173
+ 'store_id', 'store_name', 'customer_id', 'customer_email',
174
+ 'customer_firstname', 'customer_lastname', 'customer_middlename', 'customer_prefix',
175
+ 'customer_suffix', 'customer_taxvat', 'customer_gender', 'customer_is_guest',
176
+ 'customer_note_notify', 'customer_group_id', 'customer_note', 'shipping_method',
177
+ 'shipping_description', 'base_currency_code', 'global_currency_code', 'order_currency_code',
178
+ 'store_currency_code', 'base_to_global_rate', 'base_to_order_rate', 'store_to_base_rate',
179
+ 'store_to_order_rate'
180
+ );
181
+
182
+ foreach ($transferDataKays as $key) {
183
+ if (isset($orderInfo[$key])) {
184
+ $order->setData($key, $orderInfo[$key]);
185
+ } elseif (isset($shippingAddressInfo[$key])) {
186
+ $order->setData($key, $shippingAddressInfo[$key]);
187
+ }
188
+ }
189
+
190
+ $order
191
+ ->setState( Mage_Sales_Model_Order::STATE_NEW )
192
+ ->setBaseToOrderRate( $orderInfo['base_to_quote_rate'])
193
+ ->setStoreToOrderRate( $orderInfo['store_to_quote_rate'])
194
+ ->setOrderCurrencyCode( $orderInfo['quote_currency_code'])
195
+ ->setBaseSubtotal( $profile->getBillingAmount() )
196
+ ->setSubtotal( $profile->getBillingAmount() )
197
+ ->setBaseShippingAmount($profile->getShippingAmount() )
198
+ ->setShippingAmount( $profile->getShippingAmount() )
199
+ ->setBaseTaxAmount( $profile->getTaxAmount() )
200
+ ->setTaxAmount( $profile->getTaxAmount() )
201
+ ->setBaseGrandTotal( $grandTotal)
202
+ ->setGrandTotal( $grandTotal)
203
+ ->setIsVirtual( $orderItemInfo['is_virtual'] )
204
+ ->setWeight( $orderItemInfo['weight'] )
205
+ ->setTotalQtyOrdered( $orderItemInfo['qty'] )
206
+ ->setBillingAddress( $billingAddress )
207
+ ->setShippingAddress( $shippingAddress )
208
+ ->setPayment( $payment );
209
+
210
+ $order->addItem($item);
211
+
212
+ return $order;
213
+ }
214
+
215
+ }
app/code/community/Modulesgarden/Gpndata/Model/Notification/Response.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-04, 10:15:51)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Model_Notification_Response extends Varien_Object {
30
+
31
+ protected $_responseXml;
32
+
33
+ public function __construct(){
34
+ $this->_responseXml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?><transaction/>');
35
+ }
36
+
37
+ public function getXml(){
38
+ foreach ($this->getData() as $k => $v)
39
+ $this->_responseXml->addChild($k, $v);
40
+
41
+ return $this->_responseXml->asXML();
42
+ }
43
+
44
+ }
app/code/community/Modulesgarden/Gpndata/Model/Observer.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-19, 09:27:40)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Model_Observer {
30
+
31
+ /**
32
+ * Cron job method to charge recurring profiles
33
+ *
34
+ * @param Mage_Cron_Model_Schedule $schedule
35
+ */
36
+ public function chargeRecurringProfiles(Mage_Cron_Model_Schedule $schedule){
37
+ if (!Mage::getStoreConfig('payment/gpndatarecurring/activecron'))
38
+ return false;
39
+
40
+ $_resource = Mage::getSingleton('core/resource');
41
+ $sql = '
42
+ SELECT
43
+ CASE srp.period_unit
44
+ WHEN "day" THEN FLOOR(DATEDIFF(NOW(), srp.updated_at) / srp.period_frequency)
45
+ WHEN "week" THEN FLOOR(FLOOR(DATEDIFF(NOW(), srp.updated_at) / 7) / srp.period_frequency)
46
+ WHEN "semi_month" THEN FLOOR(FLOOR(DATEDIFF(NOW(), srp.updated_at) / 14) / srp.period_frequency)
47
+ WHEN "month" THEN FLOOR(PERIOD_DIFF(DATE_FORMAT(NOW(), "%Y%m"), DATE_FORMAT(srp.updated_at, "%Y%m")) - (DATE_FORMAT(NOW(), "%d") < DATE_FORMAT(srp.updated_at, "%d")) / srp.period_frequency)
48
+ WHEN "year" THEN FLOOR(YEAR(NOW()) - YEAR(srp.updated_at) - (DATE_FORMAT(NOW(), "%m%d") < DATE_FORMAT(srp.updated_at, "%m%d")) / srp.period_frequency)
49
+ END
50
+ AS billing_count,
51
+ srp.*
52
+ FROM '.$_resource->getTableName('sales_recurring_profile').' AS srp
53
+ WHERE
54
+ srp.method_code = "gpndatarecurring" AND
55
+ srp.state = "active" AND
56
+ srp.updated_at <= NOW() AND
57
+ srp.start_datetime <= NOW() AND
58
+ (
59
+ (
60
+ srp.start_datetime > srp.updated_at AND
61
+ srp.start_datetime <= NOW()
62
+ )
63
+ OR
64
+ (
65
+ srp.start_datetime <= srp.updated_at AND
66
+ NOW() >= CASE srp.period_unit
67
+ WHEN "day" THEN DATE_ADD(srp.updated_at, INTERVAL srp.period_frequency DAY)
68
+ WHEN "week" THEN DATE_ADD(srp.updated_at, INTERVAL srp.period_frequency WEEK)
69
+ WHEN "semi_month" THEN DATE_ADD(srp.updated_at, INTERVAL (srp.period_frequency * 2) WEEK)
70
+ WHEN "month" THEN DATE_ADD(srp.updated_at, INTERVAL srp.period_frequency MONTH)
71
+ WHEN "year" THEN DATE_ADD(srp.updated_at, INTERVAL srp.period_frequency YEAR)
72
+ END
73
+ )
74
+ )
75
+ ';
76
+
77
+ $connection = $_resource->getConnection('core_read');
78
+ $recurring = Mage::getModel('gpndata/paymentrecurring');
79
+
80
+ foreach ($connection->fetchAll($sql) as $profileArr) {
81
+
82
+ $profile = Mage::getModel('sales/recurring_profile')->addData($profileArr);
83
+ $orders = $profile->getResource()->getChildOrderIds($profile);
84
+ $countBillingCycling = count($orders);
85
+ if ($profile->getInitAmount())
86
+ $countBillingCycling--;
87
+
88
+ if ($profile->getBillFailedLater()){ // Auto Bill on Next Cycle
89
+ // multi charges
90
+ for ($i = 0; $i < $profile->getBillingCount(); $i++){
91
+ if ($recurring->chargeRecurringProfile($profile)){
92
+ $countBillingCycling++;
93
+ } else {
94
+ break;
95
+ }
96
+
97
+ if ($countBillingCycling >= $profile->getPeriodMaxCycles()){
98
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_SUSPENDED);
99
+ break;
100
+ }
101
+ }
102
+
103
+ } else {
104
+ // single charge
105
+ if ($recurring->chargeRecurringProfile($profile))
106
+ $countBillingCycling++;
107
+
108
+ if ($countBillingCycling >= $profile->getPeriodMaxCycles())
109
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_SUSPENDED);
110
+ }
111
+ }
112
+ }
113
+
114
+ /**
115
+ * before admin/sales_recurring_profile/view/profile/PROFILE_ID
116
+ * @param Varien_Event_Observer $observer
117
+ */
118
+ public function manualRebill(Varien_Event_Observer $observer){
119
+ $r = Mage::app()->getRequest();
120
+ $isManualRebill = (bool)$r->getParam('manual_rebill', false);
121
+ $profile_id = (int)$r->getParam('profile');
122
+ $session = Mage::getSingleton('adminhtml/session');
123
+ $helper = Mage::helper('gpndata');
124
+
125
+ if ($isManualRebill && $profile_id){
126
+ $recurring = Mage::getModel('gpndata/paymentrecurring');
127
+ $profile = Mage::getModel('sales/recurring_profile')->load($profile_id);
128
+
129
+ if ($profile->getMethodCode() == 'gpndatarecurring'){
130
+
131
+ $orders = $profile->getResource()->getChildOrderIds($profile);
132
+ $countBillingCycling = count($orders);
133
+ if ($profile->getInitAmount())
134
+ $countBillingCycling--;
135
+
136
+ if ($recurring->chargeRecurringProfile($profile)){
137
+ $countBillingCycling++;
138
+
139
+ if ($countBillingCycling >= $profile->getPeriodMaxCycles()){
140
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_SUSPENDED);
141
+ $profile->save();
142
+ }
143
+ $session->addSuccess($helper->__('Recurring Profile has been charged.'));
144
+
145
+ } else {
146
+ $session->addError($helper->__('Error during charging recurring profile.'));
147
+ }
148
+
149
+
150
+ } else {
151
+ $session->addError($helper->__('This is not GPN DATA gateway. Unable to proceed.'));
152
+ }
153
+
154
+ Mage::app()->getFrontController()->getResponse()->setRedirect(
155
+ Mage::helper('adminhtml')->getUrl('adminhtml/sales_recurring_profile/view', array('profile' => $profile_id))
156
+ );
157
+ Mage::app()->getResponse()->sendResponse();
158
+ exit;
159
+ }
160
+ }
161
+
162
+ /**
163
+ * This is fix for magento bug: in Mage_Checkout_Model_Type_Onepage::saveOrder it does not redirect to any url (3DS)
164
+ * @param Varien_Event_Observer $observer
165
+ */
166
+ public function checkout_submit_all_after($observer){
167
+ $session = Mage::getSingleton('checkout/session');
168
+ $url = Mage::getModel('gpndata/paymentrecurring')->getOrderPlaceRedirectUrl();
169
+ if ($session->getLastRecurringProfileIds() && $url){
170
+ $session->setRedirectUrl($url);
171
+ }
172
+ }
173
+
174
+ }
app/code/community/Modulesgarden/Gpndata/Model/Payment.php ADDED
@@ -0,0 +1,288 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-01-24, 15:46:03)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Model_Payment extends Mage_Payment_Model_Method_Cc {
30
+
31
+ const TYPE_AUTHORIZE = 'authorize';
32
+ const TYPE_AUTHORIZE_CAPTURE = 'authorize_capture';
33
+
34
+ protected $_code = 'gpndata';
35
+
36
+ protected $_isGateway = true; // Is this payment method a gateway (online auth/charge) ?
37
+ protected $_canAuthorize = true; // Can authorize online?
38
+ protected $_canCapture = true; // Can capture funds online?
39
+ protected $_canUseInternal = true; // Can use this payment method in administration panel?
40
+ protected $_canUseCheckout = true; // Can show this payment method as an option on checkout payment page?
41
+ protected $_canRefund = true;
42
+ protected $_canVoid = true;
43
+ protected $_canRefundInvoicePartial = true;
44
+ protected $_isInitializeNeeded = false;
45
+
46
+ protected $_formBlockType = 'gpndata/form_cc';
47
+
48
+
49
+ public function getOrderPlaceRedirectUrl(){
50
+ if (Mage::getSingleton('core/session')->getAcs())
51
+ return Mage::getUrl('gpndata/redirect/index', array('_secure' => true));
52
+ return null;
53
+ }
54
+
55
+ public function authorize(Varien_Object $payment, $amount){
56
+
57
+ $conf = Mage::getStoreConfig('payment/gpndata');
58
+ $order = $payment->getOrder();
59
+
60
+ $request = $this->_getRequest(700);
61
+ $request->setType(self::TYPE_AUTHORIZE);
62
+ $request->setIs3ds( $conf['payment_3ds'] ? true : false );
63
+ $request->setOrder($order);
64
+ $request->setPayment($payment);
65
+ $request->setAmount($this->_formatAmount($amount));
66
+ $request->setInfoInstance($this->getInfoInstance());
67
+ $response = $request->post();
68
+
69
+ if ($response->simpleResponseValue('result') == 'SUCCESS' || $response->simpleResponseValue('result') == 'PENDING'){
70
+
71
+ $payment->setCcTransId( $request->getMerchantTransId() );
72
+ $payment->setLastTransId ( $request->getMerchantTransId() );
73
+ $payment->setSkipTransactionCreation(true);
74
+ $payment->setIsTransactionClosed(false);
75
+
76
+ if ($response->simpleResponseValue('ACS')){
77
+ Mage::helper('gpndata')->prepare3ds($response);
78
+ $order->setGpndataMd((string)$response->getXml()->parameters->MD);
79
+ }
80
+
81
+ return $this;
82
+
83
+ } else {
84
+ if ($response->getErrorMsg())
85
+ Mage::log($response->getErrorMsg(), null, 'gpndatalog.log');
86
+ Mage::throwException( 'Gateway response: ' . $response->simpleResponseValue('result') );
87
+ }
88
+ }
89
+
90
+ /**
91
+ * Third-party API stuff would go here, with exceptions being thrown if the gateway determines they've provided an invalid card, etc.
92
+ * @param Varien_Object $payment
93
+ * @param decimal $amount
94
+ */
95
+ public function capture(Varien_Object $payment, $amount){
96
+ $order = Mage::getModel('sales/order')->load( $payment->getOrder()->getId() );
97
+
98
+ if ($payment->getCcTransId()){
99
+ $trans = $payment->getTransaction($payment->getCcTransId());
100
+ if (!$trans)
101
+ Mage::throwException('Unable to find transaction '.$payment->getCcTransId().' for this order.');
102
+ $additional = $trans->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);
103
+
104
+ $request = $this->_getRequest(701);
105
+ $request->setGateTransId( $additional['gatetransid'] );
106
+ $request->setAmount($this->_formatAmount($amount));
107
+
108
+ } else {
109
+ $conf = Mage::getStoreConfig('payment/gpndata');
110
+
111
+ $request = $this->_getRequest(700);
112
+ $request->setType(self::TYPE_AUTHORIZE_CAPTURE);
113
+ $request->setOrder($order);
114
+ $request->setAmount($this->_formatAmount($amount));
115
+ $request->setInfoInstance($this->getInfoInstance());
116
+ $request->setPayment($payment);
117
+ $request->setIs3ds( $conf['payment_3ds'] ? true : false );
118
+
119
+ }
120
+ $response = $request->post();
121
+
122
+ if ($response->simpleResponseValue('result') == 'SUCCESS' || $response->simpleResponseValue('result') == 'PENDING'){
123
+
124
+ $payment->setCcTransId( $response->simpleResponseValue('merchanttransid') );
125
+ $payment->setLastTransId ( $response->simpleResponseValue('merchanttransid') );
126
+ $payment->setSkipTransactionCreation(true);
127
+
128
+ if ($response->simpleResponseValue('ACS')){
129
+ Mage::helper('gpndata')->prepare3ds($response);
130
+ $order->setGpndataMd((string)$response->getXml()->parameters->MD);
131
+ $order->save();
132
+ }
133
+
134
+ return $this;
135
+
136
+ } else {
137
+ if ($response->getErrorMsg())
138
+ Mage::log($response->getErrorMsg(), null, 'gpndatalog.log');
139
+ Mage::throwException( 'Gateway response: ' . $response->simpleResponseValue('result') );
140
+ }
141
+ }
142
+
143
+ public function refund(Varien_Object $payment, $amount){
144
+
145
+ $trans = $payment->getTransaction($payment->getCcTransId());
146
+ if (!$trans)
147
+ Mage::throwException('Unable to find transaction '.$payment->getCcTransId().' for this order.');
148
+ $additional = $trans->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);
149
+
150
+ $request = $this->_getRequest(760);
151
+ $request->setGateTransId( $additional['gatetransid'] );
152
+ $request->setAmount($this->_formatAmount($amount));
153
+ $request->setReason('Refund');
154
+ $response = $request->post();
155
+
156
+ if ($response->simpleResponseValue('result') == 'SUCCESS'){
157
+
158
+ return $this;
159
+ } else {
160
+ if ($response->getErrorMsg())
161
+ Mage::log($response->getErrorMsg(), null, 'gpndatalog.log');
162
+ Mage::throwException( 'Gateway response: ' . $response->simpleResponseValue('result') );
163
+ }
164
+ }
165
+
166
+ public function void(Varien_Object $payment){
167
+
168
+ $trans = $payment->getTransaction($payment->getCcTransId());
169
+ if (!$trans)
170
+ Mage::throwException('Unable to find transaction '.$payment->getCcTransId().' for this order.');
171
+ $additional = $trans->getAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS);
172
+
173
+ $request = $this->_getRequest(702);
174
+ $request->setGateTransId( $additional['gatetransid'] );
175
+ $response = $request->post();
176
+
177
+ if ($response->simpleResponseValue('result') == 'CANCELED'){
178
+
179
+ $transaction = Mage::getModel('sales/order_payment_transaction');
180
+ $transaction->setTxnId($trans->getTxnId() . '_void');
181
+ $transaction->setParentTxnId($trans->getTxnId());
182
+ $transaction->setPaymentId($trans->getPaymentId());
183
+ $transaction->setOrderId($trans->getOrderId());
184
+ $transaction->setOrderPaymentObject($payment);
185
+ $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID);
186
+ $transaction->setIsClosed( 1 );
187
+ $transaction->setAdditionalInformation( Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, array(
188
+ 'gatetransid' => $additional['gatetransid']
189
+ ));
190
+ $transaction->save();
191
+
192
+ $payment->setSkipTransactionCreation(true);
193
+ return $this;
194
+ } else {
195
+ if ($response->getErrorMsg())
196
+ Mage::log($response->getErrorMsg(), null, 'gpndatalog.log');
197
+ Mage::throwException( 'Gateway response: ' . $response->simpleResponseValue('result') );
198
+ }
199
+ }
200
+
201
+
202
+
203
+
204
+ protected function _getRequest($code){
205
+ $configValue = Mage::getStoreConfig('payment/gpndata');
206
+
207
+ $configValue['password'] = Mage::helper('core')->decrypt($configValue['password']);
208
+ $configValue['api_key'] = Mage::helper('core')->decrypt($configValue['api_key']);
209
+
210
+ $request = Mage::getModel('gpndata/request_' . $code);
211
+ $request->initRequest($configValue);
212
+
213
+ return $request;
214
+ }
215
+
216
+ /**
217
+ * Round up and cast specified amount to float or string
218
+ *
219
+ * @param string|float $amount
220
+ * @param bool $asFloat
221
+ * @return string|float
222
+ */
223
+ protected function _formatAmount($amount, $asFloat = false){
224
+ $amount = sprintf('%.2F', $amount); // "f" depends on locale, "F" doesn't
225
+ return $asFloat ? (float)$amount : $amount;
226
+ }
227
+
228
+ /**
229
+ * Add payment transaction
230
+ *
231
+ * @param Mage_Sales_Model_Order_Payment $payment
232
+ * @param string $transactionId
233
+ * @param string $transactionType
234
+ * @param array $transactionDetails
235
+ * @param array $transactionAdditionalInfo
236
+ * @return null|Mage_Sales_Model_Order_Payment_Transaction
237
+ */
238
+ public function addTransaction(Mage_Sales_Model_Order_Payment $payment, $transactionId, $transactionType,
239
+ array $transactionDetails = array(), array $transactionAdditionalInfo = array(), $message = false
240
+ ) {
241
+ $payment->setTransactionId($transactionId);
242
+ $payment->resetTransactionAdditionalInfo();
243
+ foreach ($transactionDetails as $key => $value) {
244
+ $payment->setData($key, $value);
245
+ }
246
+ $transaction = $payment->addTransaction($transactionType, null, false , $message);
247
+ $transaction->setAdditionalInformation( Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, $transactionAdditionalInfo );
248
+ $transaction->save();
249
+
250
+ foreach ($transactionDetails as $key => $value) {
251
+ $payment->unsetData($key);
252
+ }
253
+ $payment->unsLastTransId();
254
+
255
+ /**
256
+ * It for self using
257
+ */
258
+ $transaction->setMessage($message);
259
+
260
+ return $transaction;
261
+ }
262
+
263
+ protected function _getIncrementOrderId(){
264
+ $info = $this->getInfoInstance();
265
+
266
+ if (!($info instanceof Mage_Sales_Model_Quote_Payment) && $info instanceof Mage_Sales_Model_Order_Payment){ // isPlaceOrder
267
+ return $info->getOrder()->getIncrementId();
268
+ } else {
269
+ if (!$info->getQuote()->getReservedOrderId())
270
+ $info->getQuote()->reserveOrderId();
271
+ return $info->getQuote()->getReservedOrderId();
272
+ }
273
+ }
274
+
275
+ protected function getGateTransIdByMerchantTransId($merchantid){
276
+ $collection = Mage::getModel('core/config_data')->getCollection()
277
+ ->addFieldToFilter('path', 'gpndata/gatetransid/' . $merchantid);
278
+
279
+ foreach ($collection as $config){
280
+ $v = $config->getData('value');
281
+ $config->delete();
282
+ return $v;
283
+ }
284
+
285
+ return null;
286
+ }
287
+
288
+ }
app/code/community/Modulesgarden/Gpndata/Model/Paymentrecurring.php ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-10, 13:12:36)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Model_Paymentrecurring extends Mage_Payment_Model_Method_Abstract implements Mage_Payment_Model_Recurring_Profile_MethodInterface {
30
+
31
+ protected $_code = 'gpndatarecurring';
32
+ protected $_formBlockType = 'gpndata/form_cc';
33
+
34
+ /**
35
+ * Availability options
36
+ */
37
+ protected $_isGateway = false;
38
+ protected $_canOrder = false;
39
+ protected $_canAuthorize = false;
40
+ protected $_canCapture = false;
41
+ protected $_canCapturePartial = false;
42
+ protected $_canRefund = false;
43
+ protected $_canRefundInvoicePartial = false;
44
+ protected $_canVoid = false;
45
+ protected $_canUseInternal = false;
46
+ protected $_canUseCheckout = true;
47
+ protected $_canUseForMultishipping = false;
48
+ protected $_canFetchTransactionInfo = true;
49
+ protected $_canCreateBillingAgreement = false;
50
+ protected $_canReviewPayment = true;
51
+
52
+
53
+ public function canUseCheckout(){
54
+ $quote = Mage::getModel('checkout/cart')->getQuote();
55
+ foreach ($quote->getAllItems() as $item) {
56
+ if (!$item->getProduct()->getIsRecurring())
57
+ return false;
58
+ }
59
+ return true;
60
+ }
61
+
62
+ public function getOrderPlaceRedirectUrl(){
63
+ if (Mage::getSingleton('core/session')->getAcs())
64
+ return Mage::getUrl('gpndata/redirect/index', array('_secure' => true));
65
+ return null;
66
+ }
67
+
68
+ /**
69
+ * Validate data
70
+ *
71
+ * @param Mage_Payment_Model_Recurring_Profile $profile
72
+ * @throws Mage_Core_Exception
73
+ */
74
+ public function validateRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile){
75
+ return $this;
76
+ }
77
+
78
+ /**
79
+ * Submit to the gateway
80
+ *
81
+ * @param Mage_Payment_Model_Recurring_Profile $profile
82
+ * @param Mage_Payment_Model_Info $paymentInfo Mage_Sales_Model_Quote_Payment -> first transaction -> add initial amount
83
+ */
84
+ public function submitRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile, Mage_Payment_Model_Info $payment){
85
+
86
+ // recurring = tax + billing + shipment
87
+ $profile->setRecurringAmount( $this->_formatAmount($profile->getTaxAmount() + $profile->getBillingAmount() + $profile->getShippingAmount()) );
88
+ $conf = Mage::getStoreConfig('payment/gpndatarecurring');
89
+
90
+ $request = $this->_getRequest(700);
91
+ $request->setType( $conf['payment_action'] == 'authorize' ? Modulesgarden_Gpndata_Model_Payment::TYPE_AUTHORIZE : Modulesgarden_Gpndata_Model_Payment::TYPE_AUTHORIZE_CAPTURE);
92
+ $request->setPayment($payment);
93
+ $request->setAmount( $this->_formatAmount($profile->getInitAmount()) );
94
+ $request->setInfoInstance($payment);
95
+ $request->setRecurringProfile($profile);
96
+ $request->setIs3ds( $conf['payment_3ds'] ? true : false );
97
+ $response = $request->post();
98
+
99
+ if ($response->simpleResponseValue('result') == 'SUCCESS' || $response->simpleResponseValue('result') == 'PENDING'){
100
+
101
+ $payment->setCcTransId( $response->simpleResponseValue('merchanttransid') );
102
+ $payment->setLastTransId ( $response->simpleResponseValue('merchanttransid') );
103
+ $payment->setSkipTransactionCreation(true);
104
+
105
+ $additionalInfo = $profile->getAdditionalInfo() ? $profile->getAdditionalInfo() : array();
106
+ $additionalInfo['rebillsecret'] = $response->simpleResponseValue('rebillsecret');
107
+
108
+ if ($response->simpleResponseValue('ACS')){
109
+ Mage::helper('gpndata')->prepare3ds($response);
110
+ $additionalInfo['md'] = (string)$response->getXml()->parameters->MD;
111
+ }
112
+
113
+ $profile->setReferenceId( $response->simpleResponseValue('merchanttransid') );
114
+ $profile->setAdditionalInfo( serialize($additionalInfo));
115
+
116
+ if ($response->simpleResponseValue('result') == 'PENDING') {
117
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_PENDING);
118
+ } else {
119
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE);
120
+ }
121
+
122
+ return $this;
123
+
124
+ } else {
125
+
126
+ if ($profile->getInitMayFail()){
127
+ $profile->setState(Mage_Sales_Model_Recurring_Profile::STATE_SUSPENDED);
128
+ $profile->save();
129
+ }
130
+
131
+ if ($response->getErrorMsg())
132
+ Mage::log($response->getErrorMsg(), null, 'gpndatalog.log');
133
+ Mage::throwException( 'Gateway response: ' . $response->simpleResponseValue('result') );
134
+ }
135
+ }
136
+
137
+ /**
138
+ * Fetch details
139
+ *
140
+ * @param string $referenceId
141
+ * @param Varien_Object $result
142
+ */
143
+ public function getRecurringProfileDetails($referenceId, Varien_Object $result){
144
+ return $this;
145
+ }
146
+
147
+ /**
148
+ * Check whether can get recurring profile details
149
+ *
150
+ * @return bool
151
+ */
152
+ public function canGetRecurringProfileDetails(){
153
+ return true;
154
+ }
155
+
156
+ /**
157
+ * Update data
158
+ *
159
+ * @param Mage_Payment_Model_Recurring_Profile $profile
160
+ */
161
+ public function updateRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile){
162
+ return $this;
163
+ }
164
+
165
+ /**
166
+ * Manage status
167
+ *
168
+ * @param Mage_Payment_Model_Recurring_Profile $profile
169
+ */
170
+ public function updateRecurringProfileStatus(Mage_Payment_Model_Recurring_Profile $profile){
171
+ $action = null;
172
+ switch ($profile->getNewState()) {
173
+ case Mage_Sales_Model_Recurring_Profile::STATE_ACTIVE: $action = 'start'; break;
174
+ case Mage_Sales_Model_Recurring_Profile::STATE_CANCELED: $action = 'cancel'; break;
175
+ case Mage_Sales_Model_Recurring_Profile::STATE_EXPIRED:
176
+ case Mage_Sales_Model_Recurring_Profile::STATE_SUSPENDED: $action = 'stop'; break;
177
+ default: return $this;
178
+ }
179
+ $profileAdditionalInfo = $profile->getAdditionalInfo();
180
+
181
+ $request = $this->_getRequest(755);
182
+ $request->setAction($action);
183
+ $request->setGateTransId($profileAdditionalInfo['gatetransid']);
184
+ $request->setMerchantTransId($profile->getId());
185
+ $response = $request->post();
186
+
187
+ if ($response->simpleResponseValue('result') == 'SUCCESS'){
188
+ $profileAdditionalInfo['transref'] = $response->simpleResponseValue('transref');
189
+ // set additional start date if active for cron billing
190
+ if ($action == 'start'){
191
+ $profile->setUpdatedAt(date('Y-m-d H:i:s'));
192
+ }
193
+ $profile->setAdditionalInfo(serialize($profileAdditionalInfo));
194
+ $profile->save();
195
+ return $this;
196
+ }
197
+ Mage::throwException($response->simpleResponseValue('errormessage'));
198
+ }
199
+
200
+ /**
201
+ * Cron will call this method for profiles that should be charged
202
+ *
203
+ * @param Mage_Payment_Model_Recurring_Profile $profile
204
+ */
205
+ public function chargeRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile){
206
+ $profileAdditionalInfo = is_string($profile->getAdditionalInfo()) ? unserialize($profile->getAdditionalInfo()) : $profile->getAdditionalInfo();
207
+
208
+ // send 756 - Manual Rebill Request
209
+ $request = $this->_getRequest(756);
210
+ $request->setAmount( $this->_formatAmount($profile->getTaxAmount() + $profile->getBillingAmount() + $profile->getShippingAmount()) );
211
+ $request->setGateTransId($profileAdditionalInfo['gatetransid']);
212
+ $request->setRebillsecret($profileAdditionalInfo['rebillsecret']);
213
+ $request->setMerchanttransid($profile->getId() . '-' . uniqid() . '-rebill');
214
+ $response = $request->post();
215
+
216
+ if ($response->simpleResponseValue('result') == 'SUCCESS'){
217
+ // change updated_at to one cycle ahead
218
+ $this->_setUpdateDateToNextPeriod($profile->getId());
219
+ return true;
220
+ }
221
+
222
+ return false;
223
+ }
224
+
225
+
226
+ protected function _setUpdateDateToNextPeriod($profile_id){
227
+ $_resource = Mage::getSingleton('core/resource');
228
+ $sql = '
229
+ UPDATE '.$_resource->getTableName('sales_recurring_profile').'
230
+ SET updated_at = CASE period_unit
231
+ WHEN "day" THEN DATE_ADD(updated_at, INTERVAL period_frequency DAY)
232
+ WHEN "week" THEN DATE_ADD(updated_at, INTERVAL (period_frequency*7) DAY)
233
+ WHEN "semi_month" THEN DATE_ADD(updated_at, INTERVAL (period_frequency*14) DAY)
234
+ WHEN "month" THEN DATE_ADD(updated_at, INTERVAL period_frequency MONTH)
235
+ WHEN "year" THEN DATE_ADD(updated_at, INTERVAL period_frequency YEAR)
236
+ END
237
+ WHERE profile_id = :pid';
238
+
239
+ $connection = $_resource->getConnection('core_write');
240
+ $pdoStatement = $connection->prepare($sql);
241
+ $pdoStatement->bindValue(':pid', $profile_id);
242
+ return $pdoStatement->execute();
243
+ }
244
+
245
+ /**
246
+ * Round up and cast specified amount to float or string
247
+ * @todo move it to the helper
248
+ *
249
+ * @param string|float $amount
250
+ * @param bool $asFloat
251
+ * @return string|float
252
+ */
253
+ protected function _formatAmount($amount, $asFloat = false){
254
+ $amount = sprintf('%.2F', $amount); // "f" depends on locale, "F" doesn't
255
+ return $asFloat ? (float)$amount : $amount;
256
+ }
257
+
258
+ protected function _getRequest($code){
259
+ $configValue = Mage::getStoreConfig('payment/gpndatarecurring');
260
+
261
+ $configValue['password'] = Mage::helper('core')->decrypt($configValue['password']);
262
+ $configValue['api_key'] = Mage::helper('core')->decrypt($configValue['api_key']);
263
+
264
+ $request = Mage::getModel('gpndata/request_' . $code);
265
+ $request->initRequest($configValue);
266
+
267
+ return $request;
268
+ }
269
+
270
+ }
app/code/community/Modulesgarden/Gpndata/Model/Request.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-01-27, 12:48:54)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Model_Request {
30
+
31
+ protected $_client;
32
+ protected $_xml;
33
+ protected $_config;
34
+
35
+ public function initRequest(array $config){
36
+
37
+ $this->_config = $config;
38
+
39
+ $this->_client = new Zend_Http_Client($this->_getApiUrl(), array(
40
+ 'maxredirects' => 0,
41
+ 'timeout' => 30
42
+ ));
43
+
44
+ $this->_xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?><transaction/>');
45
+ $this->_xml->addChild('apiUser', $config['username']);
46
+ $this->_xml->addChild('apiPassword', $config['password']);
47
+ }
48
+
49
+ public function post(){
50
+ $this->_client->setParameterPost(array(
51
+ 'strrequest' => $this->_xml->asXML()
52
+ ));
53
+ $response = $this->_client->request('POST');
54
+ $responseGpndata = Mage::getModel('gpndata/response')->setResponse($response);
55
+
56
+ // Mage::log('REQUEST: ' . $this->getXml()->asXML(), null, 'gpndata.log');
57
+ // Mage::log('RESPONSE: ' . $responseGpndata->getXml()->asXML(), null, 'gpndata.log');
58
+
59
+ return $responseGpndata;
60
+ }
61
+
62
+ public function getXml(){
63
+ return $this->_xml;
64
+ }
65
+
66
+ public function getHttpClient(){
67
+ return $this->_client;
68
+ }
69
+
70
+
71
+ protected function _getApiUrl(){
72
+ if (!isset($this->_config['submit_url']) || !$this->_config['submit_url']){
73
+ Mage::throwException( Mage::helper('gpndata')->__('Payment method is not fully configured') );
74
+ }
75
+
76
+ if (strpos($this->_config['submit_url'], 'http') !== 0)
77
+ $this->_config['submit_url'] = 'https://' . $this->_config['submit_url'];
78
+
79
+ return $this->_config['submit_url'];
80
+ }
81
+
82
+ }
app/code/community/Modulesgarden/Gpndata/Model/Request/700.php ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* * ********************************************************************
3
+ * Customization Services by ModulesGarden.com
4
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
5
+ * (2014-01-28, 09:51:36)
6
+ *
7
+ *
8
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
9
+ * CONTACT -> contact@modulesgarden.com
10
+ *
11
+ *
12
+ *
13
+ *
14
+ * This software is furnished under a license and may be used and copied
15
+ * only in accordance with the terms of such license and with the
16
+ * inclusion of the above copyright notice. This software or any other
17
+ * copies thereof may not be provided or otherwise made available to any
18
+ * other person. No title to and ownership of the software is hereby
19
+ * transferred.
20
+ *
21
+ *
22
+ * ******************************************************************** */
23
+
24
+ /**
25
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
26
+ */
27
+
28
+ /**
29
+ * 700 - Start Credit Card charge (3DS Enabled)
30
+ */
31
+ class Modulesgarden_Gpndata_Model_Request_700 extends Modulesgarden_Gpndata_Model_Request {
32
+
33
+ protected $_order;
34
+ protected $_info;
35
+ protected $_payment;
36
+ protected $_type = 'authorize_capture'; // authorize|authorize_capture
37
+ protected $_amount;
38
+ protected $_recurringProfile;
39
+ protected $_is3ds = false;
40
+
41
+ protected $_merchanttransid;
42
+
43
+ public function setOrder(Mage_Sales_Model_Order $order){
44
+ $this->_order = $order;
45
+ }
46
+
47
+ public function setInfoInstance(Mage_Payment_Model_Info $info){
48
+ $this->_info = $info;
49
+ }
50
+
51
+ public function setRecurringProfile(Mage_Payment_Model_Recurring_Profile $profile){
52
+ $this->_recurringProfile = $profile;
53
+ }
54
+
55
+ public function setPayment($payment){
56
+ $this->_payment = $payment;
57
+ }
58
+
59
+ public function setAmount($amount){
60
+ $this->_amount = $amount;
61
+ }
62
+
63
+ public function setIs3ds($bool){
64
+ $this->_is3ds = $bool;
65
+ }
66
+
67
+
68
+ public function setType($type){
69
+ if (!in_array($type, array(Modulesgarden_Gpndata_Model_Payment::TYPE_AUTHORIZE, Modulesgarden_Gpndata_Model_Payment::TYPE_AUTHORIZE_CAPTURE)))
70
+ Mage::throwException('Request type not supported');
71
+ $this->_type = $type;
72
+ }
73
+
74
+ /**
75
+ * from today
76
+ * startDate = ProfileStartDate + frequency
77
+ * charge now -> init + recurring
78
+ * from the future
79
+ * startDate = ProfileStartDate
80
+ * charge now -> init
81
+ *
82
+ * @return Modulesgarden_Gpndata_Model_Response
83
+ */
84
+ public function post(){
85
+ $this->_xml->addChild('apiCmd', '700');
86
+
87
+ $billingAddress = $this->_getBillingAddress();
88
+ $country = $billingAddress->getCountry();
89
+ $countryiso = Modulesgarden_Gpndata_Model_Gpndata_Map::getCustomerCountryCode( $country );
90
+ $stateregioniso = Modulesgarden_Gpndata_Model_Gpndata_Map::getCustomerStateCode(
91
+ Modulesgarden_Gpndata_Model_Gpndata_Map::getCustomerCountryId($country),
92
+ $billingAddress->getRegionCode(),
93
+ $billingAddress->getRegion()
94
+ );
95
+ $phone1country = Modulesgarden_Gpndata_Model_Gpndata_Map::getCustomerCountryPhoneNumber($country);
96
+ $phone_area = substr($billingAddress->getData("telephone"), 0, 3);
97
+
98
+ $transaction = $this->_xml->addChild('transaction');
99
+
100
+ if ($this->_recurringProfile){
101
+ $freq = $this->_recurringProfile->getPeriodFrequency();
102
+ switch ($this->_recurringProfile->getPeriodUnit()){
103
+ case 'day': $gpndataFreq = $freq . 'd'; break;
104
+ case 'week': $gpndataFreq = $freq . 'w'; break;
105
+ case 'semi_month': $gpndataFreq = ($freq * 2) . 'w'; break;
106
+ case 'month': $gpndataFreq = $freq . 'm'; break;
107
+ case 'year': $gpndataFreq = $freq . 'y'; break;
108
+ }
109
+
110
+ if ($this->_isStartDateToday($this->_recurringProfile)){
111
+ $startDate = $this->_calculateStartDate($this->_recurringProfile);
112
+
113
+ } else { // start date in the future
114
+ $startDate = Mage::getModel('core/date')->date('Y-m-d', strtotime($this->_recurringProfile->getStartDatetime()));
115
+ }
116
+
117
+ $rebill = $this->_xml->addChild('rebill');
118
+ $rebill->addChild('freq', $gpndataFreq); // eg 7d Valid values are: d (days), w (weeks), m (months), y (years)
119
+ $rebill->addChild('start', $startDate);
120
+ $rebill->addChild('amount', $this->_recurringProfile->getRecurringAmount());
121
+ $rebill->addChild('desc', $this->_getRequestDescription());
122
+ if ($this->_recurringProfile->getPeriodMaxCycles())
123
+ $rebill->addChild('count', $this->_recurringProfile->getPeriodMaxCycles());
124
+ // $rebill->addChild('followup_time', '');
125
+ // $rebill->addChild('followup_amount','');
126
+
127
+ $merchantspecific3 = 'rebill';
128
+ }
129
+
130
+ $transaction->addChild('merchanttransid', $this->getMerchantTransId());
131
+ $transaction->addChild('amount', $this->_amount);
132
+ $transaction->addChild('curcode', $this->_getRequestCurrencyCode());
133
+ $transaction->addChild('statement', $this->_getRequestDescription());
134
+ $transaction->addChild('description', $this->_getRequestDescription());
135
+ $transaction->addChild('merchantspecific1', '');
136
+ $transaction->addChild('merchantspecific2', '');
137
+ $transaction->addChild('merchantspecific3', isset($merchantspecific3) ? $merchantspecific3 : '');
138
+
139
+ $customer = $this->_xml->addChild('customer');
140
+ $customer->addChild('firstname', $billingAddress->getData("firstname"));
141
+ $customer->addChild('lastname', $billingAddress->getData("lastname"));
142
+ $customer->addChild('birthday', '');
143
+ $customer->addChild('birthmonth', '');
144
+ $customer->addChild('birthyear', '');
145
+ $customer->addChild('email', $this->_getEmail());
146
+ $customer->addChild('countryiso', $countryiso);
147
+ $customer->addChild('stateregioniso',$stateregioniso);
148
+ $customer->addChild('zippostal', $billingAddress->getData("postcode"));
149
+ $customer->addChild('city', $billingAddress->getData("city"));
150
+ $customer->addChild('address1', $billingAddress->getData("street"));
151
+ $customer->addChild('address2', '');
152
+ $customer->addChild('phone1country',preg_replace("/[^0-9]/","", $phone1country));
153
+ $customer->addChild('phone1area', preg_replace("/[^0-9]/","", $phone_area));
154
+ $customer->addChild('phone1phone', preg_replace("/[^0-9]/","", $billingAddress->getData("telephone")));
155
+ $customer->addChild('phone2country','');
156
+ $customer->addChild('phone2area', '');
157
+ $customer->addChild('phone2phone', '');
158
+ $customer->addChild('accountid', $this->_getRequestCustomerId());
159
+ $customer->addChild('ipaddress', $this->_getRequestRemoteIp());
160
+
161
+ $creditcard = $this->_xml->addChild('creditcard');
162
+ $creditcard->addChild('ccnumber', $this->_info->getCcNumber());
163
+ $creditcard->addChild('cccvv', $this->_info->getCcCid());
164
+ $creditcard->addChild('expmonth', $this->_info->getCcExpMonth());
165
+ $creditcard->addChild('expyear', $this->_info->getCcExpYear());
166
+ $creditcard->addChild('nameoncard', $this->_getRequestCustomerName());
167
+ $creditcard->addChild('billingcountryiso', $countryiso);
168
+ $creditcard->addChild('billingstateregioniso',$stateregioniso);
169
+ $creditcard->addChild('billingzippostal', $billingAddress->getData("postcode"));
170
+ $creditcard->addChild('billingcity', $billingAddress->getData("city"));
171
+ $creditcard->addChild('billingaddress1', $billingAddress->getData("street"));
172
+ $creditcard->addChild('billingaddress2', '');
173
+ $creditcard->addChild('billingphone1country',preg_replace("/[^0-9]/","", $phone1country));
174
+ $creditcard->addChild('billingphone1area', preg_replace("/[^0-9]/","", $phone_area));
175
+ $creditcard->addChild('billingphone1phone', preg_replace("/[^0-9]/","", $billingAddress->getData("telephone")));
176
+
177
+
178
+ $this->_xml->addChild('checksum', $this->calculateChecksum());
179
+
180
+ /*
181
+ * Valid values are:
182
+ * Direct = non- 3DS Charge (Auth/Capture)
183
+ * Auth = non-3DS Auth Only
184
+ * 3DS = 3DS Charge (Auth/Capture)
185
+ * Auth3DS = 3DS Auth Only
186
+ *
187
+ * Note: only those choices available as indicated in the Merchant Profile are accepted.
188
+ */
189
+ $auth = $this->_xml->addChild('auth');
190
+ if ($this->_is3ds){
191
+ $auth->addChild('type', $this->_type == Modulesgarden_Gpndata_Model_Payment::TYPE_AUTHORIZE ? 'Auth3DS' : '3DS');
192
+ if ($this->_order) {
193
+ $auth->addChild('sid', $this->_order->getId());
194
+ } elseif ($this->_recurringProfile){
195
+ $auth->addChild('sid', 'p' . $this->_recurringProfile->getProfileId());
196
+ }
197
+
198
+ } else {
199
+ $auth->addChild('type', $this->_type == Modulesgarden_Gpndata_Model_Payment::TYPE_AUTHORIZE ? 'Auth' : 'Direct');
200
+ }
201
+
202
+ return parent::post();
203
+ }
204
+
205
+ public function setMerchantTransId($transid){
206
+ $this->_merchanttransid = $transid;
207
+ }
208
+
209
+ public function getMerchantTransId(){
210
+ if ($this->_merchanttransid === null){
211
+ $id = $this->_recurringProfile ? $this->_recurringProfile->getId() : $this->_order->getId();
212
+ $this->_merchanttransid = 'gpndata_' . $id . '_' . $this->_payment->getId() . '_' . uniqid();
213
+ }
214
+ return $this->_merchanttransid;
215
+ }
216
+
217
+ protected function calculateChecksum(){
218
+ return sha1(
219
+ $this->_config['username'] .
220
+ $this->_config['password'] .
221
+ '700' .
222
+ $this->getMerchantTransId() .
223
+ $this->_amount .
224
+ $this->_getRequestCurrencyCode() .
225
+ $this->_info->getCcNumber() .
226
+ $this->_info->getCcCid() .
227
+ $this->_getRequestCustomerName() .
228
+ $this->_config['api_key']
229
+ );
230
+ }
231
+
232
+
233
+ /**
234
+ * GET VALUES BASED ON RECURRING PROFILE OR ORDER
235
+ */
236
+
237
+ protected function _getBillingAddress(){
238
+ if ($this->_recurringProfile){
239
+ $address = Mage::getModel('sales/order_address');
240
+ $address->addData( $this->_recurringProfile->getBillingAddressInfo() );
241
+ return $address;
242
+
243
+ } else {
244
+ return $this->_order->getBillingAddress();
245
+ }
246
+ }
247
+
248
+ protected function _getEmail(){
249
+ $billingAddress = $this->_getBillingAddress();
250
+ if (!$billingAddress->getData('email')){
251
+ if ($this->_recurringProfile){
252
+ $customer_id = $this->_recurringProfile->getCustomerId();
253
+ } elseif ($this->_order) {
254
+ $customer_id = $this->_order->getCustomerId();
255
+ }
256
+ $customer = Mage::getModel('customer/customer')->load($customer_id);
257
+ $billingAddress->setData('email', $customer->getEmail());
258
+ }
259
+ return $billingAddress->getData('email');
260
+ }
261
+
262
+ protected function _getRequestCustomerName(){ return $this->_getRequestData('customer_name'); }
263
+ protected function _getRequestRemoteIp(){ return $this->_getRequestData('remote_ip'); }
264
+ protected function _getRequestCurrencyCode(){ return $this->_getRequestData('currency_code'); }
265
+ protected function _getRequestDescription(){ return $this->_getRequestData('description'); }
266
+ protected function _getRequestCustomerId(){ return $this->_getRequestData('customer_id'); }
267
+
268
+ protected function _getRequestData($key){
269
+ $recProfileOrderInfo = $this->_recurringProfile ? $this->_recurringProfile->getOrderInfo() : null;
270
+ switch ($key){
271
+ case 'remote_ip':
272
+ return isset($recProfileOrderInfo['remote_ip']) ?
273
+ $recProfileOrderInfo['remote_ip'] :
274
+ ($this->_order->getRemoteIp() ? $this->_order->getRemoteIp() : $_SERVER['REMOTE_ADDR']);
275
+
276
+ case 'customer_name':
277
+ return isset($recProfileOrderInfo['customer_firstname']) ?
278
+ $recProfileOrderInfo['customer_firstname'] . ' ' . $recProfileOrderInfo['customer_lastname'] :
279
+ ($this->_order ? $this->_order->getCustomerName() : 'Guest');
280
+
281
+ case 'customer_id':
282
+ return isset($recProfileOrderInfo['customer_id']) ?
283
+ $recProfileOrderInfo['customer_id'] :
284
+ ($this->_order ? $this->_order->getCustomerId() : uniqid());
285
+
286
+ case 'currency_code':
287
+ return $this->_recurringProfile ?
288
+ $this->_recurringProfile->getCurrencyCode() :
289
+ $this->_order->getOrderCurrencyCode();
290
+
291
+ case 'description':
292
+ return $this->_recurringProfile ?
293
+ 'Payment for recurring profile #' . $this->_recurringProfile->getId() :
294
+ 'Payment for order #' . $this->_order->getId();
295
+ }
296
+ }
297
+
298
+ protected function _isStartDateToday($profile){
299
+ $start = Mage::getModel('core/date')->date('Y-m-d', strtotime($profile->getStartDatetime()));
300
+ $now = Mage::getModel('core/date')->date('Y-m-d', time());
301
+
302
+ return $start == $now;
303
+ }
304
+
305
+ protected function _calculateStartDate($profile){
306
+ $start = Mage::getModel('core/date')->date('Y-m-d', strtotime($profile->getStartDatetime()));
307
+
308
+ switch ($profile->getPeriodUnit()){
309
+ case 'day': $added = $profile->getPeriodFrequency() . ' day'; break;
310
+ case 'week': $added = $profile->getPeriodFrequency() . ' week'; break;
311
+ case 'semi_month': $added = ($profile->getPeriodFrequency()*2) . ' week'; break;
312
+ case 'month': $added = $profile->getPeriodFrequency() . ' month'; break;
313
+ case 'year': $added = $profile->getPeriodFrequency() . ' year'; break;
314
+ default: Mage::throwException('Unable to calculate start date');
315
+ }
316
+
317
+ return Mage::getModel('core/date')->date('Y-m-d', strtotime($start . ' +' . $added));
318
+ }
319
+
320
+ /**
321
+ * @todo move it to the helper
322
+ *
323
+ * @param float $amount
324
+ * @param bool $asFloat
325
+ * @return mixed
326
+ */
327
+ protected function _formatAmount($amount, $asFloat = false){
328
+ $amount = sprintf('%.2F', $amount); // "f" depends on locale, "F" doesn't
329
+ return $asFloat ? (float)$amount : $amount;
330
+ }
331
+
332
+ }
333
+
334
+ /*
335
+ <transaction>
336
+ <apiUser></apiUser>
337
+ <apiPassword></apiPassword>
338
+ <apiCmd>700</apiCmd>
339
+ <transaction>
340
+ <merchanttransid></merchanttransid>
341
+ <amount></amount>
342
+ <curcode></curcode>
343
+ <statement></statement>
344
+ <description></description>
345
+ <merchantspecific1></merchantspecific1>
346
+ <merchantspecific2></merchantspecific2>
347
+ <merchantspecific3></merchantspecific3>
348
+ </transaction>
349
+ <rebill>
350
+ <freq></freq>
351
+ <start>yyyy-mm-dd</start>
352
+ <amount></amount>
353
+ <desc></desc>
354
+ <count></count>
355
+ <followup_time></followup_time>
356
+ <followup_amount></followup_amount>
357
+ </rebill>
358
+ <customer>
359
+ <firstname></firstname>
360
+ <lastname></lastname>
361
+ <birthday></birthday>
362
+ <birthmonth></birthmonth>
363
+ <birthyear></birthyear>
364
+ <email></email>
365
+ <countryiso></countryiso>
366
+ <stateregioniso></stateregioniso>
367
+ <zippostal></zippostal>
368
+ <city></city>
369
+ <address1></address1>
370
+ <address2></address2>
371
+ <phone1country></phone1country>
372
+ <phone1area></phone1area>
373
+ <phone1phone></phone1phone>
374
+ <phone2country></phone2country>
375
+ <phone2area></phone2area>
376
+ <phone2phone></phone2phone>
377
+ <accountid></accountid>
378
+ <ipaddress></ipaddress>
379
+ </customer>
380
+ <creditcard>
381
+ <ccnumber></ccnumber>
382
+ <cccvv></cccvv>
383
+ <expmonth></expmonth>
384
+ <expyear></expyear>
385
+ <nameoncard></nameoncard>
386
+ <billingcountryiso></billingcountryiso>
387
+ <billingstateregioniso></billingstateregioniso>
388
+ <billingzippostal></billingzippostal>
389
+ <billingcity></billingcity>
390
+ <billingaddress1></billingaddress1>
391
+ <billingaddress2></billingaddress2>
392
+ <billingphone1country></billingphone1country>
393
+ <billingphone1area></billingphone1area>
394
+ <billingphone1phone></billingphone1phone>
395
+ </creditcard>
396
+ <checksum></checksum>
397
+ <auth>
398
+ <type></type>
399
+ </auth>
400
+ </transaction>
401
+ */
app/code/community/Modulesgarden/Gpndata/Model/Request/701.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-03, 12:45:10)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * 701 - Request Capture Authorization
31
+ */
32
+ class Modulesgarden_Gpndata_Model_Request_701 extends Modulesgarden_Gpndata_Model_Request {
33
+
34
+ protected $_amount;
35
+ protected $_gatetransid;
36
+
37
+ public function setAmount($amount){
38
+ $this->_amount = $amount;
39
+ }
40
+
41
+ public function setGateTransId($gatetransid){
42
+ $this->_gatetransid = $gatetransid;
43
+ }
44
+
45
+ public function post(){
46
+ $this->_xml->addChild('apiCmd', '701');
47
+
48
+ $this->_xml->addChild('gatetransid', $this->_gatetransid);
49
+ $this->_xml->addChild('amount', $this->_amount);
50
+ $this->_xml->addChild('carrier', '');
51
+ $this->_xml->addChild('trackingnumber', '');
52
+ $this->_xml->addChild('checksum', $this->calculateChecksum());
53
+
54
+ return parent::post();
55
+ }
56
+
57
+ protected function calculateChecksum(){
58
+ return sha1(
59
+ $this->_config['username'] .
60
+ $this->_config['password'] .
61
+ '701' .
62
+ $this->_gatetransid .
63
+ $this->_config['api_key']
64
+ );
65
+ }
66
+
67
+ }
68
+
69
+ //<transaction>
70
+ // <apiUser></apiUser>
71
+ // <apiPassword></apiPassword>
72
+ // <apiCmd></apiCmd>
73
+ // <gatetransid></gatetransid>
74
+ // <amount></amount>
75
+ // <carrier></carrier>
76
+ // <trackingnumber></trackingnumber>
77
+ // <checksum></checksum>
78
+ //</transaction>
app/code/community/Modulesgarden/Gpndata/Model/Request/702.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-03, 14:36:23)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * 702 - Request Cancel Authorization
31
+ */
32
+ class Modulesgarden_Gpndata_Model_Request_702 extends Modulesgarden_Gpndata_Model_Request {
33
+
34
+ protected $_gatetransid;
35
+
36
+ public function setGateTransId($gatetransid){
37
+ $this->_gatetransid = $gatetransid;
38
+ }
39
+
40
+ public function getGateTransId(){
41
+ return $this->_gatetransid;
42
+ }
43
+
44
+ public function post(){
45
+ $this->_xml->addChild('apiCmd', '702');
46
+
47
+ $this->_xml->addChild('gatetransid', $this->_gatetransid);
48
+ $this->_xml->addChild('checksum', $this->calculateChecksum());
49
+
50
+ return parent::post();
51
+ }
52
+
53
+ protected function calculateChecksum(){
54
+ return sha1(
55
+ $this->_config['username'] .
56
+ $this->_config['password'] .
57
+ '702' .
58
+ $this->_gatetransid .
59
+ $this->_config['api_key']
60
+ );
61
+ }
62
+
63
+ }
64
+
65
+ //<transaction>
66
+ // <apiUser></apiUser>
67
+ // <apiPassword></apiPassword>
68
+ // <apiCmd></apiCmd>
69
+ // <gatetransid></gatetransid>
70
+ // <checksum></checksum>
71
+ //</transaction>
app/code/community/Modulesgarden/Gpndata/Model/Request/705.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-03-25, 13:47:34)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * 705 - Request Capture Authorization
31
+ */
32
+ class Modulesgarden_Gpndata_Model_Request_705 extends Modulesgarden_Gpndata_Model_Request {
33
+
34
+ protected $_type;
35
+ protected $_ACSRes;
36
+ protected $_MD;
37
+
38
+ /**
39
+ * This tag Must be present and the value for type must be: 3DS or Auth3DS
40
+ * @param string $type
41
+ */
42
+ public function setType($type){
43
+ $this->_type = $type;
44
+ }
45
+
46
+ /**
47
+ * This is the complete, raw POST data returned by the Issuing Bank ACS to the URL provided
48
+ * by the merchant in the redirect screen POST variable (TermUrl). It must be packed base64
49
+ * (example: if POST input data is “test=value123”, ACSRes will contain “dGVzdD12YWx1ZTEyMw==”). Raw POST
50
+ * data can be obtained in PHP with function file_get_contents('php://input')
51
+ *
52
+ * @param type $ACSRes
53
+ */
54
+ public function setACSRes($ACSRes){
55
+ $this->_ACSRes = $ACSRes;
56
+ }
57
+
58
+ /**
59
+ * Authorization process ID as received from ACS server in POST "MD" field. Must be
60
+ * included in the request. It is equivalent to MD received in response to the 700 request which started the transaction.
61
+ *
62
+ * @param type $MD
63
+ */
64
+ public function setMD($MD){
65
+ $this->_MD = $MD;
66
+ }
67
+
68
+
69
+ public function post(){
70
+ $this->_xml->addChild('apiCmd', '705');
71
+
72
+ $auth = $this->_xml->addChild('auth');
73
+ $auth->addChild('type', $this->_type);
74
+ $auth->addChild('ACSRes', $this->_ACSRes);
75
+ $auth->addChild('MD', $this->_MD);
76
+
77
+ $this->_xml->addChild('checksum', $this->calculateChecksum());
78
+
79
+ return parent::post();
80
+ }
81
+
82
+ protected function calculateChecksum(){
83
+ return sha1(
84
+ $this->_config['username'] .
85
+ $this->_config['password'] .
86
+ '705' .
87
+ $this->_type .
88
+ $this->_MD .
89
+ $this->_config['api_key']
90
+ );
91
+ }
92
+
93
+ }
94
+
95
+ //<transaction>
96
+ // <apiUser></apiUser>
97
+ // <apiPassword></apiPassword>
98
+ // <apiCmd></apiCmd>
99
+ // <auth>
100
+ // <type></type>
101
+ // <ACSRes></ACSRes>
102
+ // <MD></MD>
103
+ // </auth>
104
+ // <checksum></checksum>
105
+ //</transaction>
app/code/community/Modulesgarden/Gpndata/Model/Request/755.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-11, 11:52:44)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * 755 - Update Rebill Instructions
31
+ */
32
+ class Modulesgarden_Gpndata_Model_Request_755 extends Modulesgarden_Gpndata_Model_Request {
33
+
34
+ protected $_amount = '';
35
+ protected $_merchanttransid;
36
+ protected $_gatetransid;
37
+ protected $_action;
38
+
39
+ public function setAction($action){
40
+ $this->_action = $action;
41
+ }
42
+
43
+ public function setAmount($amount){
44
+ $this->_amount = $amount;
45
+ }
46
+
47
+ public function setGateTransId($gatetransid){
48
+ $this->_gatetransid = $gatetransid;
49
+ }
50
+
51
+ public function setMerchantTransId ($merchanttransid){
52
+ $this->_merchanttransid = $merchanttransid;
53
+ }
54
+
55
+ public function getGateTransId(){
56
+ return $this->_gatetransid;
57
+ }
58
+
59
+ public function post(){
60
+ $this->_xml->addChild('apiCmd', '755');
61
+
62
+ $this->_xml->addChild('merchanttransid', $this->_merchanttransid);
63
+ $this->_xml->addChild('gatetransid', $this->_gatetransid);
64
+ $this->_xml->addChild('action', $this->_action); // stop|start|changeamount|changecount
65
+ $this->_xml->addChild('amount', $this->_amount);
66
+ $this->_xml->addChild('checksum', $this->calculateChecksum());
67
+
68
+ return parent::post();
69
+ }
70
+
71
+ protected function calculateChecksum(){
72
+ return sha1(
73
+ $this->_config['username'] .
74
+ $this->_config['password'] .
75
+ '755' .
76
+ $this->_merchanttransid .
77
+ $this->_gatetransid .
78
+ $this->_config['api_key']
79
+ );
80
+ }
81
+
82
+ }
83
+
84
+ //<transaction>
85
+ // <apiUser></apiUser>
86
+ // <apiPassword></apiPassword>
87
+ // <apiCmd>755</apiCmd>
88
+ // <merchanttransid></merchanttransid>
89
+ // <gatetransid></gatetransid>
90
+ // <action></action>
91
+ // <amount></amount>
92
+ // <checksum></checksum>
93
+ //</transaction>
app/code/community/Modulesgarden/Gpndata/Model/Request/756.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-19, 15:09:53)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * 756 - Manual Rebill Request
31
+ *
32
+ * Request:
33
+ * <transaction>
34
+ * <apiUser></apiUser>
35
+ * <apiPassword></apiPassword>
36
+ * <apiCmd>756</apiCmd>
37
+ * <gatetransid></gatetransid>
38
+ * <rebillsecret></rebillsecret>
39
+ * <transaction>
40
+ * <amount></amount>
41
+ * <merchanttransid></merchanttransid>
42
+ * </transaction>
43
+ * <checksum></checksum>
44
+ * </transaction>
45
+ *
46
+ * Response:
47
+ * <transaction>
48
+ * <result></result>
49
+ * <merchanttransid></merchanttransid>
50
+ * <transref></transref>
51
+ * <errorcode></errorcode>
52
+ * <errormessage></errormessage>
53
+ * </transaction>
54
+ */
55
+ class Modulesgarden_Gpndata_Model_Request_756 extends Modulesgarden_Gpndata_Model_Request {
56
+
57
+ protected $_amount;
58
+ protected $_gatetransid;
59
+ protected $_merchanttransid;
60
+ protected $_rebillsecret;
61
+
62
+ public function setAmount($amount){
63
+ $this->_amount = $amount;
64
+ }
65
+
66
+ public function setGateTransId($gatetransid){
67
+ $this->_gatetransid = $gatetransid;
68
+ }
69
+
70
+ public function setRebillsecret($rebillsecret){
71
+ $this->_rebillsecret = $rebillsecret;
72
+ }
73
+
74
+ public function setMerchanttransid($merchanttransid){
75
+ $this->_merchanttransid = $merchanttransid;
76
+ }
77
+
78
+ public function post(){
79
+ $this->_xml->addChild('apiCmd', '756');
80
+
81
+ $this->_xml->addChild('gatetransid', $this->_gatetransid);
82
+ $this->_xml->addChild('rebillsecret', $this->_rebillsecret);
83
+
84
+ $transaction = $this->_xml->addChild('transaction');
85
+ $transaction->addChild('amount', $this->_amount);
86
+ $transaction->addChild('merchanttransid', $this->_merchanttransid);
87
+
88
+ $this->_xml->addChild('checksum', $this->calculateChecksum());
89
+
90
+ return parent::post();
91
+ }
92
+
93
+ protected function calculateChecksum(){
94
+ return sha1(
95
+ $this->_config['username'] .
96
+ $this->_config['password'] .
97
+ '756' .
98
+ $this->_gatetransid .
99
+ $this->_merchanttransid .
100
+ $this->_config['api_key']
101
+ );
102
+ }
103
+
104
+ }
app/code/community/Modulesgarden/Gpndata/Model/Request/760.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-03, 14:21:42)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ /**
30
+ * 760 - Request Refund
31
+ */
32
+ class Modulesgarden_Gpndata_Model_Request_760 extends Modulesgarden_Gpndata_Model_Request {
33
+
34
+ protected $_amount;
35
+ protected $_gatetransid;
36
+ protected $_reason;
37
+
38
+ public function setAmount($amount){
39
+ $this->_amount = $amount;
40
+ }
41
+
42
+ public function setGateTransId($gatetransid){
43
+ $this->_gatetransid = $gatetransid;
44
+ }
45
+
46
+ public function getGateTransId(){
47
+ return $this->_gatetransid;
48
+ }
49
+
50
+ public function setReason($reason){
51
+ $this->_reason = $reason;
52
+ }
53
+
54
+ public function post(){
55
+ $this->_xml->addChild('apiCmd', '760');
56
+
57
+ $this->_xml->addChild('gatetransid', $this->_gatetransid);
58
+ $this->_xml->addChild('amount', $this->_amount);
59
+ $this->_xml->addChild('reason', $this->_reason);
60
+ $this->_xml->addChild('checksum', $this->calculateChecksum());
61
+
62
+ return parent::post();
63
+ }
64
+
65
+ protected function calculateChecksum(){
66
+ return sha1(
67
+ $this->_config['username'] .
68
+ $this->_config['password'] .
69
+ '760' .
70
+ $this->_gatetransid .
71
+ $this->_amount .
72
+ $this->_config['api_key']
73
+ );
74
+ }
75
+
76
+ }
77
+
78
+ //<transaction>
79
+ // <apiUser></apiUser>
80
+ // <apiPassword></apiPassword>
81
+ // <apiCmd></apiCmd>
82
+ // <gatetransid></gatetransid>
83
+ // <amount></amount>
84
+ // <reason></reason>
85
+ // <checksum></checksum>
86
+ //</transaction>
app/code/community/Modulesgarden/Gpndata/Model/Response.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-01-27, 15:29:57)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_Model_Response {
30
+
31
+ protected $_response;
32
+ protected $_xml;
33
+
34
+ public function setResponse(Zend_Http_Response $response){
35
+ $this->_response = $response;
36
+
37
+ if ($this->_response->getStatus() != 200)
38
+ Mage::throwException('Response is not valid: HTTP ' . $this->_response->getStatus());
39
+
40
+ $this->_xml = new SimpleXMLElement( $this->_response->getBody() );
41
+
42
+ return $this;
43
+ }
44
+
45
+ public function getXml(){
46
+ return $this->_xml;
47
+ }
48
+
49
+ public function isNotError(){
50
+ $re = $this->simpleResponseValue('result');
51
+ return isset($re) && $re != 'ERROR';
52
+ }
53
+
54
+ public function getResult(){ return $this->simpleResponseValue('result'); }
55
+ public function getMerchantTransId(){ return $this->simpleResponseValue('merchanttransid'); }
56
+ public function getErrorCode(){ return $this->simpleResponseValue('errorcode'); }
57
+ public function getErrorMsg(){ return $this->simpleResponseValue('errormessage'); }
58
+ public function getDescription(){ return $this->simpleResponseValue('description'); }
59
+ public function getGateTransId(){ return $this->simpleResponseValue('gatetransid'); }
60
+
61
+
62
+ public function simpleResponseValue($key, $default = null){
63
+ if (!$this->_xml)
64
+ Mage::throwException('Response XML is not valid');
65
+
66
+ return isset($this->_xml->$key) ? (string)$this->_xml->$key : $default;
67
+ }
68
+
69
+ }
app/code/community/Modulesgarden/Gpndata/controllers/NotificationsController.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-04, 09:20:57)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_NotificationsController extends Mage_Core_Controller_Front_Action {
30
+
31
+ public function indexAction(){
32
+
33
+ $response = Mage::getModel('gpndata/notification_response');
34
+ $xml_string = $this->getRequest()->getPost('strdata');
35
+ // Mage::log('NOTIFICATION REQUEST: '.$xml_string, null, 'gpndata.log');
36
+
37
+ try {
38
+ $notification = Modulesgarden_Gpndata_Model_Notification::factory($xml_string);
39
+
40
+ // rebill
41
+ if ($notification instanceof Modulesgarden_Gpndata_Model_Notification_870 || ($notification instanceof Modulesgarden_Gpndata_Model_Notification_850 && $notification->isRebill())){
42
+ $conf = Mage::getStoreConfig('payment/gpndatarecurring');
43
+ } else { // single
44
+ $conf = Mage::getStoreConfig('payment/gpndata');
45
+ }
46
+
47
+ $conf['password'] = Mage::helper('core')->decrypt($conf['password']);
48
+ $conf['api_key'] = Mage::helper('core')->decrypt($conf['api_key']);
49
+ $valid = $notification->isChecksumOk($conf);
50
+
51
+ if (!$valid){
52
+ $response
53
+ ->setResult('ERROR')
54
+ ->setErrorcode(403)
55
+ ->setErrormessage('Checksum is not valid');
56
+
57
+ } else { // notification ok
58
+ $notification->process($response);
59
+
60
+ }
61
+
62
+ } catch (Exception $e){
63
+ $response
64
+ ->setResult('ERROR')
65
+ ->setErrorcode(500)
66
+ ->setErrormessage($e->getMessage());
67
+ }
68
+
69
+ $xml = $response->getXml();
70
+ // Mage::log('NOTIFICATION RESPONSE: '.$xml, null, 'gpndata.log');
71
+
72
+ header('Content-type: application/xml; charset="utf-8"');
73
+ echo $xml;
74
+ die();
75
+ }
76
+
77
+ public function acsAction(){
78
+ $inputPost = base64_encode(file_get_contents('php://input'));
79
+
80
+ if (!$inputPost){
81
+ Mage::app()->getFrontController()->getResponse()->setRedirect( Mage::getUrl('/') );
82
+ Mage::app()->getResponse()->sendResponse();
83
+ exit;
84
+ }
85
+
86
+ // Mage::log('ACS INCOMING: '.$inputPost, null, 'gpndata.log');
87
+
88
+ $sid = $this->getRequest()->getParam('sid');
89
+ if (is_numeric($sid)){ // order
90
+ $md = Mage::getModel('sales/order')->load($sid)->getGpndataMd();
91
+ $configValue = Mage::getStoreConfig('payment/gpndata');
92
+
93
+ } else { // recurring profile
94
+ $profile = Mage::getModel('sales/recurring_profile')->load(substr($sid,1));
95
+ $additionalInfo = $profile->getAdditionalInfo() ? $profile->getAdditionalInfo() : array();
96
+ $md = isset($additionalInfo['md']) ? $additionalInfo['md'] : '';
97
+ $configValue = Mage::getStoreConfig('payment/gpndatarecurring');
98
+ }
99
+
100
+ $configValue['password']= Mage::helper('core')->decrypt($configValue['password']);
101
+ $configValue['api_key'] = Mage::helper('core')->decrypt($configValue['api_key']);
102
+
103
+ try {
104
+ $request = Mage::getModel('gpndata/request_705');
105
+ $request->initRequest($configValue);
106
+
107
+ $request->setType( $configValue['payment_action'] == 'authorize' ? 'Auth3DS' : '3DS' );
108
+ $request->setACSRes( $inputPost );
109
+ $request->setMD( $md );
110
+
111
+ $response = $request->post();
112
+
113
+ $session = Mage::getSingleton('core/session');
114
+ switch ($response->getResult()){
115
+ case 'SUCCESS': $session->addSuccess($this->__('Payment Successful! Credit Card account has been charged with the amount of the transaction.')); break;
116
+ case 'PENDING': $session->addSuccess($this->__('Payment Approved!')); break;
117
+ case 'DECLINED':$session->addError($this->__('Payment declined! Transaction has been declined.')); break;
118
+ case 'ERROR': $session->addError($this->__('Payment error! The transaction has NOT been accepted by the gateway and thus no processing has taken place.')); break;
119
+ }
120
+
121
+ } catch (Exception $e){
122
+
123
+ }
124
+
125
+ $this->_redirect('/');
126
+ }
127
+
128
+ }
app/code/community/Modulesgarden/Gpndata/controllers/RedirectController.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-02-07, 14:46:45)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+ class Modulesgarden_Gpndata_RedirectController extends Mage_Core_Controller_Front_Action {
30
+
31
+ public function indexAction(){
32
+ $this->getResponse()->setBody( $this->getLayout()->createBlock('gpndata/redirect')->toHtml() );
33
+ }
34
+
35
+ }
app/code/community/Modulesgarden/Gpndata/etc/config.xml ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Modulesgarden_Gpndata>
5
+ <version>1.2.0</version>
6
+ </Modulesgarden_Gpndata>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <gpndata>
11
+ <class>Modulesgarden_Gpndata_Block</class>
12
+ </gpndata>
13
+ <checkout>
14
+ <rewrite>
15
+ <cart_totals>Modulesgarden_Gpndata_Block_Checkout_Cart_Totals</cart_totals>
16
+ </rewrite>
17
+ </checkout>
18
+ </blocks>
19
+ <models>
20
+ <gpndata>
21
+ <class>Modulesgarden_Gpndata_Model</class>
22
+ </gpndata>
23
+ </models>
24
+ <helpers>
25
+ <gpndata>
26
+ <class>Modulesgarden_Gpndata_Helper</class>
27
+ </gpndata>
28
+ </helpers>
29
+ <resources>
30
+ <gpndata_setup>
31
+ <setup>
32
+ <module>Modulesgarden_Gpndata</module>
33
+ <class>Mage_Sales_Model_Mysql4_Setup</class>
34
+ </setup>
35
+ <connection>
36
+ <use>core_setup</use>
37
+ </connection>
38
+ </gpndata_setup>
39
+ <gpndata_write>
40
+ <connection>
41
+ <use>core_write</use>
42
+ </connection>
43
+ </gpndata_write>
44
+ <gpndata_read>
45
+ <connection>
46
+ <use>core_read</use>
47
+ </connection>
48
+ </gpndata_read>
49
+ </resources>
50
+ <events>
51
+ <checkout_submit_all_after>
52
+ <observers>
53
+ <redirect_to_3ds>
54
+ <class>gpndata/observer</class>
55
+ <method>checkout_submit_all_after</method>
56
+ </redirect_to_3ds>
57
+ </observers>
58
+ </checkout_submit_all_after>
59
+ </events>
60
+ </global>
61
+ <frontend>
62
+ <routers>
63
+ <gpndata>
64
+ <use>standard</use>
65
+ <args>
66
+ <module>Modulesgarden_Gpndata</module>
67
+ <frontName>gpndata</frontName>
68
+ </args>
69
+ </gpndata>
70
+ </routers>
71
+ <translate>
72
+ <modules>
73
+ <gpndata>
74
+ <files>
75
+ <default>Modulesgarden_Gpndata.csv</default>
76
+ </files>
77
+ </gpndata>
78
+ </modules>
79
+ </translate>
80
+ </frontend>
81
+ <adminhtml>
82
+ <translate>
83
+ <modules>
84
+ <gpndata>
85
+ <files>
86
+ <default>Modulesgarden_Gpndata.csv</default>
87
+ </files>
88
+ </gpndata>
89
+ </modules>
90
+ </translate>
91
+ <layout>
92
+ <updates>
93
+ <gpndata>
94
+ <file>gpndata.xml</file>
95
+ </gpndata>
96
+ </updates>
97
+ </layout>
98
+ <events>
99
+ <controller_action_predispatch_adminhtml_sales_recurring_profile_view>
100
+ <observers>
101
+ <manual_rebill_gpndata>
102
+ <class>gpndata/observer</class>
103
+ <method>manualRebill</method>
104
+ </manual_rebill_gpndata>
105
+ </observers>
106
+ </controller_action_predispatch_adminhtml_sales_recurring_profile_view>
107
+ </events>
108
+ </adminhtml>
109
+ <default>
110
+ <payment>
111
+ <gpndata>
112
+ <sort_order>0</sort_order>
113
+ <model>gpndata/payment</model>
114
+ <title>Credit Card</title>
115
+ <enabled>1</enabled>
116
+ <order_status>processing</order_status>
117
+ <payment_action>authorize</payment_action>
118
+ <cctypes>VI,MC,AE,DI</cctypes>
119
+ <useccv>1</useccv>
120
+ </gpndata>
121
+ <gpndatarecurring>
122
+ <model>gpndata/paymentrecurring</model>
123
+ <title>Credit Card Recurring Payments</title>
124
+ <enabled>1</enabled>
125
+ <sort_order>0</sort_order>
126
+ <payment_action>Authorization</payment_action>
127
+ <solution_type>Mark</solution_type>
128
+ <line_items_enabled>1</line_items_enabled>
129
+ <visible_on_cart>1</visible_on_cart>
130
+ <visible_on_product>1</visible_on_product>
131
+ <allow_ba_signup>never</allow_ba_signup>
132
+ <authorization_honor_period>3</authorization_honor_period>
133
+ <order_valid_period>29</order_valid_period>
134
+ <child_authorization_number>1</child_authorization_number>
135
+ <verify_peer>1</verify_peer>
136
+ <activecron>1</activecron>
137
+ </gpndatarecurring>
138
+ </payment>
139
+ </default>
140
+ <crontab>
141
+ <jobs>
142
+ <gpndatarecurring_charge>
143
+ <schedule>
144
+ <cron_expr>0 * * * *</cron_expr>
145
+ </schedule>
146
+ <run>
147
+ <model>gpndata/observer::chargeRecurringProfiles</model>
148
+ </run>
149
+ </gpndatarecurring_charge>
150
+ </jobs>
151
+ </crontab>
152
+ </config>
app/code/community/Modulesgarden/Gpndata/etc/system.xml ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <gpndata translate="label comment" module="gpndata">
7
+ <label>GPN DATA</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>10</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Title</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>20</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </title>
31
+ <order_status translate="label">
32
+ <label>New Order Status</label>
33
+ <frontend_type>select</frontend_type>
34
+ <source_model>adminhtml/system_config_source_order_status</source_model>
35
+ <sort_order>50</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>0</show_in_store>
39
+ </order_status>
40
+ <submit_url translate="label">
41
+ <label>Gateway URL</label>
42
+ <frontend_type>text</frontend_type>
43
+ <sort_order>58</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>0</show_in_store>
47
+ </submit_url>
48
+ <merchant_id translate="label">
49
+ <label>Merchant ID</label>
50
+ <frontend_type>text</frontend_type>
51
+ <sort_order>59</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>0</show_in_store>
55
+ </merchant_id>
56
+ <username translate="label">
57
+ <label>API Username</label>
58
+ <frontend_type>text</frontend_type>
59
+ <sort_order>60</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>0</show_in_store>
63
+ </username>
64
+ <password translate="label">
65
+ <label>API Password</label>
66
+ <frontend_type>obscure</frontend_type>
67
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
68
+ <sort_order>61</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>0</show_in_store>
72
+ </password>
73
+ <api_key translate="label">
74
+ <label>API Key</label>
75
+ <frontend_type>obscure</frontend_type>
76
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
77
+ <sort_order>62</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>0</show_in_store>
81
+ </api_key>
82
+ <payment_action translate="label">
83
+ <label>Payment Action</label>
84
+ <frontend_type>select</frontend_type>
85
+ <source_model>paygate/authorizenet_source_paymentAction</source_model>
86
+ <sort_order>63</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>1</show_in_website>
89
+ <show_in_store>0</show_in_store>
90
+ </payment_action>
91
+ <payment_3ds translate="label">
92
+ <label>3D Secure</label>
93
+ <frontend_type>select</frontend_type>
94
+ <source_model>adminhtml/system_config_source_yesno</source_model>
95
+ <sort_order>64</sort_order>
96
+ <show_in_default>1</show_in_default>
97
+ <show_in_website>1</show_in_website>
98
+ <show_in_store>0</show_in_store>
99
+ </payment_3ds>
100
+ <cctypes translate="label">
101
+ <label>Credit Card Types</label>
102
+ <frontend_type>multiselect</frontend_type>
103
+ <source_model>paygate/authorizenet_source_cctype</source_model>
104
+ <sort_order>65</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>0</show_in_store>
108
+ </cctypes>
109
+ <allowspecific translate="label">
110
+ <label>Payment Applicable From</label>
111
+ <frontend_type>select</frontend_type>
112
+ <sort_order>66</sort_order>
113
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>1</show_in_website>
116
+ <show_in_store>0</show_in_store>
117
+ </allowspecific>
118
+ <specificcountry translate="label">
119
+ <label>Countries Payment Applicable From</label>
120
+ <frontend_type>multiselect</frontend_type>
121
+ <sort_order>70</sort_order>
122
+ <source_model>adminhtml/system_config_source_country</source_model>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>0</show_in_store>
126
+ <depends>
127
+ <allowspecific>1</allowspecific>
128
+ </depends>
129
+ </specificcountry>
130
+ <sort_order translate="label">
131
+ <label>Sort Order</label>
132
+ <frontend_type>text</frontend_type>
133
+ </sort_order>
134
+ </fields>
135
+ </gpndata>
136
+ <gpndatarecurring translate="label comment" module="gpndata">
137
+ <label>GPN DATA Recurring Payments</label>
138
+ <frontend_type>text</frontend_type>
139
+ <sort_order>10</sort_order>
140
+ <show_in_default>1</show_in_default>
141
+ <show_in_website>1</show_in_website>
142
+ <show_in_store>1</show_in_store>
143
+ <fields>
144
+ <active translate="label">
145
+ <label>Enabled</label>
146
+ <frontend_type>select</frontend_type>
147
+ <source_model>adminhtml/system_config_source_yesno</source_model>
148
+ <sort_order>10</sort_order>
149
+ <show_in_default>1</show_in_default>
150
+ <show_in_website>1</show_in_website>
151
+ <show_in_store>0</show_in_store>
152
+ </active>
153
+ <title translate="label">
154
+ <label>Title</label>
155
+ <frontend_type>text</frontend_type>
156
+ <sort_order>20</sort_order>
157
+ <show_in_default>1</show_in_default>
158
+ <show_in_website>1</show_in_website>
159
+ <show_in_store>1</show_in_store>
160
+ </title>
161
+ <submit_url translate="label">
162
+ <label>Gateway URL</label>
163
+ <frontend_type>text</frontend_type>
164
+ <sort_order>58</sort_order>
165
+ <show_in_default>1</show_in_default>
166
+ <show_in_website>1</show_in_website>
167
+ <show_in_store>0</show_in_store>
168
+ </submit_url>
169
+ <merchant_id translate="label">
170
+ <label>Merchant ID</label>
171
+ <frontend_type>text</frontend_type>
172
+ <sort_order>59</sort_order>
173
+ <show_in_default>1</show_in_default>
174
+ <show_in_website>1</show_in_website>
175
+ <show_in_store>0</show_in_store>
176
+ </merchant_id>
177
+ <username translate="label">
178
+ <label>API Username</label>
179
+ <frontend_type>text</frontend_type>
180
+ <sort_order>60</sort_order>
181
+ <show_in_default>1</show_in_default>
182
+ <show_in_website>1</show_in_website>
183
+ <show_in_store>0</show_in_store>
184
+ </username>
185
+ <password translate="label">
186
+ <label>API Password</label>
187
+ <frontend_type>obscure</frontend_type>
188
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
189
+ <sort_order>61</sort_order>
190
+ <show_in_default>1</show_in_default>
191
+ <show_in_website>1</show_in_website>
192
+ <show_in_store>0</show_in_store>
193
+ </password>
194
+ <api_key translate="label">
195
+ <label>API Key</label>
196
+ <frontend_type>obscure</frontend_type>
197
+ <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
198
+ <sort_order>62</sort_order>
199
+ <show_in_default>1</show_in_default>
200
+ <show_in_website>1</show_in_website>
201
+ <show_in_store>0</show_in_store>
202
+ </api_key>
203
+ <payment_action translate="label">
204
+ <label>Payment Action</label>
205
+ <frontend_type>select</frontend_type>
206
+ <source_model>paygate/authorizenet_source_paymentAction</source_model>
207
+ <sort_order>67</sort_order>
208
+ <show_in_default>1</show_in_default>
209
+ <show_in_website>1</show_in_website>
210
+ <show_in_store>0</show_in_store>
211
+ </payment_action>
212
+ <payment_3ds translate="label">
213
+ <label>3D Secure</label>
214
+ <frontend_type>select</frontend_type>
215
+ <source_model>adminhtml/system_config_source_yesno</source_model>
216
+ <sort_order>70</sort_order>
217
+ <show_in_default>1</show_in_default>
218
+ <show_in_website>1</show_in_website>
219
+ <show_in_store>0</show_in_store>
220
+ </payment_3ds>
221
+ <cctypes translate="label">
222
+ <label>Credit Card Types</label>
223
+ <frontend_type>multiselect</frontend_type>
224
+ <source_model>paygate/authorizenet_source_cctype</source_model>
225
+ <sort_order>75</sort_order>
226
+ <show_in_default>1</show_in_default>
227
+ <show_in_website>1</show_in_website>
228
+ <show_in_store>0</show_in_store>
229
+ </cctypes>
230
+ <allowspecific translate="label">
231
+ <label>Payment Applicable From</label>
232
+ <frontend_type>select</frontend_type>
233
+ <sort_order>80</sort_order>
234
+ <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
235
+ <show_in_default>1</show_in_default>
236
+ <show_in_website>1</show_in_website>
237
+ <show_in_store>0</show_in_store>
238
+ </allowspecific>
239
+ <specificcountry translate="label">
240
+ <label>Countries Payment Applicable From</label>
241
+ <frontend_type>multiselect</frontend_type>
242
+ <sort_order>85</sort_order>
243
+ <source_model>adminhtml/system_config_source_country</source_model>
244
+ <show_in_default>1</show_in_default>
245
+ <show_in_website>1</show_in_website>
246
+ <show_in_store>0</show_in_store>
247
+ <depends>
248
+ <allowspecific>1</allowspecific>
249
+ </depends>
250
+ </specificcountry>
251
+ <sort_order translate="label">
252
+ <label>Sort Order</label>
253
+ <frontend_type>text</frontend_type>
254
+ <sort_order>90</sort_order>
255
+ </sort_order>
256
+ <activecron translate="label">
257
+ <label>Cron Charges Enabled</label>
258
+ <frontend_type>select</frontend_type>
259
+ <source_model>adminhtml/system_config_source_yesno</source_model>
260
+ <sort_order>95</sort_order>
261
+ <show_in_default>1</show_in_default>
262
+ <show_in_website>1</show_in_website>
263
+ <show_in_store>0</show_in_store>
264
+ </activecron>
265
+ <hidecheckoutemptytotals translate="label">
266
+ <label>Hiding Empty Totals Enabled</label>
267
+ <frontend_type>select</frontend_type>
268
+ <comment>By default Magento displays Subtotal and Grand Total as 0.00 for Nominal Items in checkout process. This option removes it.</comment>
269
+ <source_model>adminhtml/system_config_source_yesno</source_model>
270
+ <sort_order>97</sort_order>
271
+ <show_in_default>1</show_in_default>
272
+ <show_in_website>1</show_in_website>
273
+ <show_in_store>0</show_in_store>
274
+ </hidecheckoutemptytotals>
275
+ </fields>
276
+ </gpndatarecurring>
277
+ </groups>
278
+ </payment>
279
+ </sections>
280
+ </config>
app/code/community/Modulesgarden/Gpndata/sql/gpndata_setup/mysql4-install-0.2.0.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /* * ********************************************************************
4
+ * Customization Services by ModulesGarden.com
5
+ * Copyright (c) ModulesGarden, INBS Group Brand, All Rights Reserved
6
+ * (2014-03-31, 09:54:46)
7
+ *
8
+ *
9
+ * CREATED BY MODULESGARDEN -> http://modulesgarden.com
10
+ * CONTACT -> contact@modulesgarden.com
11
+ *
12
+ *
13
+ *
14
+ *
15
+ * This software is furnished under a license and may be used and copied
16
+ * only in accordance with the terms of such license and with the
17
+ * inclusion of the above copyright notice. This software or any other
18
+ * copies thereof may not be provided or otherwise made available to any
19
+ * other person. No title to and ownership of the software is hereby
20
+ * transferred.
21
+ *
22
+ *
23
+ * ******************************************************************** */
24
+
25
+ /**
26
+ * @author Grzegorz Draganik <grzegorz@modulesgarden.com>
27
+ */
28
+
29
+
30
+ $installer = $this;
31
+ $installer->startSetup();
32
+
33
+ $installer->addAttribute("order", "gpndata_md", array(
34
+ 'type' => 'varchar',
35
+ 'backend_type' => 'text',
36
+ 'is_user_defined' => false,
37
+ 'label' => 'GPN Data MD',
38
+ 'visible' => false,
39
+ 'required' => false,
40
+ 'user_defined' => false,
41
+ 'searchable' => false,
42
+ 'filterable' => false,
43
+ 'comparable' => false,
44
+ 'default' => ''
45
+ ));
46
+
47
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/gpndata.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout>
3
+ <adminhtml_sales_recurring_profile_view>
4
+ <reference name="sales.recurring.profile.view">
5
+ <action method="addButton">
6
+ <id>manual_rebill</id>
7
+ <params>
8
+ <label>Manual Rebill</label>
9
+ <title>Manual Rebill</title>
10
+ <class>save</class>
11
+ <onclick><![CDATA[if (confirm('Are you sure?')){ window.location.href = window.location.href + '?manual_rebill=1'; }]]></onclick>
12
+ </params>
13
+ </action>
14
+ </reference>
15
+ </adminhtml_sales_recurring_profile_view>
16
+ </layout>
app/etc/modules/Modulesgarden_Gpndata.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Modulesgarden_Gpndata>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Sales />
9
+ </depends>
10
+ </Modulesgarden_Gpndata>
11
+ </modules>
12
+ </config>
app/locale/en_US/Modulesgarden_Gpndata.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Gateway URL","Gateway URL"
2
+ "Merchant ID","Merchant ID"
3
+ "API Username","API Username"
4
+ "API Password","API Password"
5
+ "API Key","API Key"
6
+ "3D Secure","3D Secure"
7
+ "3D-Secure Payment Transaction","3D-Secure Payment Transaction"
8
+ "You will be redirected to the bank website in a few seconds.","You will be redirected to the bank website in a few seconds."
9
+ "JavaScript is currently disabled or is not supported by your browser. Please click Submit to continue the processing of your 3D-Secure Payment transaction.","JavaScript is currently disabled or is not supported by your browser. Please click Submit to continue the processing of your 3D-Secure Payment transaction."
10
+ "Submit","Submit"
11
+ "Payment Successful! Credit Card account has been charged with the amount of the transaction.","Payment Successful! Credit Card account has been charged with the amount of the transaction."
12
+ "Payment Approved!","Payment Approved!"
13
+ "Payment declined! Transaction has been declined.","Payment declined! Transaction has been declined."
14
+ "Payment error! The transaction has NOT been accepted by the Gateway and thus No processing has taken place.","Payment error! The transaction has NOT been accepted by the Gateway and thus No processing has taken place."
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Modulesgarden_Gpndata</name>
4
+ <version>1.2.0</version>
5
+ <stability>stable</stability>
6
+ <license>OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>ModulesGarden GPN DATA For Magento will allow you to integrate GPN DATA payment gateway with your Magento.</summary>
10
+ <description>ModulesGarden GPN DATA For Magento will allow you to integrate GPN DATA payment gateway with your Magento. Owing to quick and simple installation and configuration of the extension you will be able to implement convenient and secure payment method to your online store!&#xD;
11
+ &#xD;
12
+ You will be able to benefit from of all proven GPN DATA solutions, like e.g. recurring billing or 3D Secure. All this directly from your Magento!&#xD;
13
+ &#xD;
14
+ With GPN DATA For Magento your online payments will become much more business friendly and secure.</description>
15
+ <notes>Initial Stable Release</notes>
16
+ <authors><author><name>ModulesGarden</name><user>ModulesGarden</user><email>peter@inbsgroup.com</email></author></authors>
17
+ <date>2014-10-01</date>
18
+ <time>11:02:35</time>
19
+ <contents><target name="magecommunity"><dir name="Modulesgarden"><dir name="Gpndata"><dir name="Block"><dir name="Checkout"><dir name="Cart"><file name="Totals.php" hash="0ba8327008b9233c1ebae389dae24416"/></dir></dir><dir name="Form"><file name="Cc.php" hash="a41977960098adf9489379b396c50130"/></dir><file name="Redirect.php" hash="8aab129b741cf809582a1fa6908e631a"/></dir><dir name="Helper"><file name="Data.php" hash="a558637349d62d34db4304fb87268bdb"/></dir><dir name="Model"><dir name="Gpndata"><file name="Map.php" hash="8bf6afb97ed615e58df9ca80a3f5f13d"/></dir><dir name="Notification"><file name="850.php" hash="dc2501bef2ab54ae8b04f60bb9d145dc"/><file name="860.php" hash="fdbf58cc4a8a00e0bad528208aa23713"/><file name="870.php" hash="e6f2e459f511ed7be021d26196596c9a"/><file name="Response.php" hash="40dcb01ab59e951e3a6759f288329796"/></dir><file name="Notification.php" hash="a14248b6584f6bced7babeb3d496c0ad"/><file name="Observer.php" hash="f02a0c8b2c8ba572640dac2a346cb515"/><file name="Payment.php" hash="6832a4bcc9be705cf1f115f0c6b675dc"/><file name="Paymentrecurring.php" hash="6b75979efce977673b9a75ea298c054a"/><dir name="Request"><file name="700.php" hash="d585fe1f1b539de4e12d785bf8334a4a"/><file name="701.php" hash="650d77a18240f7d2d733eeb211e25995"/><file name="702.php" hash="c5464b098f4bd056c5a5463fb1dbb1be"/><file name="705.php" hash="374ea5d1e423e4d1d54042f54e728e35"/><file name="755.php" hash="d4e3c3a705b115f87b2c47f2749b972f"/><file name="756.php" hash="c642434b0dd59ee86a82208e763e9010"/><file name="760.php" hash="68de63bc97fbbcfd96c3c9829a6de46a"/></dir><file name="Request.php" hash="9fad4aacf396fd2aedd427edd8edcafb"/><file name="Response.php" hash="86c75ce20918c6f6eea7e0b9b81deac8"/></dir><dir name="controllers"><file name="NotificationsController.php" hash="9980c32ad2ce7e01cfc293b8ea09f120"/><file name="RedirectController.php" hash="2bcf9681a388157869b7753153f3dc1f"/></dir><dir name="etc"><file name="config.xml" hash="e7521287ba46d5430ec7353d251ad1bf"/><file name="system.xml" hash="1c8255af94f0bbb10e8efcff724a7d30"/></dir><dir name="sql"><dir name="gpndata_setup"><file name="mysql4-install-0.2.0.php" hash="c2021e11743f49a8dc78f8d180f764ef"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Modulesgarden_Gpndata.xml" hash="26441c9512668859961efb44352d1f57"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Modulesgarden_Gpndata.csv" hash="cfab8a5e1bf6bd68ca0a34d4b3d0b29b"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="gpndata.xml" hash="ffee7fbb36c6dc176016d599024e6332"/></dir></dir></dir></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.2.13</min><max>5.3.24</max></php></required></dependencies>
22
+ </package>