Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin-Magmodules committed Apr 4, 2018
1 parent e2b46f7 commit 136fc98
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 35 deletions.
16 changes: 16 additions & 0 deletions Helper/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.
*
Expand Down
11 changes: 10 additions & 1 deletion Model/Mollie.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand Down
76 changes: 44 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
10 changes: 10 additions & 0 deletions etc/adminhtml/methods/banktransfer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@
<field id="active">1</field>
</depends>
</field>
<field id="due_days" translate="label" type="text" sortOrder="4" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>Due Days</label>
<frontend_class>validate-number</frontend_class>
<config_path>payment/mollie_methods_banktransfer/due_days</config_path>
<comment><![CDATA[The number of days after which the payment should expire. Please note: Minimum is 1 and the maximum is 100.]]></comment>
<depends>
<field id="active">1</field>
</depends>
</field>
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="96" showInDefault="1"
showInWebsite="1" showInStore="1">
<label>Payment from Applicable Countries</label>
Expand Down
1 change: 1 addition & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<model>Mollie\Payment\Model\Methods\Banktransfer</model>
<title>Banktransfer</title>
<order_status_pending>pending_payment</order_status_pending>
<due_days>14</due_days>
<payment_action>order</payment_action>
<allowspecific>0</allowspecific>
<instructions></instructions>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mollie_Payment" setup_version="1.2.0" />
<module name="Mollie_Payment" setup_version="1.2.1" />
</config>

0 comments on commit 136fc98

Please sign in to comment.