Skip to content

Commit

Permalink
Merge pull request mollie#955 from mollie/release-6.2.2
Browse files Browse the repository at this point in the history
Release 6.2.2
  • Loading branch information
GytisZum authored Jul 30, 2024
2 parents 0cb9e13 + bbb0fc1 commit 0e95a5f
Show file tree
Hide file tree
Showing 21 changed files with 90 additions and 105 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,4 @@ npm-package-install:
prepare-zip:
composer install --no-dev --optimize-autoloader --classmap-authoritative
composer dump-autoload --no-dev --optimize --classmap-authoritative
cp .github/.htaccess vendor/.htaccess
rm -rf .git .docker .editorconfig .github tests .php-cs-fixer.php Makefile cypress .docker cypress.config.js cypress.env.json docker-compose*.yml .gitignore bin codeception.yml package-lock.json package.json .php_cs.dist .php-cs-fixer.dist




rm -rf .git .docker .editorconfig .github tests .php-cs-fixer.php Makefile cypress .docker cypress.config.js cypress.env.json docker-compose*.yml .gitignore bin codeception.yml package-lock.json package.json .php_cs.dist .php-cs-fixer.dist .php-cs-fixer.dist.php
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Receive payments from European customers with ease. Mollie provides payment meth

Choose the best payment provider available for your online PrestaShop store. Create your merchant account at [Mollie.com](https://www.mollie.com/).

Mollie supports the following payment methods: iDEAL, Credit card, Bancontact, SOFORT Banking, ING Home’Pay, Bank transfers, PayPal, KBC / CBC Payment Button, Belfius, CartaSi, Cartes Bancaires, EPS, Giropay, Klarna: Pay later, Klarna: Slice it
Mollie supports the following payment methods: iDEAL, Credit card, Bancontact, SOFORT Banking, ING Home’Pay, Bank transfers, PayPal, KBC / CBC Payment Button, Belfius, CartaSi, Cartes Bancaires, EPS, Klarna: Pay later, Klarna: Slice it

[![Build Status](https://travis-ci.org/mollie/PrestaShop.svg?branch=master)](https://travis-ci.org/mollie/PrestaShop)
[![Greenkeeper badge](https://badges.greenkeeper.io/mollie/PrestaShop.svg)](https://greenkeeper.io/)
Expand Down
5 changes: 0 additions & 5 deletions README_DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ Die Karten tragen ebenfalls das Markenzeichen von Visa.

Dies macht sie zur wichtigsten Zahlungsmethode in Österreich, die bei österreichischen Konsumenten hohe Beliebtheit genießt.

### Giropay
[Giropay](https://www.mollie.com/de/payments/giropay). Giropay ist eine der beliebtesten Überweisungsmethoden Deutschlands.

Deutsche Kunden schenken dieser Zahlungsmethode ihr Vertrauen, da sie von über 1.500 Banken landesweit unterstützt wird.

### Klarna: Rechnung
[Klarna: Rechnung](https://www.mollie.com/de/payments/klarna-pay-later). Klarna ist eine flexible Zahlungslösung, die Ihren Kunden verschiedene, flexible Zahlungsmöglichkeiten zur Verfügung stellt.

Expand Down
5 changes: 0 additions & 5 deletions README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ Las tarjetas que comparten marca con Visa.

Esto hace que el EPS sea el principal tipo de pago por transferencia bancaria en Austria y muy popular entre los compradores austriacos.

### Giropay
[Giropay](https://www.mollie.com/es/payments/giropay). Giropay es un tipo de pago por transferencia bancaria, popular en Alemania.

Utiliza más de 1.500 bancos alemanes, lo que lo convierte en un tipo de pago confiable para los clientes alemanes.

### Klarna: Pay later
[Klarna: Pay later](https://www.mollie.com/es/payments/klarna-pay-later). Klarna es una solución de pago flexible que les permite a sus clientes diversas formas de pago flexibles.

Expand Down
5 changes: 0 additions & 5 deletions README_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ Les cartes sont co-marquées avec Visa.

Devenue très populaire auprès des consommateurs autrichiens, EPS est la référence en matière de virement bancaire en Autriche.

### Giropay
[Giropay](https://www.mollie.com/fr/payments/giropay). Giropay est une méthode de paiement très populaire de virement bancaire en Allemagne.

Utilisé par plus de 15000 à travers le pays, cela en fait un moyen de paiement fiable, réputé auprès des consommateurs allemands.

### Klarna : Pay later
[Klarna : Pay later](https://www.mollie.com/fr/payments/klarna-pay-later). Klarna est une solution de paiement flexible, qui permet à vos clients des modes de paiement variés.

Expand Down
5 changes: 0 additions & 5 deletions README_NL.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ De kaarten zijn co-branded met Visa.

Dit maakt EPS de belangrijkste betaalmethode voor bankoverboekingen in Oostenrijk en zeer populair bij Oostenrijkse klanten.

### Giropay
[Giropay](https://www.mollie.com/nl/payments/giropay). Giropay is een populaire bankoverboeking betaalmethode in Duitsland.

Het maakt gebruik van meer dan 1.500 Duitse banken, waardoor het een vertrouwde betaalmethode is onder Duitse klanten.

### Klarna: Achteraf betalen
[Klarna: Achteraf betalen](https://www.mollie.com/nl/payments/klarna-pay-later). Klarna is een flexibele betaaloplossing, waarmee je je klanten diverse mogelijkheden voor uitgestelde betaling biedt.

Expand Down
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.2.2 ##
+ Error handling improvements
+ Mobile phone fix then field is removed
+ Riverty, Trustly, Payconiq payment methods added and GiroPay removed
+ HTTP status
+ Dependencies version bump
+ Improved installation process

## Changes in release 6.2.1 ##
+ Ideal v2 payment method improvement

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"mollie/mollie-api-php": "v2.65.0",
"segmentio/analytics-php": "^1.5",
"sentry/sentry": "3.17.0",
"league/container": "2.5.0",
"league/container": "3.3.3",
"prestashop/module-lib-service-container": "v2.0",
"webmozart/assert": "^1.11",
"symfony/http-client": "^4.4",
Expand Down
44 changes: 28 additions & 16 deletions controllers/front/webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
*/

use Mollie\Adapter\ToolsAdapter;
use Mollie\Api\Exceptions\ApiException;
use Mollie\Controller\AbstractMollieController;
use Mollie\Errors\Http\HttpStatusCode;
use Mollie\Exception\TransactionException;
use Mollie\Handler\ErrorHandler\ErrorHandler;
use Mollie\Infrastructure\Response\JsonResponse;
use Mollie\Logger\PrestaLoggerInterface;
Expand Down Expand Up @@ -50,9 +52,6 @@ public function initContent(): void
/** @var PrestaLoggerInterface $logger */
$logger = $this->module->getService(PrestaLoggerInterface::class);

/** @var ErrorHandler $errorHandler */
$errorHandler = $this->module->getService(ErrorHandler::class);

/** @var ToolsAdapter $tools */
$tools = $this->module->getService(ToolsAdapter::class);

Expand Down Expand Up @@ -95,20 +94,12 @@ public function initContent(): void

try {
$this->executeWebhook($transactionId);
} catch (ApiException $exception) {
$this->handleException($exception, HttpStatusCode::HTTP_BAD_REQUEST, 'Api request failed');
} catch (TransactionException $exception) {
$this->handleException($exception, $exception->getCode(), 'Failed to handle transaction');
} catch (\Throwable $exception) {
$logger->error('Failed to handle webhook', [
'Exception message' => $exception->getMessage(),
'Exception code' => $exception->getCode(),
]);

$errorHandler->handle($exception, $exception->getCode(), false);

$this->releaseLock();

$this->ajaxResponse(JsonResponse::error(
$this->module->l('Failed to handle webhook', self::FILE_NAME),
$exception->getCode()
));
$this->handleException($exception, HttpStatusCode::HTTP_BAD_REQUEST, 'Failed to handle webhook');
}

$this->releaseLock();
Expand Down Expand Up @@ -158,4 +149,25 @@ private function setContext(int $cartId): void

$this->context->cart = $cart;
}

private function handleException(Throwable $exception, int $httpStatusCode, string $logMessage): void
{
/** @var PrestaLoggerInterface $logger */
$logger = $this->module->getService(PrestaLoggerInterface::class);

/** @var ErrorHandler $errorHandler */
$errorHandler = $this->module->getService(ErrorHandler::class);

$logger->error($logMessage, [
'Exception message' => $exception->getMessage(),
'Exception code' => $httpStatusCode,
]);

$errorHandler->handle($exception, $httpStatusCode, false);
$this->releaseLock();
$this->ajaxResponse(JsonResponse::error(
$this->module->l('Failed to handle webhook', self::FILE_NAME),
$httpStatusCode
));
}
}
14 changes: 1 addition & 13 deletions cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,7 @@ it('C339365: 28 Przelewy24 Checkouting [Orders API]', () => {
it('C339366: 29 Przelewy24 Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339367: 30 Giropay Checkouting [Orders API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
cy.contains('giropay').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C339368: 31 Giropay Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})

it('C339369: 32 EPS Checkouting [Orders API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
Expand Down
14 changes: 1 addition & 13 deletions cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,7 @@ it('C339391: 56 Przelewy24 Checkouting [Payments API]', () => {
it('C339392: 57 Przelewy24 BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339393: 58 Giropay Checkouting [Payments API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
cy.contains('giropay').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C339394: 59 Giropay BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});

it('C339395: 60 EPS Checkouting [Payments API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
Expand Down
13 changes: 0 additions & 13 deletions cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,6 @@ it('C339365: 28 Przelewy24 Checkouting [Orders API]', () => {
it('C339366: 29 Przelewy24 Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339367: 30 Giropay Checkouting [Orders API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
cy.contains('giropay').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C339368: 31 Giropay Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339369: 32 EPS Checkouting [Orders API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
Expand Down
13 changes: 0 additions & 13 deletions cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,6 @@ it('C339391: 56 Przelewy24 Checkouting [Payments API]', () => {
it('C339392: 57 Przelewy24 BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339393: 58 Giropay Checkouting [Payments API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
cy.contains('giropay').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C339394: 59 Giropay BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339395: 60 EPS Checkouting [Payments API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import 'cypress-iframe';
// Cypress.Commands.add("login", (email, password) => { ... })
Cypress.Commands.add("ConfOrdersAPI1784", () => {

const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "bancontact", "eps", "giropay", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik", "bancomatpay"];
const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "bancontact", "eps", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik", "bancomatpay"];

// Iterate through the paymentMethods array using forEach
paymentMethods.forEach(method => {
Expand All @@ -59,7 +59,7 @@ Cypress.Commands.add("ConfOrdersAPI1784", () => {
})
Cypress.Commands.add("ConfPaymentsAPI1784", () => {

const paymentMethods = ["giropay", "eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik", "bancomatpay"];
const paymentMethods = ["eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik", "bancomatpay"];

// Iterate through the paymentMethods array using forEach
paymentMethods.forEach(method => {
Expand Down
10 changes: 9 additions & 1 deletion mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function __construct()
{
$this->name = 'mollie';
$this->tab = 'payments_gateways';
$this->version = '6.2.1';
$this->version = '6.2.2';
$this->author = 'Mollie B.V.';
$this->need_instance = 1;
$this->bootstrap = true;
Expand Down Expand Up @@ -155,6 +155,8 @@ private function loadEnv()
*/
public function install()
{
PrestaShopLogger::addLog('Mollie install started', 1, null, 'Mollie', 1);

if (!$this->isPhpVersionCompliant()) {
$this->_errors[] = $this->l('You\'re using an outdated PHP version. Upgrade your PHP version to use this module. The Mollie module supports versions PHP 7.2.0 and higher.');

Expand All @@ -166,16 +168,20 @@ public function install()

return false;
}
PrestaShopLogger::addLog('Mollie prestashop install successful', 1, null, 'Mollie', 1);

// TODO inject base install and subscription services
$coreInstaller = $this->getService(Mollie\Install\Installer::class);
PrestaShopLogger::addLog('Mollie core install initiated', 1, null, 'Mollie', 1);

if (!$coreInstaller->install()) {
$this->_errors = array_merge($this->_errors, $coreInstaller->getErrors());

return false;
}

PrestaShopLogger::addLog('Mollie core install successful', 1, null, 'Mollie', 1);

$subscriptionInstaller = new Installer(
new DatabaseTableInstaller(),
new AttributeInstaller(
Expand All @@ -187,13 +193,15 @@ public function install()
),
new HookInstaller($this)
);
PrestaShopLogger::addLog('Mollie subscription installer initiated', 1, null, 'Mollie', 1);

if (!$subscriptionInstaller->install()) {
$this->_errors = array_merge($this->_errors, $subscriptionInstaller->getErrors());
parent::uninstall();

return false;
}
PrestaShopLogger::addLog('Mollie subscription install successful', 1, null, 'Mollie', 1);

return true;
}
Expand Down
10 changes: 8 additions & 2 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Config
'ideal' => ['nl'],
'bancontact' => ['be'],
'paypal' => [],
'giropay' => ['de'],
'eps' => ['at'],
'belfius' => ['be'],
'inghomepay' => ['be'],
Expand All @@ -64,6 +63,9 @@ class Config
'ro', 'bl', 'mf', 'pm', 'sm', 'sk', 'sl', 'es', 'se', 'ch', 'gb', 'uk',
],
'mybank' => [],
'trustly' => ['at', 'de', 'ee', 'es', 'fi', 'lt', 'lv', 'nl'],
'riverty' => ['nl', 'be', 'de', 'at'],
'payconiq' => [],
];

const SUPPORTED_PHP_VERSION = '5.6';
Expand Down Expand Up @@ -240,6 +242,7 @@ class Config
const MOLLIE_METHOD_ID_APPLE_PAY = 'applepay';
const MOLLIE_VOUCHER_METHOD_ID = 'voucher';
const MOLLIE_in3_METHOD_ID = 'in3';
const RIVERTY = 'riverty';

const MOLLIE_VOUCHER_CATEGORY_NULL = 'null';
const MOLLIE_VOUCHER_CATEGORY_MEAL = 'meal';
Expand Down Expand Up @@ -275,6 +278,7 @@ class Config
PaymentMethod::BILLIE,
self::MOLLIE_VOUCHER_METHOD_ID,
self::MOLLIE_in3_METHOD_ID,
self::RIVERTY,
];

const PAYMENT_API_ONLY_METHODS = [
Expand All @@ -301,7 +305,6 @@ class Config
'directdebit' => 'Direct Debit',
'eps' => 'EPS',
'giftcard' => 'Giftcard',
'giropay' => 'Giropay',
'ideal' => 'iDEAL',
'inghomepay' => 'ING Homepay',
'kbc' => 'KBC',
Expand All @@ -322,6 +325,9 @@ class Config
'alma' => 'Alma',
'blik' => 'BLIK',
'klarna' => 'Pay with Klarna.',
'riverty' => 'Riverty',
'payconiq' => 'Payconiq',
'trustly' => 'Trustly',
];

const MOLLIE_BUTTON_ORDER_TOTAL_REFRESH = 'MOLLIE_BUTTON_ORDER_TOTAL_REFRESH';
Expand Down
Loading

0 comments on commit 0e95a5f

Please sign in to comment.