diff --git a/app/code/community/Paybox/Epayment/Helper/Encrypt.php b/app/code/community/Paybox/Epayment/Helper/Encrypt.php index 4f00bc1..0cf364b 100644 --- a/app/code/community/Paybox/Epayment/Helper/Encrypt.php +++ b/app/code/community/Paybox/Epayment/Helper/Encrypt.php @@ -19,9 +19,39 @@ * @license http://opensource.org/licenses/OSL-3.0 * @link http://www.paybox.com/ */ + define('WC_PAYBOX_KEY_PATH',__DIR__); class Paybox_Epayment_Helper_Encrypt extends Mage_Core_Helper_Abstract { + /* + * You can change this method + if you want to change the way the key is generated. + */ + public function generateKey(){ + // generate key, write to KEY_FILE_PATH + $key = openssl_random_pseudo_bytes(16); + if(file_exists(WC_PAYBOX_KEY_PATH))unlink(WC_PAYBOX_KEY_PATH); + $key = bin2hex($key); + $iv = $this->_MakeIv($key); + return file_put_contents(WC_PAYBOX_KEY_PATH,"getNode('global/crypt/key'); return $key; } + /** + * @return string Key used for encryption + */ + private function _getIv() + { + //check whether key on KEY_FILE_PATH exists, if not generate it. + if(!file_exists(WC_PAYBOX_KEY_PATH)){ + $this->generateKey(); + $_POST['KEY_ERROR'] = __("For some reason, the key has just been generated. please reenter the HMAC key to crypt it."); + }else{ + $iv = file_get_contents(WC_PAYBOX_KEY_PATH); + $iv = substr($iv,37,16); + return $iv; + } + } + private function _crypt($key,$iv,$data){ + if(function_exists('openssl_encrypt')){ + //openssl + $result = openssl_encrypt($data, 'aes-128-cbc', $key, OPENSSL_RAW_DATA , $iv); + }else{ + // Prepare mcrypt + $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, ''); + mcrypt_generic_init($td, $key, $iv); + // Encrypt + $result = mcrypt_generic($td, $data); + } + // Encode (to avoid data loose when saved to database or + // any storage that does not support null chars) + return base64_encode($result); + } + /** + * Encrypt $data using AES + * @param string $data The data to encrypt + * @return string The result of encryption + */ + public function encrypt($data) + { + if (empty($data)) { + return ''; + } + // First encode data to base64 (see end of descrypt) + $data = base64_encode($data); + + + // Prepare key + $key = $this->_getKey(); + $key = substr($key, 0, 24); + while (strlen($key) < 24) { + $key .= substr($key, 0, 24 - strlen($key)); + } + // Init vector + $iv = $this->_getIv(); + + return $this->_crypt($key,$iv,$data); + + } + private function _decrypt($key,$iv,$data){ + if(function_exists('openssl_decrypt')){ + //openssl + $result = openssl_decrypt($data, 'aes-128-cbc', $key, OPENSSL_RAW_DATA , $iv); + if(!$result && function_exists('mcrypt_module_open')){ + $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, ''); + mcrypt_generic_init($td, $key, $iv); + // Decrypt + $result = mdecrypt_generic($td, $data); + } +// if(!$result) show_message(new WP_Error("","","ATTENTION:le module ne peut plus afficher la clef HMAC, veuillez l'initiailiser de nouveau.")); + }else{ + // Prepare mcrypt + $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, ''); + mcrypt_generic_init($td, $key, $iv); + // Decrypt + $result = mdecrypt_generic($td, $data); + } + // Decode data + return base64_decode($result); + } + /** + * Decrypt $data using 3DES + * @param string $data The data to decrypt + * @return string The result of decryption + * @see PAYBOX_Epayment_Helper_Encrypt::_getKey() + */ + public function decrypt($data) + { + if (empty($data)) { + return ''; + } + + // First decode encrypted message (see end of encrypt) + $data = base64_decode($data); + + + // Prepare key + $key = $this->_getKey(); + $key = substr($key, 0, 24); + while (strlen($key) < 24) { + $key .= substr($key, 0, 24 - strlen($key)); + } + // Init vector + $iv = $this->_getIv(); + $result = $this->_decrypt($key,$iv,$data); + // Remove any null char (data is base64 encoded so no data loose) + $result = rtrim($result, "\0"); + + + return $result; + } - /** - * Encrypt $data using 3DES - * @param string $data The data to encrypt - * @return string The result of encryption - * @see Paybox_Epayment_Helper_Encrypt::_getKey() - */ - public function encrypt($data) - { - if (empty($data)) { - return ''; - } - - // First encode data to base64 (see end of descrypt) - $data = base64_encode($data); - - // Prepare mcrypt - $td = mcrypt_module_open(MCRYPT_3DES, '', MCRYPT_MODE_ECB, ''); - - // Prepare key - $key = $this->_getKey(); - $key = substr($key, 0, 24); - while (strlen($key) < 24) { - $key .= substr($key, 0, 24 - strlen($key)); - } - - // Init vector - $size = mcrypt_enc_get_iv_size($td); - $iv = mcrypt_create_iv($size, MCRYPT_RAND); - mcrypt_generic_init($td, $key, $iv); - - // Encrypt - $result = mcrypt_generic($td, $data); - - // Encode (to avoid data loose when saved to database or - // any storage that does not support null chars) - $result = base64_encode($result); - - return $result; - } - - /** - * Decrypt $data using 3DES - * @param string $data The data to decrypt - * @return string The result of decryption - * @see Paybox_Epayment_Helper_Encrypt::_getKey() - */ - public function decrypt($data) - { - if (empty($data)) { - return ''; - } - - // First decode encrypted message (see end of encrypt) - $data = base64_decode($data); - - // Prepare mcrypt - $td = mcrypt_module_open(MCRYPT_3DES, '', MCRYPT_MODE_ECB, ''); - - // Prepare key - $key = $this->_getKey(); - $key = substr($key, 0, 24); - while (strlen($key) < 24) { - $key .= substr($key, 0, 24 - strlen($key)); - } - - // Init vector - $size = mcrypt_enc_get_iv_size($td); - $iv = mcrypt_create_iv($size, MCRYPT_RAND); - mcrypt_generic_init($td, $key, $iv); - - // Decrypt - $result = mdecrypt_generic($td, $data); - - // Remove any null char (data is base64 encoded so no data loose) - $result = rtrim($result, "\0"); - - // Decode data - $result = base64_decode($result); - - return $result; - } } diff --git a/app/code/community/Paybox/Epayment/Helper/Iso3166Country.php b/app/code/community/Paybox/Epayment/Helper/Iso3166Country.php new file mode 100644 index 0000000..28f0423 --- /dev/null +++ b/app/code/community/Paybox/Epayment/Helper/Iso3166Country.php @@ -0,0 +1,292 @@ + '020', + 'AE' => '784', + 'AF' => '004', + 'AG' => '028', + 'AI' => '660', + 'AL' => '008', + 'AM' => '051', + 'AO' => '024', + 'AQ' => '010', + 'AR' => '032', + 'AS' => '016', + 'AT' => '040', + 'AU' => '036', + 'AW' => '533', + 'AX' => '248', + 'AZ' => '031', + 'BA' => '070', + 'BB' => '052', + 'BD' => '050', + 'BE' => '056', + 'BF' => '854', + 'BG' => '100', + 'BH' => '048', + 'BI' => '108', + 'BJ' => '204', + 'BL' => '652', + 'BM' => '060', + 'BN' => '096', + 'BO' => '068', + 'BQ' => '535', + 'BR' => '076', + 'BS' => '044', + 'BT' => '064', + 'BV' => '074', + 'BW' => '072', + 'BY' => '112', + 'BZ' => '084', + 'CA' => '124', + 'CC' => '166', + 'CD' => '180', + 'CF' => '140', + 'CG' => '178', + 'CH' => '756', + 'CI' => '384', + 'CK' => '184', + 'CL' => '152', + 'CM' => '120', + 'CN' => '156', + 'CO' => '170', + 'CR' => '188', + 'CU' => '192', + 'CV' => '132', + 'CW' => '531', + 'CX' => '162', + 'CY' => '196', + 'CZ' => '203', + 'DE' => '276', + 'DJ' => '262', + 'DK' => '208', + 'DM' => '212', + 'DO' => '214', + 'DZ' => '012', + 'EC' => '218', + 'EE' => '233', + 'EG' => '818', + 'EH' => '732', + 'ER' => '232', + 'ES' => '724', + 'ET' => '231', + 'FI' => '246', + 'FJ' => '242', + 'FK' => '238', + 'FM' => '583', + 'FO' => '234', + 'FR' => '250', + 'GA' => '266', + 'GB' => '826', + 'GD' => '308', + 'GE' => '268', + 'GF' => '254', + 'GG' => '831', + 'GH' => '288', + 'GI' => '292', + 'GL' => '304', + 'GM' => '270', + 'GN' => '324', + 'GP' => '312', + 'GQ' => '226', + 'GR' => '300', + 'GS' => '239', + 'GT' => '320', + 'GU' => '316', + 'GW' => '624', + 'GY' => '328', + 'HK' => '344', + 'HM' => '334', + 'HN' => '340', + 'HR' => '191', + 'HT' => '332', + 'HU' => '348', + 'ID' => '360', + 'IE' => '372', + 'IL' => '376', + 'IM' => '833', + 'IN' => '356', + 'IO' => '086', + 'IQ' => '368', + 'IR' => '364', + 'IS' => '352', + 'IT' => '380', + 'JE' => '832', + 'JM' => '388', + 'JO' => '400', + 'JP' => '392', + 'KE' => '404', + 'KG' => '417', + 'KH' => '116', + 'KI' => '296', + 'KM' => '174', + 'KN' => '659', + 'KP' => '408', + 'KR' => '410', + 'KW' => '414', + 'KY' => '136', + 'KZ' => '398', + 'LA' => '418', + 'LB' => '422', + 'LC' => '662', + 'LI' => '438', + 'LK' => '144', + 'LR' => '430', + 'LS' => '426', + 'LT' => '440', + 'LU' => '442', + 'LV' => '428', + 'LY' => '434', + 'MA' => '504', + 'MC' => '492', + 'MD' => '498', + 'ME' => '499', + 'MF' => '663', + 'MG' => '450', + 'MH' => '584', + 'MK' => '807', + 'ML' => '466', + 'MM' => '104', + 'MN' => '496', + 'MO' => '446', + 'MP' => '580', + 'MQ' => '474', + 'MR' => '478', + 'MS' => '500', + 'MT' => '470', + 'MU' => '480', + 'MV' => '462', + 'MW' => '454', + 'MX' => '484', + 'MY' => '458', + 'MZ' => '508', + 'NA' => '516', + 'NC' => '540', + 'NE' => '562', + 'NF' => '574', + 'NG' => '566', + 'NI' => '558', + 'NL' => '528', + 'NO' => '578', + 'NP' => '524', + 'NR' => '520', + 'NU' => '570', + 'NZ' => '554', + 'OM' => '512', + 'PA' => '591', + 'PE' => '604', + 'PF' => '258', + 'PG' => '598', + 'PH' => '608', + 'PK' => '586', + 'PL' => '616', + 'PM' => '666', + 'PN' => '612', + 'PR' => '630', + 'PS' => '275', + 'PT' => '620', + 'PW' => '585', + 'PY' => '600', + 'QA' => '634', + 'RE' => '638', + 'RO' => '642', + 'RS' => '688', + 'RU' => '643', + 'RW' => '646', + 'SA' => '682', + 'SB' => '090', + 'SC' => '690', + 'SD' => '729', + 'SE' => '752', + 'SG' => '702', + 'SH' => '654', + 'SI' => '705', + 'SJ' => '744', + 'SK' => '703', + 'SL' => '694', + 'SM' => '674', + 'SN' => '686', + 'SO' => '706', + 'SR' => '740', + 'SS' => '728', + 'ST' => '678', + 'SV' => '222', + 'SX' => '534', + 'SY' => '760', + 'SZ' => '748', + 'TC' => '796', + 'TD' => '148', + 'TF' => '260', + 'TG' => '768', + 'TH' => '764', + 'TJ' => '762', + 'TK' => '772', + 'TL' => '626', + 'TM' => '795', + 'TN' => '788', + 'TO' => '776', + 'TR' => '792', + 'TT' => '780', + 'TV' => '798', + 'TW' => '158', + 'TZ' => '834', + 'UA' => '804', + 'UG' => '800', + 'UM' => '581', + 'US' => '840', + 'UY' => '858', + 'UZ' => '860', + 'VA' => '336', + 'VC' => '670', + 'VE' => '862', + 'VG' => '092', + 'VI' => '850', + 'VN' => '704', + 'VU' => '548', + 'WF' => '876', + 'WS' => '882', + 'YE' => '887', + 'YT' => '175', + 'ZA' => '710', + 'ZM' => '894', + 'ZW' => '716', + ]; + + /** + * Retrieve corresponding numeric country code (ISO 3166) + * + * @param string $isoCode + * @param string $default + * @return string|null + */ + public function getNumericCode($isoCode, $default = null) + { + if (isset($this->_mapping[$isoCode])) { + return $this->_mapping[$isoCode]; + } + return $default; + } +} diff --git a/app/code/community/Paybox/Epayment/Helper/IsoCountry.php b/app/code/community/Paybox/Epayment/Helper/IsoCountry.php index 72e5aab..12ff47e 100644 --- a/app/code/community/Paybox/Epayment/Helper/IsoCountry.php +++ b/app/code/community/Paybox/Epayment/Helper/IsoCountry.php @@ -1,8 +1,8 @@ array( 'alpha2'=>'XK', 'alpha3'=>'KOS', 'num'=>'383', 'isd'=> '383', "name" => "Kosovo", "continent" => "Europe") ); + public function load($code){ + $this->mobile_validator = Mage::helper('sf3xep/MobileValidator'); + $this->Country = $this->mobile_validator->getCountry($code); + if (is_array($this->Country)){ + $this->PhoneCode = $this->Country['country_code']; + $this->Name = $this->Country['country_name']; + $this->alpha2 = $this->Country['alpha2']; + $this->alpha3 = $this->Country['alpha3']; + $this->IsoCode = $this->_countries[$this->Country['alpha2']]['num']; + }else{ + return null; + } + } + public function normalizeNumber($number){ + return $this->mobile_validator->normalize($number,$this->alpha2,true); + } } diff --git a/app/code/community/Paybox/Epayment/Model/Paybox.php b/app/code/community/Paybox/Epayment/Model/Paybox.php index 30fec05..6efc226 100644 --- a/app/code/community/Paybox/Epayment/Model/Paybox.php +++ b/app/code/community/Paybox/Epayment/Model/Paybox.php @@ -234,6 +234,7 @@ class Paybox_Epayment_Model_Paybox 'Q' => 'time', 'S' => 'transaction', 'U' => 'subscriptionData', + 'v' => '3dsversion', 'W' => 'date', 'Y' => 'country', 'Z' => 'paymentIndex', @@ -406,12 +407,12 @@ public function buildSystemParams(Mage_Sales_Model_Order $order, Paybox_Epayment } // 3-D Secure - if (!$payment->is3DSEnabled($order)) { + if (!$payment->is3DSEnabled($order) && !( $values['PBX_TYPECARTE'] == 'AMEX')){ $values['PBX_3DS'] = 'N'; } // Paybox => Magento - $values['PBX_RETOUR'] = 'M:M;R:R;T:T;A:A;B:B;C:C;D:D;E:E;F:F;G:G;I:I;J:J;N:N;O:O;P:P;Q:Q;S:S;W:W;Y:Y;K:K'; + $values['PBX_RETOUR'] = 'M:M;R:R;T:T;A:A;B:B;C:C;D:D;E:E;F:F;G:G;I:I;J:J;N:N;O:O;P:P;Q:Q;S:S;W:W;Y:Y;v:v;K:K'; $values['PBX_RUF1'] = 'POST'; // Choose correct language @@ -486,9 +487,9 @@ public function buildSystemParams(Mage_Sales_Model_Order $order, Paybox_Epayment $values['PBX_REFUSE'] .= $s; $values['PBX_REPONDRE_A'] .= $s; } - $values['PBX_SHOPPINGCART'] = $payment->getXmlShoppingCartInformation($order); - $values['PBX_BILLING'] = $payment->getXmlBillingInformation($order); - + $values['PBX_SHOPPINGCART'] = trim(substr($this->getShoppingCartInformation($order),38)); + $values['PBX_BILLING'] = trim(substr($this->getBillingInformation($order),21)); + // PBX Version $values['PBX_VERSION'] = 'Magento_' . Mage::getVersion() . '-' . 'paybox' . '_' . Mage::getConfig()->getModuleConfig("Paybox_Epayment")->version; @@ -503,6 +504,74 @@ public function buildSystemParams(Mage_Sales_Model_Order $order, Paybox_Epayment return $values; } +/**generating xml for customer and billing**/ + public function getShoppingCartInformation(Mage_Sales_Model_Order $order) + { + $totalQuantity = 0; + foreach ($order->getAllVisibleItems() as $item) { + $totalQuantity += (int)$item->getQtyOrdered(); + } + $totalQuantity = min($totalQuantity, 99); + return sprintf('%d', $totalQuantity); + return $simpleXMLElement->asXML(); + } + + public function getBillingInformation(Mage_Sales_Model_Order $order) + { + $address = $order->getBillingAddress(); + $firstName = trim($this->remove_accents($order->getCustomerFirstname())); + $lastName = trim($this->remove_accents($order->getCustomerLastname())); + $address1 = is_array($address->getStreet()) ? $this->remove_accents(str_replace(".","",$address->getStreet()[0])) : $this->remove_accents(str_replace(".","",$address->getStreet())); + $address2 = (is_array($address->getStreet()) && array_key_exists(1,$address->getStreet())) ? $this->remove_accents(str_replace(".","",$address->getStreet()[1])) : ""; + $zipCode = $address->getPostcode(); + $city = trim($this->remove_accents($address->getCity())); + $IsoCountry = Mage::helper('pbxep/IsoCountry'); + $IsoCountry->load($address->country_id); + $countryCode = $IsoCountry->IsoCode; + + $customer_id = $order->getCustomerId(); + $customerData = Mage::getModel('customer/customer')->load($customer_id); + $title = $customerData->prefix; + if(empty($tilte))$title = "Mr"; + + + $simpleXMLElement = new SimpleXMLElement(""); + // $billingXML = $simpleXMLElement->addChild('Billing'); + $addressXML = $simpleXMLElement->addChild('Address'); + $addressXML->addChild('FirstName',$this->remove_accents($firstName)); + $addressXML->addChild('LastName',$this->remove_accents($lastName)); + $addressXML->addChild('Address1',trim(str_replace("."," ",$this->remove_accents($address1)))); + $addressXML->addChild('Address2',trim(str_replace("."," ",$this->remove_accents($address2)))); + $addressXML->addChild('ZipCode',$zipCode); + $addressXML->addChild('City',$this->remove_accents($city)); + $addressXML->addChild('CountryCode',$countryCode); + + return $simpleXMLElement->asXML(); + } + + private function remove_accents($string){ + $table = array( + 'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj', 'd'=>'d', 'Ž'=>'Z', 'ž'=>'z', 'C'=>'C', 'c'=>'c', 'C'=>'C', 'c'=>'c', + 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', + 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', + 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', + 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', + 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', + 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', + 'ÿ'=>'y', 'R'=>'R', 'r'=>'r', + ); + $str = strtr($string, $table); + return $str; + } + + + + public function getCountryCode($countryCode) + { + $countryMapper = Mage::getSingleton('sf3xep/IsoCountry'); + return $countryMapper->getIsoCode($countryCode); + } + public function cleanForPaypalData($string, $nbCaracter = 0) { $string = trim(preg_replace("/[^-+. a-zA-Z0-9]/", " ", Mage::helper('core')->removeAccents($string))); diff --git a/app/code/community/Paybox/Epayment/Model/Payment/Abstract.php b/app/code/community/Paybox/Epayment/Model/Payment/Abstract.php index feba576..b61d5ff 100644 --- a/app/code/community/Paybox/Epayment/Model/Payment/Abstract.php +++ b/app/code/community/Paybox/Epayment/Model/Payment/Abstract.php @@ -619,72 +619,6 @@ protected function exportToXml($xml) return $xml; } - /** - * Generate XML value for PBX_BILLING parameter - * - * @param Mage_Sales_Model_Order $order - * @return string - */ - public function getXmlBillingInformation(Order $order) - { - // Retrieve billing address from order - $address = $order->getBillingAddress(); - - $firstName = $this->formatTextValue($address->getCustomerFirstname(), 'ANP', 30); - $lastName = $this->formatTextValue($address->getCustomerLastname(), 'ANP', 30); - $addressLine1 = is_array($address->getStreet()) ? $this->remove_accents(str_replace(".","",$address->getStreet()[0])) : $this->remove_accents(str_replace(".","",$address->getStreet())); - $addressLine2 = (is_array($address->getStreet()) && array_key_exists(1,$address->getStreet())) ? $this->remove_accents(str_replace(".","",$address->getStreet()[1])) : ""; - $zipCode = $this->formatTextValue($address->getPostcode(), 'ANS', 16); - $city = $this->formatTextValue($address->getCity(), 'ANS', 50); - $IsoCountry = Mage::helper('pbxep/IsoCountry'); - $IsoCountry->load($address->country_id); - $countryCode = $IsoCountry->IsoCode; - - $xml = sprintf( - '
%s%s%s%s%s%s%d
', - $firstName, - $lastName, - $addressLine1, - $addressLine2, - $zipCode, - $city, - $countryCode - ); - - return $this->exportToXml($xml); - } - - /** - * Generate XML value for PBX_SHOPPINGCART parameter - * - * @param Mage_Sales_Model_Order $order - * @return string - */ - public function getXmlShoppingCartInformation(Order $order) - { - $totalQuantity = 0; - foreach ($order->getAllVisibleItems() as $item) { - $totalQuantity += (int)$item->getQtyOrdered(); - } - $totalQuantity = min($totalQuantity, 99); - - return sprintf('%d', $totalQuantity); - } - - private function remove_accents($string){ - $table = array( - 'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj', 'd'=>'d', 'Ž'=>'Z', 'ž'=>'z', 'C'=>'C', 'c'=>'c', 'C'=>'C', 'c'=>'c', - 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', - 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', - 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', - 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', - 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', - 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', - 'ÿ'=>'y', 'R'=>'R', 'r'=>'r', - ); - $str = strtr($string, $table); - return $str; - } public function logDebug($message) { diff --git a/app/code/community/Paybox/Epayment/Model/Payment/Private.php b/app/code/community/Paybox/Epayment/Model/Payment/Private.php index de6f048..282727e 100644 --- a/app/code/community/Paybox/Epayment/Model/Payment/Private.php +++ b/app/code/community/Paybox/Epayment/Model/Payment/Private.php @@ -27,4 +27,6 @@ class Paybox_Epayment_Model_Payment_Private extends Paybox_Epayment_Model_Paymen protected $_allowManualDebit = true; protected $_allowDeferredDebit = true; protected $_allowRefund = true; + protected $_3dsAllowed = true; + } diff --git a/app/code/community/Paybox/Epayment/etc/config.xml b/app/code/community/Paybox/Epayment/etc/config.xml index 14163b7..051cab9 100644 --- a/app/code/community/Paybox/Epayment/etc/config.xml +++ b/app/code/community/Paybox/Epayment/etc/config.xml @@ -306,6 +306,7 @@ immediate 1 + always diff --git a/app/code/community/Paybox/Epayment/etc/system.xml b/app/code/community/Paybox/Epayment/etc/system.xml index 4c0b975..077ba49 100644 --- a/app/code/community/Paybox/Epayment/etc/system.xml +++ b/app/code/community/Paybox/Epayment/etc/system.xml @@ -971,6 +971,56 @@ 1 + + adminhtml/system_config_form_field_heading + + 300 + 1 + 1 + 1 + + 1 + + + + + pbxep/admin_info + 305 + 1 + 1 + 1 + + 1 + + + + + Warning: your bank may enforce 3-D Secure.
Make sure your setup is coherent with your bank, Verifone e-commerce and Magento module.]]>
+ select + pbxep/admin_payment_use3ds + payment/pbxep_cb/tds_active + 310 + 1 + 1 + 1 + + 1 + +
+ + + payment/pbxep_cb/tds_min_order_total + text + 330 + 1 + 1 + 1 + + condition + 1 + + + diff --git a/app/design/adminhtml/default/default/template/pbxep/info/default.phtml b/app/design/adminhtml/default/default/template/pbxep/info/default.phtml index bbb0e2f..483bb34 100644 --- a/app/design/adminhtml/default/default/template/pbxep/info/default.phtml +++ b/app/design/adminhtml/default/default/template/pbxep/info/default.phtml @@ -96,6 +96,11 @@ $threeTime = $this->getThreeTimeLabels(); __('3-D Secure Warranty'); ?> __('Yes') : $this->__('No'));?> + + + __('3-D Secure Version'); ?> + + diff --git a/app/locale/fr_FR/Paybox_Epayment.csv b/app/locale/fr_FR/Paybox_Epayment.csv index 5f07978..f804ea6 100644 --- a/app/locale/fr_FR/Paybox_Epayment.csv +++ b/app/locale/fr_FR/Paybox_Epayment.csv @@ -72,6 +72,7 @@ "Verifone e-commerce module can show payment information to customer. You can disable this feature here.","Le module Verifone e-commerce peut afficher les informations de paiement aux clients. Vous pouvez désactiver cette fonctionnalité ici." "3-D Secure Warranty","Garantie 3-D Secure" +"3-D Secure Version","Version 3-D Secure" "3-D Secure","3-D Secure" "3-D Secure is mandatory for this payment method.","3-D Secure est obligatoire pour ce moyen de paiement." "Enable","Activer" diff --git a/package.xml b/package.xml index 2e48af4..6d98387 100644 --- a/package.xml +++ b/package.xml @@ -13,86 +13,46 @@ Une fonction de remboursement partiel ou total d’une commande. Des outils anti-fraude à la carte : 3D Secure, Filtres sur nationalités Carte / IP, alerte paiements multiples. La possibilité de prise de paiement par téléphone Un accès Back Office Paybox avec des fonctions de reporting : suivi transactions temps réel et export de journaux d’encaissement - Change Log + 3.0.7 +Adding 3DS2 -[3.0.7] 2019-12-06 -Modifications -- Changement URLS vers PHP pour permettre à Paylib de fonctionner +3.0.6 +Adding 3DS to private cards -[3.0.6] 2018-01-24 -Ajouts -- Remboursement : finalisation (1x & 3x) +3.0.5 -Corrections -- Traductions : accents +changed paybox url to php in order to accomodate paylib -Modifications -- Back Office / Email : Remove details from email and customer account -- Code : corrections MEQP1 (phpcbf) -- Code : nettoyage (debug, code mort et redondant) +3.0.4 -[3.0.5] - 2017-10-03 -Corrections -- IPN : gestion IPN successifs pour paiement en 3 fois (sauvegarde de la commande pour mise à jour des informations) -- Devise de remboursement : le montant remboursé est bien dans le devise utilisée lors du paiement -- Nettoyage des commandes : correction de la requête +added payment means ANCV, MasterPass and Illicado. +Choice of payment currency in settings +Additional variable for paypal +Compilation bug solved +Added version tracking information for tech support +various minor bug fixes -[3.0.4] 2017-01-30 -Ajouts -- Moyens de paiement : ANCV, MasterPass, Illicado +2.0.8 -Modifications -- Code : nettoyage PSR-2 +removal of the data folder, internal version number sync. -[3.0.3] 2016-10-12 -Ajouts -- Paiement : possibilité d'utiliser la page de paiement Verifone e-commerce RWD -- Back Office : actions d'annulation des paiements en 3 fois +2.0.7 -Modifications -- PayPal : paramétrage spécifique lors de l'appel à la plateforme de paiement -- Code : nettoyage +Removed Ip testing for IPN -[3.0.2] 2016-10-12 -Ajouts -- Configuration : gestion du multi-devise pour le paiement avec possibilité de forcer le paiement avec la devise par défaut ou de laisser le choix au client parmi les devises disponibles -[3.0.1] 2016-07-29 -Ajouts -- Paiement : ajout du paramètre de version pour suivi des transactions par Verifone e-commerce +2.0.6: +Added 3d secure status in the transaction details. -Corrections -- IPN : mise en conformité des paramètres "Call number" / "Transaction" -- IPN : modification de l'enregistrements des transactions non valides (saisie de coordonnées bancaires invalides, ...) pour création de transaction vide => correction du problème d'actions Back Office qui avant cela utilisaient la 1ère transaction invalide de capture comme transaction parente +corrected: signature validation with compiilation -[3.0.0] 2016-04-05 -Ajouts -- Configuration : nouvelle formule "Pack Flexible" -- Moyens de paiement: paiement en 3 fois +corrected: IPN ip filtering when behind proxy -Modifications -- Code : nettoyage - -[2.0.8] 2016-03-31 -Modifications -- Dossier data : suppression -- Versions : nettoyage des versions des fichiers - -[2.0.7] 2016-03-16 -Modifications -- IPN : suppression du filtrage des adresses IP - -[2.0.6] 2016-03-03 -Ajouts -- 3-D Secure : ajout du statut dans les détails de la transaction - -Corrections -- Compilation : correction de la validation de la signature -- IPN : correction du filtrage des adresses IP avec Proxy +-Stable version- Payboxpayboxmagento-paybox@verifone.com - 2017-10-03 - - + 2021-03-09 + + - 5.1.06.0.0 + 5.1.06.0.0openssl