-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from FatchipRobert/MAG2-14-Payolution
MAG2-14 - Added Payolution invoice, debit and installments
- Loading branch information
Showing
61 changed files
with
4,724 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2016 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Api; | ||
|
||
interface AddresscheckInterface | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2017 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Api\Data; | ||
|
||
interface AddresscheckResponseInterface | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2017 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Api\Data; | ||
|
||
interface InstallmentPlanResponseInterface | ||
{ | ||
/** | ||
* Returns if the installment plan request was a success | ||
* | ||
* @return bool | ||
*/ | ||
public function getSuccess(); | ||
|
||
/** | ||
* Returns errormessage | ||
* | ||
* @return string | ||
*/ | ||
public function getErrormessage(); | ||
|
||
/** | ||
* Return rendered installment plan | ||
* | ||
* @return string | ||
*/ | ||
public function getInstallmentPlanHtml(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2017 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Api; | ||
|
||
interface InstallmentPlanInterface | ||
{ | ||
/** | ||
* PAYONE addresscheck | ||
* The full class-paths must be given here otherwise the Magento 2 WebApi | ||
* cant handle this with its fake type system! | ||
* | ||
* @param string $birthday | ||
* @param string $email | ||
* @return \Payone\Core\Service\V1\Data\InstallmentPlanResponse | ||
*/ | ||
public function getInstallmentPlan($birthday, $email = false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2017 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Block\Info; | ||
|
||
class ClearingReference extends Base | ||
{ | ||
/** | ||
* Prepare credit card related payment info | ||
* | ||
* @param \Magento\Framework\DataObject|array $transport | ||
* @return \Magento\Framework\DataObject | ||
*/ | ||
protected function _prepareSpecificInformation($transport = null) | ||
{ | ||
if (null !== $this->_paymentSpecificInformation) { | ||
return $this->_paymentSpecificInformation; | ||
} | ||
$transport = parent::_prepareSpecificInformation($transport); | ||
$data = []; | ||
|
||
$sTransId = $this->getInfo()->getLastTransId(); | ||
if ($sTransId == '') { | ||
$data[(string)__('Payment has not been processed yet.')] = ''; | ||
} else { | ||
$oStatus = $this->getAppointedStatus(); | ||
if ($oStatus->getClearingBankcode()) { | ||
$data[(string)__('Please transfer the order amount to this bank account:')] = ''; | ||
$data[(string)__('Accountholder:')] = $oStatus->getClearingBankaccountholder(); | ||
$data[(string)__('Accountnumber:')] = $oStatus->getClearingBankaccount(); | ||
$data[(string)__('Bank code:')] = $oStatus->getClearingBankcode(); | ||
$data[(string)__('IBAN:')] = $oStatus->getClearingBankiban(); | ||
$data[(string)__('BIC:')] = $oStatus->getClearingBankbic(); | ||
$data[(string)__('Bank:')] = $oStatus->getClearingBankname(); | ||
} | ||
$data[(string)__('Payone Transaction ID:')] = $sTransId; | ||
$data[(string)__('Payment reference:')] = $this->getInfo()->getOrder()->getPayoneClearingReference(); | ||
} | ||
return $transport->setData(array_merge($data, $transport->getData())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?php | ||
|
||
/** | ||
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Payone | ||
* @package Payone_Magento2_Plugin | ||
* @author FATCHIP GmbH <[email protected]> | ||
* @copyright 2003 - 2017 Payone GmbH | ||
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License | ||
* @link http://www.payone.de | ||
*/ | ||
|
||
namespace Payone\Core\Block\Payolution; | ||
|
||
use Magento\Framework\View\Element\Template\Context; | ||
|
||
/** | ||
* Block-class for Payolution InstallmentPlan Ajax-call | ||
*/ | ||
class InstallmentPlan extends \Magento\Framework\View\Element\Template | ||
{ | ||
/** | ||
* Constructor | ||
* | ||
* @param Context $context | ||
* @param array $data | ||
*/ | ||
public function __construct(Context $context, array $data = []) { | ||
parent::__construct($context, $data); | ||
$this->setTemplate('payolution/installment_plan.phtml'); | ||
} | ||
|
||
/** | ||
* Format price | ||
* | ||
* @param double $dPrice | ||
* @return string | ||
*/ | ||
public function formatPrice($dPrice) | ||
{ | ||
return number_format($dPrice, 2, ',', ''); | ||
} | ||
|
||
/** | ||
* Generate installment selection text | ||
* | ||
* @param array $aInstallment | ||
* @return string | ||
*/ | ||
public function getSelectLinkText($aInstallment) | ||
{ | ||
$sText = $this->formatPrice($aInstallment['installment']['1']['amount']).' '; | ||
$sText .= $aInstallment['currency'].' '; | ||
$sText .= __('per month').' - '; | ||
$sText .= $aInstallment['duration'].' '; | ||
$sText .= __('installments'); | ||
return $sText; | ||
} | ||
|
||
/** | ||
* Generate payment info text | ||
* | ||
* @param string $sKey | ||
* @param array $aInstallment | ||
* @param array $aPayment | ||
* @return string | ||
*/ | ||
public function getPaymentInfoText($sKey, $aInstallment, $aPayment) | ||
{ | ||
$sAmount = $this->formatPrice($aPayment['amount']); | ||
$sDate = date('d.m.Y', strtotime($aPayment['due'])); | ||
|
||
$sText = $sKey.'. '.__('Installment').': '; | ||
$sText .= $sAmount.' '.$aInstallment['currency'].' '; | ||
$sText .= '('.__('due').' '.$sDate.')'; | ||
return $sText; | ||
} | ||
|
||
/** | ||
* Return download link for installment draft contract | ||
* | ||
* @param int $iInstallments | ||
* @return string | ||
*/ | ||
public function getDraftDownloadLink($iInstallments) | ||
{ | ||
return $this->getUrl('payone/payolution/draftDownload/duration/'.$iInstallments); | ||
} | ||
} |
Oops, something went wrong.