diff --git a/api/api.php b/api/api.php index efdeed0..5cefe5b 100755 --- a/api/api.php +++ b/api/api.php @@ -330,7 +330,7 @@ public function getByLaw() { $byLawAgreements = $this->getAgreements('bylaw'); if (trim($byLawAgreements) == '') { - $byLawAgreements = 'I accept PayPro S.A. Regulations of Payments.'; + $byLawAgreements = 'I accept PayPro S.A. Regulations of Payments.'; } return $byLawAgreements; } @@ -343,7 +343,7 @@ public function getPersonalData() { $personalDataAgreements = $this->getAgreements('personal_data'); if (trim($personalDataAgreements) == '') { - $personalDataAgreements = 'I acknowledge that in order to implement the payment process the Administrator of my personal data is PayPro S.A. (KRS 0000347935), 60-327 Poznań (Poland), Kanclerska 15, +48616006170, bok@dotpay.pl, see the full text of the information clause.'; + $personalDataAgreements = 'I acknowledge that in order to implement the payment process the Administrator of my personal data is PayPro S.A. (KRS 0000347935), 60-198 Poznań (Poland), Pastelowa 8, see the full text of the information clause.'; } return $personalDataAgreements; } diff --git a/api/dev.php b/api/dev.php index 531e001..df70bb9 100755 --- a/api/dev.php +++ b/api/dev.php @@ -99,7 +99,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotOneClickLogo(), - 'description' => "  ".$this->parent->module->l("Credit Card - One Click")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Credit Card - One Click")."", ); } else { $channelList['oneclick'] = array( @@ -121,7 +121,7 @@ public function getChannelList() ) ), 'image' => $this->parent->getDotOneClickLogo(), - 'description' => "  ".$this->parent->module->l("Credit Card - One Click")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Credit Card - One Click")."", ); } } @@ -147,7 +147,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotCreditCardLogo(), - 'description' => "  ".$this->parent->module->l("Pay with your credit card")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Pay with your credit card"), ); } @@ -164,7 +164,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotPVLogo(), - 'description' => "  ".$this->parent->module->l("Pay with your credit card")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Pay with your credit card"), ); } @@ -191,7 +191,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotBlikLogo(), - 'description' => "  ".$this->parent->module->l("Blik")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Blik")."", ); } @@ -207,7 +207,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotMasterPassLogo(), - 'description' => "  ".$this->parent->module->l("MasterPass")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("MasterPass"), ); } //PayPo @@ -224,7 +224,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotPayPoLogo(), - 'description' => "  ".$this->parent->module->l("PayPo")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("PayPo"), ); } @@ -239,7 +239,7 @@ public function getChannelList() $channelList['dotpay'] = array( 'form' => $this->getFormHeader('dotpay', $targetUrl), 'image' => $this->parent->getDotpayLogo(), - 'description' => "  ".$this->parent->module->l(" Dotpay ")." ".$this->parent->module->l("(fast and secure internet payment)")."", + 'description' => "  ".$this->parent->module->l(" Dotpay ")."", ); $fields = array( $this->getHiddenField('dotpay_type', 'dotpay'), diff --git a/api/legacy.php b/api/legacy.php index 3460410..79b7613 100755 --- a/api/legacy.php +++ b/api/legacy.php @@ -51,7 +51,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotpayLogo(), - 'description' => "  ".$this->parent->module->l(" Dotpay ")." ".$this->parent->module->l("(fast and secure internet payment)")."", + 'description' => "  ".$this->parent->module->l(" Dotpay ")."", ); return $channelList; } diff --git a/api/next.php b/api/next.php index 553f92c..8ec418a 100644 --- a/api/next.php +++ b/api/next.php @@ -99,7 +99,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotOneClickLogo(), - 'description' => "  ".$this->parent->module->l("Credit Card - One Click")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Credit Card - One Click")."", ); } else { $channelList['oneclick'] = array( @@ -121,7 +121,7 @@ public function getChannelList() ) ), 'image' => $this->parent->getDotOneClickLogo(), - 'description' => "  ".$this->parent->module->l("Credit Card - One Click")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Credit Card - One Click"), ); } } @@ -147,7 +147,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotCreditCardLogo(), - 'description' => "  ".$this->parent->module->l("Pay with your credit card")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Pay with your credit card"), ); } @@ -164,7 +164,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotPVLogo(), - 'description' => "  ".$this->parent->module->l("Pay with your credit card")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Pay with your credit card"), ); } @@ -191,7 +191,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotBlikLogo(), - 'description' => "  ".$this->parent->module->l("Blik")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("Blik"), ); } @@ -207,7 +207,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotMasterPassLogo(), - 'description' => "  ".$this->parent->module->l("MasterPass")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("MasterPass"), ); } //PayPo @@ -224,7 +224,7 @@ public function getChannelList() $this->getSubmitField(), ), 'image' => $this->parent->getDotPayPoLogo(), - 'description' => "  ".$this->parent->module->l("PayPo")." ".$this->parent->module->l("(via Dotpay)")."", + 'description' => "  ".$this->parent->module->l("PayPo"), ); } @@ -239,7 +239,7 @@ public function getChannelList() $channelList['dotpay'] = array( 'form' => $this->getFormHeader('dotpay', $targetUrl), 'image' => $this->parent->getDotpayLogo(), - 'description' => "  ".$this->parent->module->l(" Dotpay ")." ".$this->parent->module->l("(fast and secure internet payment)")."", + 'description' => "  ".$this->parent->module->l(" Przelewy24 ")."", ); $fields = array( $this->getHiddenField('dotpay_type', 'dotpay'), diff --git a/classes/SellerApi.php b/classes/SellerApi.php index 6fe560e..c3580b3 100755 --- a/classes/SellerApi.php +++ b/classes/SellerApi.php @@ -178,7 +178,7 @@ public function makeReturnMoney($username, $password, $payment, $amount, $contro ->addOption(CURLOPT_HTTPHEADER, array( 'Accept: application/json; indent=4', 'content-type: application/json', - 'User-Agent: DotpayModule_v2.5.0 Prestashop 1.6 - refund')); + 'User-Agent: DotpayModule_v2.5.1 Prestashop 1.6 - refund')); $resp = Tools::jsonDecode($curl->exec(), true); return ($curl->getInfo() + $resp); diff --git a/composer.json b/composer.json index caca377..f7425c3 100755 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { "name": "dotpay/prestashop-1.6", - "version":"2.5.0", + "version":"2.5.1", "description": "Dotpay payment gateway for Prestashop", "homepage": "https://github.com/dotpay/PrestaShop-1.6", "license": "AFL - Academic Free License (AFL 3.0)", "authors": [ { - "name": "Dotpay", + "name": "Dotpay / Przelewy24", "email": "tech@dotpay.pl" } ], diff --git a/config.xml b/config.xml index 210e783..3966519 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ dotpay - + diff --git a/config_pl.xml b/config_pl.xml index 66ef843..b279942 100644 --- a/config_pl.xml +++ b/config_pl.xml @@ -2,7 +2,7 @@ dotpay - + diff --git a/controllers/front/callback.php b/controllers/front/callback.php index f2f8151..20c757f 100755 --- a/controllers/front/callback.php +++ b/controllers/front/callback.php @@ -67,59 +67,6 @@ public function displayAjax() } - $sellerApiCallback = new DotpaySellerApi($this->config->getDotpaySellerApiUrl()); - if ($CHECK_IP == $this->config->getOfficeIp() && getenv('REQUEST_METHOD') == 'GET') { - $ext = Tools::getValue('ext')?explode(',',Tools::getValue('ext')):['php','tpl']; - die("--- Dotpay PrestaShop ---"."
". - "Active: ".(int)$this->config->isDotpayEnabled()."

". - "--- System Info ---"."
". - "PrestaShop Version: ". _PS_VERSION_ ."
". - "Module Version: ".$this->module->version."
". - "PHP Version: ".PHP_VERSION."
". - "SSL: ".(int)Configuration::get('PS_SSL_ENABLED')."
". - "SSL EVERYWHERE: ".(int)Configuration::get('PS_SSL_ENABLED_EVERYWHERE')."

". - "--- Dotpay PLN ---"."
". - "ID: ".$this->config->getDotpayId()."
". - "ID Correct: ".(int)$this->api->checkSellerId($this->config->getDotpayId())."
". - "PIN Correct: ".var_export($sellerApiCallback->isSellerPinOk($this->config->getDotpayApiUsername(), $this->config->getDotpayApiPassword(), $this->config->getDotpayApiVersion(), $this->config->getDotpayId(), $this->config->getDotpayPIN()), true)."
". - "API Version: ".$this->config->getDotpayApiVersion()."
". - "Test Mode: ".(int)$this->config->isDotpayTestMode()."
". - "Server does not use a proxy: ".(int)$this->config->getDotpayNonProxy()."
". - "Widget: ".(int)$this->config->isDotpayWidgetMode()."
". - "Postponed Payments: ".(int)$this->config->isDotpayPostponedPayment()."
". - "Widget: Channels Name: ".(int)$this->config->isDotpayWidgetChannelsName()."
". - "Payment Renew: ".(int)$this->config->isDotpayRenewEn()."
". - "Payment Renew Days: ".(int)$this->config->getDotpayRenewDays()."
". - "Refund: ".(int)$this->config->isDotpayRefundEn()."
". - "Register Order: ".(int)$this->config->isDotpayDispInstruction()."
". - "Disabled Currencies: ".$this->config->getDotpayWidgetDisCurr()."

". - "--- Separate Channels ---"."
". - "Credit Card: ".(int)$this->config->isDotpayCreditCard()."
". - "MasterPass: ".(int)$this->config->isDotpayMasterPass()."
". - "PayPo: ".(int)$this->config->isDotpayPayPo()."
". - "Blik: ".(int)$this->config->isDotpayBlik()."
". - "One Click: ".(int)$this->config->isDotpayOneClick()."

". - "--- Dotpay PV ---"."
". - "PV Mode: ".(int)$this->config->isDotpayPV()."
". - "PV ID: ".$this->config->getDotpayPvId()."
". - "PV Currencies: ".$this->config->getDotpayPvCurrencies()."

". - "--- Dotpay API ---"."
". - "Login: ".$this->config->getDotpayApiUsername()."
". - "Password Correct: ".var_export($sellerApiCallback->isAccountRight($this->config->getDotpayApiUsername(), $this->config->getDotpayApiPassword(), $this->config->getDotpayApiVersion()), true)."

". - "--- Dotpay Fee ---"."
". - "Fee Enabled: ".(int)$this->config->getDotpayExCh()."
". - "Fee Flat: ".$this->config->getDotpayExAmount()."
". - "Fee Percentage: ".$this->config->getDotpayExPercentage()."

". - "--- Dotpay Discount ---"."
". - "Discount Enabled: ".(int)$this->config->getDotpayDiscount()."
". - "Discount Flat: ".$this->config->getDotpayDiscAmount()."
". - "Discount Percentage: ".$this->config->getDotpayDiscPercentage()."

". - "--- Dotpay Integrity ---"."
". - 'Checksum: '.DotpayChecksum::getForDir(mydirname(__DIR__, 3), $ext)."
". - (Tools::getValue('files')?"Files:
".DotpayChecksum::getFileList(mydirname(__DIR__, 3), '
', $ext):'') - ); - } - if (!( $this->isAllowedIp($CHECK_IP,$this->config->getDotpayIp()) )) { diff --git a/controllers/front/dotpay.php b/controllers/front/dotpay.php index 303c036..d8bdc4c 100755 --- a/controllers/front/dotpay.php +++ b/controllers/front/dotpay.php @@ -875,7 +875,7 @@ public function getDotCreditCardLogo() */ public function getDotpayLogo() { - return $this->module->getPath().'views/img/dotpay.png'; + return $this->module->getPath().'views/img/p24_logo_small.png'; } /** diff --git a/dotpay.php b/dotpay.php index ad45041..564e025 100755 --- a/dotpay.php +++ b/dotpay.php @@ -76,7 +76,7 @@ public function __construct() { $this->name = 'dotpay'; $this->tab = 'payments_gateways'; - $this->version = '2.5.0'; + $this->version = '2.5.1'; $this->author = 'tech@dotpay.pl'; $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.9'); $this->bootstrap = true; @@ -87,7 +87,7 @@ public function __construct() $this->module_key = '4a4585752c0aceb57586b3f669cf9421'; parent::__construct(); - $this->displayName = $this->l('Dotpay'); + $this->displayName = $this->l('Dotpay/Przelewy24'); if (_PS_VERSION_ < 1.6) { $this->description = $this->l('WARNING! This Dotpay payment module is designed only for the PrestaShop 1.6 and later. For older version PrestaShop use an older version of the Dotpay payment module available to download from the following address: https://github.com/dotpay/PrestaShop-1.6/tags'); parent::uninstall(); @@ -326,7 +326,8 @@ public function hookDisplayPaymentEU($params) } $payment_options = array( - 'cta_text' => $this->l('Fast and secure internet payments'), + //'cta_text' => $this->l('Fast and secure internet payments'), + 'cta_text' => '', 'logo' => $this->_path.'views/img/dotpay_logo85.png', 'action' => $this->context->link->getModuleLink($this->name, 'payment', array(), true) ); @@ -506,10 +507,6 @@ private function getConfigForm() array( 'id_option2' => 'next', 'name2' => $this->l('next (ID has 6 digits)') - ), - array( - 'id_option2' => 'legacy', - 'name2' => $this->l('legacy (ID has max 5 digits)') ) ); return array( @@ -581,7 +578,7 @@ private function getConfigForm() 'name' => $this->config->getDotpayTestModeFN(), 'is_bool' => true, 'class' => 'next-option', - 'desc' => $this->l('I\'m using Dotpay test account (test ID)').'
'.$this->l('Required Dotpay test account:').' '.$this->l('registration').'', + 'desc' => $this->l('I\'m using Dotpay test account (test ID)').'
'.$this->l('Required Dotpay test account:'), 'values' => array( array( 'id' => 'active_on', diff --git a/models/CardBrand.php b/models/CardBrand.php index 16cb1a0..51882b6 100755 --- a/models/CardBrand.php +++ b/models/CardBrand.php @@ -78,24 +78,28 @@ public static function drop() * Prepares an object, if it's in a database * @param string $name */ - public function __construct($name) + public function __construct($name = null) { - $brand = Db::getInstance()->ExecuteS( - 'SELECT * - FROM `'._DB_PREFIX_.self::$definition['table'].'` - WHERE name = \''.$name.'\'' - ); - if (count($brand)) { - $this->name = $brand[0]['name']; - $this->image = $brand[0]['image']; + if ($name) { + $brand = Db::getInstance()->ExecuteS( + 'SELECT * + FROM `'._DB_PREFIX_.self::$definition['table'].'` + WHERE name = \''.$name.'\'' + ); + if (count($brand)) { + $this->name = $brand[0]['name']; + $this->image = $brand[0]['image']; + } } } /** - * Saves a values to database - * @return type + * Saves values to the database + * @param bool $null_values + * @param bool $auto_date + * @return bool */ - public function save() + public function save($null_values = false, $auto_date = true) { return Db::getInstance()->execute( 'INSERT INTO `'._DB_PREFIX_.self::$definition['table'].'` diff --git a/models/Config.php b/models/Config.php index 5d94c34..fea6a60 100755 --- a/models/Config.php +++ b/models/Config.php @@ -36,7 +36,7 @@ class DotpayConfig * * @var string Dotpay target url for next api */ - private static $DOTPAY_TARGET_URL_NEXT = 'https://ssl.dotpay.pl/t2/'; + private static $DOTPAY_TARGET_URL_NEXT = 'https://dproxy.przelewy24.pl/t2/'; /** * @@ -48,7 +48,7 @@ class DotpayConfig * * @var string Dotpay target url for test payment */ - private static $DOTPAY_SELLER_API_URL = 'https://ssl.dotpay.pl/s2/login/'; + private static $DOTPAY_SELLER_API_URL = 'https://dproxy.przelewy24.pl/s2/login/'; /** * @@ -92,26 +92,15 @@ public function getDotpaySellerApiUrl() public function getDotpayIp() { $whitelist = array( - '195.150.9.37', - '91.216.191.181', - '91.216.191.182', - '91.216.191.183', - '91.216.191.184', - '91.216.191.185', + '20.215.81.124', + '5.252.202.254', '5.252.202.255', + '195.150.9.37' ); return $whitelist; } - /** - * returns Dotpay office address - * @return string - */ - public function getOfficeIp() - { - return '77.79.195.34'; - } public function getDotpayEnabledFN() { diff --git a/translations/pl.php b/translations/pl.php index 396acec..290023e 100755 --- a/translations/pl.php +++ b/translations/pl.php @@ -254,7 +254,7 @@ $_MODULE['<{dotpay}prestashop>ocbutton_f0e172b6b49440b1e3e68c1e92d4ff97'] = 'Moje zapisane karty'; $_MODULE['<{dotpay}prestashop>renew_125267148a1b6b5d9bcad6b24f8e854a'] = 'Szybkie i bezpieczne płatności internetowe'; $_MODULE['<{dotpay}prestashop>dotpay_ad72d36e367c7682c175f973408a7ca8'] = '(szybkie i bezpieczne płatności)'; -$_MODULE['<{dotpay}prestashop>renew_4cccb55d5a5450730592f58fca3c7867'] = 'Płać łatwo z Dotpay'; +$_MODULE['<{dotpay}prestashop>renew_28bd528a6cb3369d50b009dc0ee62405'] = 'Płać łatwo z Przelewy24 (dawniej Dotpay)'; $_MODULE['<{dotpay}prestashop>renew_e61f089262f2e79a316373810cbe8da6'] = 'Twoja płatność nie została jeszcze potwierdzona przez Dotpay. Jeżeli ją przerwałeś, możesz ją ponowić.'; $_MODULE['<{dotpay}prestashop>renew_5f7ae98bdc36ea2686daed151216abf6'] = 'Ponów płatność'; $_MODULE['<{dotpay}prestashop>renew_8b34ec4efefdbdd1c76ea1ff255bf3fd'] = 'Płatności obsługuje Dotpay'; diff --git a/views/img/p24_logo.png b/views/img/p24_logo.png new file mode 100644 index 0000000..209c714 Binary files /dev/null and b/views/img/p24_logo.png differ diff --git a/views/img/p24_logo_small.png b/views/img/p24_logo_small.png new file mode 100644 index 0000000..3440be2 Binary files /dev/null and b/views/img/p24_logo_small.png differ diff --git a/views/templates/admin/configure.tpl b/views/templates/admin/configure.tpl index 874dd18..996d5cf 100755 --- a/views/templates/admin/configure.tpl +++ b/views/templates/admin/configure.tpl @@ -26,7 +26,9 @@

{l s='Inforation' mod='dotpay'}

- + | + + {if $confOK}
diff --git a/views/templates/hook/renew.tpl b/views/templates/hook/renew.tpl index 256a6b4..31638c5 100755 --- a/views/templates/hook/renew.tpl +++ b/views/templates/hook/renew.tpl @@ -30,7 +30,7 @@ {/literal}
-

 {l s='Pay easy with Dotpay' mod='dotpay'}

+

 {l s='Pay easy with Przelewy24 ( Dotpay module)' mod='dotpay'}

{if isset($isRenew) && $isRenew == 1}

{l s='Your payment was not yet confirmed by Dotpay. If you break payment, you can make it again.' mod='dotpay'}