Add new payment and shipping parsers for various integrations
- Implemented Google Pay parser in bongooglepay.js - Added Buckaroo 3 payment parser in buckaroo3.js - Introduced DataTrans CW Mastercard parser in datatranscw.js - Created DataTrans CW Credit Card parser in datatranscw_creditcard.js - Developed DHL Assistant shipping parser in dhlassistant.js - Added Estimated Delivery parser in estimateddelivery.js - Implemented Floapay payment parser in floapay.js - Created FS Pickup at Store shipping parser in fspickupatstore.js - Developed Generic Iframe parser in generic_iframe_parser.js - Added Geodis Officiel shipping parser in geodisofficiel.js - Implemented Glob Kurier module shipping parser in globkuriermodule.js - Created Latvija Post Express Pickup Terminal parser in latvijaspastsexpresspastspostterminalslv.js - Developed LP Shipping parser in lpshipping.js - Added Mijora Venipak parser in mijoravenipak.js - Implemented Apple Pay parser in pm_applepay.js - Created Przelewy24 payment parser in przelewy24.js - Developed Pshugls shipping parser in pshugls.js - Added Redsys Insite payment parser in redsysinsite.js - Implemented Tpay payment parser in tpay.js - Updated third-party integration documentation for FedEx DotCom
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
@@ -124,7 +128,11 @@ class CheckoutAddressForm extends AbstractForm
|
||||
}
|
||||
|
||||
if (($hookReturn = Hook::exec('actionValidateCustomerAddressForm', array('form' => $this))) !== '') {
|
||||
$is_valid &= (bool)$hookReturn;
|
||||
if ($hookReturn === null) {
|
||||
$is_valid &= true;
|
||||
} else {
|
||||
$is_valid &= (bool)$hookReturn;
|
||||
}
|
||||
}
|
||||
|
||||
// We need to call this separately due to side-effect - getting all errors at once, not only postcode error first
|
||||
@@ -188,7 +196,7 @@ class CheckoutAddressForm extends AbstractForm
|
||||
$result = $this->persister->save(
|
||||
$this->address,
|
||||
$this->getValue('token'),
|
||||
$finalConfirmation || !$this->isOpcTransientAddress($address->alias) // attach_customer_id
|
||||
$finalConfirmation || !$this->isOpcTransientAddress($address->alias) || $this->checkoutModule->config->assign_customer_id_asap // attach_customer_id
|
||||
);
|
||||
} catch (PrestaShopException $e) {
|
||||
//$e->displayMessage();
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
class CheckoutAddressFormatter implements FormFormatterInterface
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class CheckoutCustomerAddressPersister
|
||||
{
|
||||
private $customer;
|
||||
|
||||
@@ -23,8 +23,14 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use PrestaShop\PrestaShop\Core\Crypto\Hashing as Crypto;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use PrestaShop\PrestaShop\Core\Security\PasswordPolicyConfiguration;
|
||||
use ZxcvbnPhp\Zxcvbn;
|
||||
|
||||
class CheckoutCustomerForm extends AbstractForm
|
||||
{
|
||||
@@ -127,6 +133,59 @@ class CheckoutCustomerForm extends AbstractForm
|
||||
}
|
||||
}
|
||||
|
||||
// New PS 8 Password strength validation
|
||||
$passwordField = $this->getField('password');
|
||||
$guestAllowedCheckout = Configuration::get('PS_GUEST_CHECKOUT_ENABLED');
|
||||
$passwordRequired = is_string($passwordField->getValue()) &&
|
||||
(!empty($passwordField->getValue()) || !$guestAllowedCheckout);
|
||||
if (method_exists('Validate', 'isAcceptablePasswordLength') &&
|
||||
method_exists('Validate', 'isAcceptablePasswordScore') &&
|
||||
$passwordRequired) {
|
||||
if (Validate::isAcceptablePasswordLength($passwordField->getValue()) === false) {
|
||||
$passwordField->addError($this->translator->trans(
|
||||
'Password must be between %d and %d characters long',
|
||||
[
|
||||
Configuration::get(PasswordPolicyConfiguration::CONFIGURATION_MINIMUM_LENGTH),
|
||||
Configuration::get(PasswordPolicyConfiguration::CONFIGURATION_MAXIMUM_LENGTH),
|
||||
],
|
||||
'Shop.Notifications.Error'
|
||||
));
|
||||
}
|
||||
|
||||
if (Validate::isAcceptablePasswordScore($passwordField->getValue()) === false) {
|
||||
$wordingsForScore = [
|
||||
$this->translator->trans('Very weak', [], 'Shop.Theme.Global'),
|
||||
$this->translator->trans('Weak', [], 'Shop.Theme.Global'),
|
||||
$this->translator->trans('Average', [], 'Shop.Theme.Global'),
|
||||
$this->translator->trans('Strong', [], 'Shop.Theme.Global'),
|
||||
$this->translator->trans('Very strong', [], 'Shop.Theme.Global'),
|
||||
];
|
||||
$globalErrorMessage = $this->translator->trans(
|
||||
'The minimum score must be: %s',
|
||||
[
|
||||
$wordingsForScore[(int) Configuration::get(PasswordPolicyConfiguration::CONFIGURATION_MINIMUM_SCORE)],
|
||||
],
|
||||
'Shop.Notifications.Error'
|
||||
);
|
||||
if ($this->context->shop->theme->get('global_settings.new_password_policy_feature') !== true) {
|
||||
$zxcvbn = new Zxcvbn();
|
||||
$result = $zxcvbn->passwordStrength($passwordField->getValue());
|
||||
if (!empty($result['feedback']['warning'])) {
|
||||
$passwordField->addError($this->translator->trans(
|
||||
$result['feedback']['warning'], [], 'Shop.Theme.Global'
|
||||
));
|
||||
} else {
|
||||
$passwordField->addError($globalErrorMessage);
|
||||
}
|
||||
foreach ($result['feedback']['suggestions'] as $suggestion) {
|
||||
$passwordField->addError($this->translator->trans($suggestion, [], 'Shop.Theme.Global'));
|
||||
}
|
||||
} else {
|
||||
$passwordField->addError($globalErrorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($silentRegistration && Validate::isEmail($emailField->getValue())) {
|
||||
// Allow silent guest registration when email field emits blur() - called from checkEmail routine
|
||||
return true;
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
class CheckoutCustomerFormatter implements FormFormatterInterface
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use PrestaShop\PrestaShop\Core\Crypto\Hashing as Crypto;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class CheckoutFormField
|
||||
{
|
||||
private $name = '';
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
|
||||
namespace module\thecheckout;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use \Configuration;
|
||||
use \Tools;
|
||||
use \Context;
|
||||
@@ -451,6 +455,7 @@ class Config
|
||||
|
||||
public $refresh_minicart = 0;
|
||||
public $clean_checkout_session_after_confirmation = 0;
|
||||
public $assign_customer_id_asap = 0;
|
||||
|
||||
public $show_block_reassurance = 0;
|
||||
|
||||
@@ -466,10 +471,12 @@ class Config
|
||||
public $business_fields = 'company, dni, vat_number';
|
||||
public $private_fields = 'dni';
|
||||
public $business_disabled_fields = '';
|
||||
public $use_other_field_for_business_private = 0;
|
||||
public $shipping_required_fields = '';
|
||||
public $payment_required_fields = '';
|
||||
public $collapse_shipping_methods = 0;
|
||||
public $collapse_payment_methods = 0;
|
||||
public $logos_on_the_right = 1;
|
||||
public $show_shipping_country_in_carriers = 0;
|
||||
public $force_customer_to_choose_country = 0;
|
||||
public $force_customer_to_choose_carrier = 0;
|
||||
@@ -500,6 +507,8 @@ class Config
|
||||
public $smartform_client_id = '';
|
||||
public $social_login_btn_style = 'light';
|
||||
public $social_login_display_on_login_page = 0;
|
||||
public $paypal_express_checkout = 0;
|
||||
public $use_old_address_on_reorder = 0;
|
||||
|
||||
public $ps_css_cache_version;
|
||||
public $ps_js_cache_version;
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
|
||||
namespace module\thecheckout;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use Customer;
|
||||
use Validate;
|
||||
use CartRule;
|
||||
|
||||
Reference in New Issue
Block a user