Skip to content

Commit

Permalink
Merge pull request #899 from mollie/release-6.1.1
Browse files Browse the repository at this point in the history
Release 6.1.1
  • Loading branch information
JevgenijVisockij authored Apr 4, 2024
2 parents d9055d7 + d421d21 commit 25e608a
Show file tree
Hide file tree
Showing 16 changed files with 686 additions and 516 deletions.
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

# Changelog #

## Changes in release 6.1.1 ##
+ Updated translations for Dutch, German, English and French languages
+ Added credit card translations for Italian and Spanish languages
+ Fixed issue where fatal exception was thrown in case of ps accounts version being too low
+ Fixed issue where in case of familyName error from mollie 502 was returned instead of 400
+ Fixed issue with credit card iframe not translating errors


## Changes in release 6.1.0 ##
+ New payment methods: Twint, Blik and Klarna
+ Added PrestaShop CloudSync support
Expand Down
15 changes: 10 additions & 5 deletions controllers/admin/AdminMollieSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@ private function initCloudSyncAndPsAccounts(): bool
$accountsFacade = $this->module->getService('Mollie.PsAccountsFacade');
$accountsService = $accountsFacade->getPsAccountsService();
} catch (PrestaShop\PsAccountsInstaller\Installer\Exception\InstallerException $e) {
$accountsInstaller = $this->module->getService('Mollie.PsAccountsInstaller');
$accountsInstaller->install();
$accountsFacade = $this->module->getService('Mollie.PsAccountsFacade');
$accountsService = $accountsFacade->getPsAccountsService();
try {
$accountsInstaller = $this->module->getService('Mollie.PsAccountsInstaller');
$accountsInstaller->install();
$accountsFacade = $this->module->getService('Mollie.PsAccountsFacade');
$accountsService = $accountsFacade->getPsAccountsService();
} catch (Exception $e) {
$this->context->controller->errors[] = $e->getMessage();

return false;
}
}

try {
Media::addJsDef([
'contextPsAccounts' => $accountsFacade->getPsAccountsPresenter()
Expand Down
4 changes: 2 additions & 2 deletions mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct()
{
$this->name = 'mollie';
$this->tab = 'payments_gateways';
$this->version = '6.1.0';
$this->version = '6.1.1';
$this->author = 'Mollie B.V.';
$this->need_instance = 1;
$this->bootstrap = true;
Expand Down Expand Up @@ -300,7 +300,7 @@ public function hookDisplayHeader(array $params)

Media::addJsDef([
'profileId' => $profileIdProvider->getProfileId($apiClient),
'isoCode' => $this->context->language->locale,
'isoCode' => str_replace('-', '_', $this->context->language->locale),
'isTestMode' => \Mollie\Config\Config::isTestMode(),
]);
$this->context->controller->registerJavascript(
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ protected function getAccountSettingsSection($isApiKeyProvided)
'label' => $this->module->l('API Key Test', self::FILE_NAME),
'tab' => $generalSettings,
'desc' => TagsUtility::ppTags(
$this->module->l('You can find your API key in your [1]Mollie Profile[/1]; it starts with test or live.', self::FILE_NAME),
$this->module->l('You can find your API key in your [1]Mollie Profile[/1]', self::FILE_NAME),
[$this->module->display($this->module->getPathUri(), 'views/templates/admin/profile.tpl')]
),
'name' => Config::MOLLIE_API_KEY_TEST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

return 0;
}
$output->writeln('<info>Product synchronization finished</info>');
$output->writeln('<info>Translation synchronization finished</info>');

return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/OrderCreationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ class OrderCreationException extends \Exception
const ORDER_RESOURSE_IS_MISSING = 6;

const ORDER_IS_NOT_CREATED = 7;

const WRONG_FAMILY_NAME = 8;
}
2 changes: 2 additions & 0 deletions src/Handler/Exception/OrderExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function handle(Exception $e)
return new OrderCreationException($e->getMessage(), OrderCreationException::WRONG_BILLING_PHONE_NUMBER_EXCEPTION);
} elseif (strpos($e->getMessage(), 'shippingAddress.phone')) {
return new OrderCreationException($e->getMessage(), OrderCreationException::WRONG_SHIPPING_PHONE_NUMBER_EXCEPTION);
} elseif (strpos($e->getMessage(), 'billingAddress.familyName')) {
return new OrderCreationException($e->getMessage(), OrderCreationException::WRONG_FAMILY_NAME);
} elseif (strpos($e->getMessage(), 'payment.amount')) {
if (strpos($e->getMessage(), 'minimum')) {
throw new OrderCreationException($e->getMessage(), OrderCreationException::ORDER_TOTAL_LOWER_THAN_MINIMUM);
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/PaymentMethodRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function addOpenStatusPayment($cartId, $orderPayment, $transactionId, $or
'transaction_id' => pSQL($transactionId),
'bank_status' => PaymentStatus::STATUS_OPEN,
'order_id' => (int) $orderId,
'order_reference' => psql($orderReference),
'order_reference' => pSQL($orderReference),
'created_at' => ['type' => 'sql', 'value' => 'NOW()'],
]
);
Expand Down
5 changes: 3 additions & 2 deletions src/Service/MollieOrderCreationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Mollie\Config\Config;
use Mollie\DTO\OrderData;
use Mollie\DTO\PaymentData;
use Mollie\Errors\Http\HttpStatusCode;
use Mollie\Exception\OrderCreationException;
use Mollie\Handler\ErrorHandler\ErrorHandler;
use Mollie\Handler\Exception\OrderExceptionHandler;
Expand Down Expand Up @@ -66,10 +67,10 @@ public function createMollieOrder($data, MolPaymentMethod $paymentMethodObj)
$apiPayment = $this->createPayment($data, $paymentMethodObj->method);
} catch (OrderCreationException $e) {
$errorHandler = ErrorHandler::getInstance();
$errorHandler->handle($e, $e->getCode(), true);
$errorHandler->handle($e, HttpStatusCode::HTTP_BAD_REQUEST, true);
} catch (Exception $e) {
$errorHandler = ErrorHandler::getInstance();
$errorHandler->handle($e, $e->getCode(), true);
$errorHandler->handle($e, HttpStatusCode::HTTP_INTERNAL_SERVER_ERROR, true);
}
}

Expand Down
Loading

0 comments on commit 25e608a

Please sign in to comment.