Skip to content

Commit

Permalink
Option to limit the methods for Admin Paymentlink
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin-Magmodules committed Dec 20, 2018
1 parent 0cf3a43 commit 403731f
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/code/community/Mollie/Mpm/Model/Client/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public function startTransaction(Mage_Sales_Model_Order $order)
$orderData['payment']['dueDate'] = $this->mollieHelper->getBanktransferDueDate($storeId);
}

if (isset($additionalData['limited_methods'])) {
$orderData['method'] = $additionalData['limited_methods'];
}

$orderData = $this->mollieHelper->validateOrderData($orderData);
$this->mollieHelper->addTolog('request', $orderData);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,33 @@
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2
*/
?>
<?php $_code=$this->getMethodCode() ?>
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
<?php $_code = $this->getMethodCode() ?>
<ul id="payment_form_<?= $_code ?>" style="display:none">
<?= $this->__('Create a Mollie Payment link and add this to the order email.'); ?>
<ul class="inner-form">
<li>
<label for="<?= $_code ?>_methods"><?= $this->__('Limit to the following method(s)') ?>:</label>
<div class="input-box">
<select id="<?= $_code ?>_methods" name="limited_methods[]" multiple>
<option value="bancontact">Bancontact</option>
<option value="banktransfer">Banktransfer</option>
<option value="belfius">Belfius</option>
<option value="bitcoin">Bitcoin</option>
<option value="creditcard">Creditcard</option>
<option value="eps">EPS</option>
<option value="giftcard">Giftcard</option>
<option value="giropay">Giropay</option>
<option value="ideal">iDEAL</option>
<option value="inghomepay">ING Homepay</option>
<option value="kbc">KBC/CBC</option>
<option value="klarnapaylater">Klarna Pay Later</option>
<option value="klarnasliceit">Klarna Slice It</option>
<option value="paypal">Paypal</option>
<option value="paysafecard">Paysafecard</option>
<option value="sofort">Sofort</option>
</select>
</div>
<p><?= $this->__('If one method is chosen, it will skip the selection screen and the customer is sent directly to the payment method.'); ?></p>
</li>
</ul>
</ul>
21 changes: 21 additions & 0 deletions skin/adminhtml/default/default/mollie/mpm/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,25 @@ a.mollie-tooltip:hover span {
height: 30px;
display: -webkit-inline-box;
float: left;
}

#mollie_paymentlink_methods {
width: 300px;
border: 0px;
min-height: 260px;
padding: 5px;
border: 1px solid #D6D6D6;
display: block;
}

#payment_form_mollie_paymentlink label {
color: black;
font-weight: normal;
}

#payment_form_mollie_paymentlink p {
margin-top: 10px;
color: #333D46;
font-weight: lighter;
line-height: normal;
}

0 comments on commit 403731f

Please sign in to comment.