From 136fc98983ff9c50c0172c111cac019d0fdea721 Mon Sep 17 00:00:00 2001 From: Marvin-Magmodules Date: Wed, 4 Apr 2018 19:44:36 +0200 Subject: [PATCH] 1.2.1 --- Helper/General.php | 16 ++++++ Model/Mollie.php | 11 +++- README.md | 76 +++++++++++++++----------- composer.json | 2 +- etc/adminhtml/methods/banktransfer.xml | 10 ++++ etc/config.xml | 1 + etc/module.xml | 2 +- 7 files changed, 83 insertions(+), 35 deletions(-) diff --git a/Helper/General.php b/Helper/General.php index c672693839c..4896bed280f 100644 --- a/Helper/General.php +++ b/Helper/General.php @@ -33,6 +33,7 @@ class General extends AbstractHelper const XML_PATH_STATUS_PROCESSING = 'payment/mollie_general/order_status_processing'; const XML_PATH_STATUS_PENDING = 'payment/mollie_general/order_status_pending'; const XML_PATH_STATUS_PENDING_BANKTRANSFER = 'payment/mollie_methods_banktransfer/order_status_pending'; + const XML_PATH_BANKTRANSFER_DUE_DAYS = 'payment/mollie_methods_banktransfer/due_days'; const XML_PATH_INVOICE_NOTIFY = 'payment/mollie_general/invoice_notify'; const XML_PATH_LOCALE = 'payment/mollie_general/locale'; const XML_PATH_IMAGES = 'payment/mollie_general/payment_images'; @@ -427,6 +428,21 @@ public function getLocaleCode() return $locale; } + /** + * @param int $storeId + * + * @return false|string + */ + public function getBanktransferDueDate($storeId = 0) + { + $dueDays = $this->getStoreConfig(self::XML_PATH_BANKTRANSFER_DUE_DAYS, $storeId); + if ($dueDays > 0) { + $dueDate = new \DateTime(); + $dueDate->modify('+' . $dueDays . ' day'); + return $dueDate->format('Y-m-d'); + } + } + /** * List of supported local codes Mollie. * diff --git a/Model/Mollie.php b/Model/Mollie.php index 00b5ba81b15..fec3ae7e665 100644 --- a/Model/Mollie.php +++ b/Model/Mollie.php @@ -254,13 +254,14 @@ public function startTransaction(Order $order) $billingAddress = $order->getBillingAddress(); $shippingAddress = $order->getShippingAddress(); + $method = $this->mollieHelper->getMethodCode($order); $paymentData = [ 'amount' => $order->getBaseGrandTotal(), 'description' => $order->getIncrementId(), 'redirectUrl' => $this->mollieHelper->getRedirectUrl($orderId), 'webhookUrl' => $this->mollieHelper->getWebhookUrl(), - 'method' => $this->mollieHelper->getMethodCode($order), + 'method' => $method, 'issuer' => $issuer, 'metadata' => [ 'order_id' => $orderId, @@ -269,6 +270,14 @@ public function startTransaction(Order $order) 'locale' => $this->mollieHelper->getLocaleCode() ]; + if ($method == 'banktransfer') { + $banktransferData = [ + 'billingEmail' => $order->getCustomerEmail(), + 'dueDate' => $this->mollieHelper->getBanktransferDueDate($storeId) + ]; + $paymentData = array_merge($paymentData, $banktransferData); + } + if ($billingAddress) { $billingData = [ 'billingAddress' => $billingAddress->getStreetLine(1), diff --git a/README.md b/README.md index 927647efe56..56711855d3c 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,63 @@ -# Mollie Magento® 2 +![Mollie](https://www.mollie.nl/files/Mollie-Logo-Style-Small.png) -This is the official Mollie extension for Magento® 2. +# Official Magento 2.x plugin for [Mollie Payments](https://www.mollie.com/). # -## Installation +**Magento 1.x** users check out our [Mollie Magento 1 plugin](https://github.com/mollie/Magento). -### Magento® Marketplace +*** -This extension is also available on the [Magento Marketplace](https://marketplace.magento.com/mollie-magento2.html) +## Installation & Update the Mollie Payments plugin ## -### Manually +[1. Installation through Magento Marketplace](https://github.com/mollie/magento2/wiki/Installation-using-Marketplace) -1. Go to Magento® 2 root folder +[2. Installation by Composer](https://github.com/mollie/magento2/wiki/Installation-using-Composer) -2. Enter following commands to install module: +[3. Update by Composer](https://github.com/mollie/magento2/wiki/Update-through-Composer) - ``` - composer require mollie/magento2 - ``` +[- Configuration](https://github.com/mollie/magento2/wiki/Configure-the-extension) - Wait while dependencies are updated. +[- Troubleshooting](https://github.com/mollie/magento2/wiki/Troubleshooting) -3. Enter following commands to enable module: - ``` - php bin/magento module:enable Mollie_Payment - php bin/magento setup:upgrade - php bin/magento cache:clean - ``` +## About Mollie Payments ## +With Mollie, you can accept payments and donations online and expand your customer base internationally with support for all major payment methods through a single integration. No need to spend weeks on paperwork or security compliance procedures. No more lost conversions because you don’t support a shopper’s favourite payment method or because they don’t feel safe. We made our products and API expansive, intuitive, and safe for merchants, customers and developers alike. -4. If Magento® is running in production mode, deploy static content: +Mollie requires no minimum costs, no fixed contracts, no hidden costs. At Mollie you only pay for successful transactions. More about this pricing model can be found [here](https://www.mollie.com/en/pricing/). You can create an account [here](https://www.mollie.com/dashboard/signup). The Mollie Magento 2 plugin quickly integrates all major payment methods ready-made into your Magento webshop. + - ``` - php bin/magento setup:static-content:deploy - ``` +## Supported Mollie Payment Methods ## +- iDEAL -5. Enable and configure the Mollie extension in Magento® Admin under *Stores* > - *Configuration* > *Sales* > *Payment Methods* > *Mollie*. +- Creditcard -## Requirements +- CartaSi & Cartes Bancaires -1) For Magento® 2.1.x and Magento® 2.2.x +- Bancontact -2) This extension requires the [Mollie API client for PHP.](https://github.com/mollie/mollie-api-php) +- Belfius Pay Button -When using composer of installation through the Magento® Marketplace this will be installed automatically. +- ING HomePay -To install manually, enter the following command in your Magento® 2 root folder: -``` -composer require mollie/mollie-api-php -``` +- KBC/CBC-Betaalknop + +- SOFORT Banking + +- BankTransfer + +- PayPal + +- Bitcoin + +- Paysafecard + +- SEPA bank transfer + +- Giftcards + +## Configuration, FAQ and Troubleshooting ## +If you experience problems with the extension installation, setup or whenever you need more information about how to setup the Mollie Payment extension in Magento 2.x, please see our [WIKI Page](https://github.com/mollie/magento2/wiki) or sent an e-mail to [info@mollie.com](mailto:info@mollie.com) with an exact description of the problem. + + +## License ## +[BSD (Berkeley Software Distribution) License](http://www.opensource.org/licenses/bsd-license.php). +Copyright (c) 2011-2018, Mollie B.V. diff --git a/composer.json b/composer.json index a4911b39fab..5aeac809ac3 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "mollie/magento2", "description": "Mollie Payment Module for Magento 2", - "version": "1.2.0", + "version": "1.2.1", "require": { "php": "~5.6.5|7.0.2|7.0.4|~7.0.6|~7.1.0", "mollie/mollie-api-php": "^1.9.3" diff --git a/etc/adminhtml/methods/banktransfer.xml b/etc/adminhtml/methods/banktransfer.xml index 75193e29b72..3bc360d4011 100644 --- a/etc/adminhtml/methods/banktransfer.xml +++ b/etc/adminhtml/methods/banktransfer.xml @@ -28,6 +28,16 @@ 1 + + + validate-number + payment/mollie_methods_banktransfer/due_days + + + 1 + + diff --git a/etc/config.xml b/etc/config.xml index 3231d7a7e76..698effd2e4a 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -27,6 +27,7 @@ Mollie\Payment\Model\Methods\Banktransfer Banktransfer pending_payment + 14 order 0 diff --git a/etc/module.xml b/etc/module.xml index ffaba4499d0..927f8a0d47e 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,4 +1,4 @@ - +