This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Desconto para pagamento à vista no cartão de crédito
- Loading branch information
Showing
81 changed files
with
2,760 additions
and
259 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* Copyright © Wirecard Brasil. All rights reserved. | ||
* | ||
* @author Bruno Elisei <[email protected]> | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Moip\Magento2\Api\Data; | ||
|
||
/** | ||
* Interface MoipInterestInterface - Data Moip Interest. | ||
*/ | ||
interface MoipInterestInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
const MOIP_INTEREST_AMOUNT = 'moip_interest_amount'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
const BASE_MOIP_INTEREST_AMOUNT = 'base_moip_interest_amount'; | ||
|
||
/** | ||
* Get Installment for Moip Interest. | ||
* | ||
* @return float | ||
*/ | ||
public function getInstallmentForInterest(); | ||
|
||
/** | ||
* Set Installment for Moip Interest. | ||
* | ||
* @param float $moipInterest | ||
* | ||
* @return void | ||
*/ | ||
public function setInstallmentForInterest($moipInterest); | ||
} |
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,32 @@ | ||
<?php | ||
/** | ||
* Copyright © Wirecard Brasil. All rights reserved. | ||
* | ||
* @author Bruno Elisei <[email protected]> | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Moip\Magento2\Api; | ||
|
||
/** | ||
* Interface for saving the checkout moip interest to the quote for orders. | ||
* | ||
* @api | ||
*/ | ||
interface GuestMoipInterestManagementInterface | ||
{ | ||
/** | ||
* Set in the moip interest amount per installment number. | ||
* | ||
* @param string $cartId | ||
* @param \Moip\Magento2\Api\Data\MoipInterestInterface $installment | ||
* | ||
* @return string | ||
*/ | ||
public function saveMoipInterest( | ||
$cartId, | ||
\Moip\Magento2\Api\Data\MoipInterestInterface $installment | ||
); | ||
} |
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,32 @@ | ||
<?php | ||
/** | ||
* Copyright © Wirecard Brasil. All rights reserved. | ||
* | ||
* @author Bruno Elisei <[email protected]> | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Moip\Magento2\Api; | ||
|
||
/** | ||
* Interface for saving the checkout moip interest to the quote for orders. | ||
* | ||
* @api | ||
*/ | ||
interface MoipInterestManagementInterface | ||
{ | ||
/** | ||
* Set in the moip interest amount per installment number. | ||
* | ||
* @param int $cartId | ||
* @param \Moip\Magento2\Api\Data\MoipInterestInterface $installment | ||
* | ||
* @return string | ||
*/ | ||
public function saveMoipInterest( | ||
$cartId, | ||
\Moip\Magento2\Api\Data\MoipInterestInterface $installment | ||
); | ||
} |
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,69 @@ | ||
<?php | ||
/** | ||
* Copyright © Wirecard Brasil. All rights reserved. | ||
* | ||
* @author Bruno Elisei <[email protected]> | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Moip\Magento2\Block\Adminhtml\Sales\Order\Creditmemo; | ||
|
||
use Magento\Framework\DataObject; | ||
use Magento\Framework\View\Element\Template; | ||
|
||
/** | ||
* Class Totals - Creditmemo. | ||
*/ | ||
class Totals extends Template | ||
{ | ||
/** | ||
* Get data (totals) source model. | ||
* | ||
* @return DataObject | ||
*/ | ||
public function getSource() | ||
{ | ||
return $this->getParentBlock()->getSource(); | ||
} | ||
|
||
/** | ||
* Get Creditmemo. | ||
* | ||
* @return creditmemo | ||
*/ | ||
public function getCreditmemo() | ||
{ | ||
return $this->getParentBlock()->getCreditmemo(); | ||
} | ||
|
||
/** | ||
* Initialize payment moip_interest totals. | ||
* | ||
* @return $this | ||
*/ | ||
public function initTotals() | ||
{ | ||
$this->getParentBlock(); | ||
$this->getCreditmemo(); | ||
$this->getSource(); | ||
|
||
if (!$this->getSource()->getMoipInterestAmount()) { | ||
return $this; | ||
} | ||
|
||
$moip_interest = new DataObject( | ||
[ | ||
'code' => 'moip_interest', | ||
'strong' => false, | ||
'value' => $this->getSource()->getMoipInterestAmount(), | ||
'label' => __('Moip Interest Amount'), | ||
] | ||
); | ||
|
||
$this->getParentBlock()->addTotalBefore($moip_interest, 'grand_total'); | ||
|
||
return $this; | ||
} | ||
} |
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,68 @@ | ||
<?php | ||
/** | ||
* Copyright © Wirecard Brasil. All rights reserved. | ||
* | ||
* @author Bruno Elisei <[email protected]> | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Moip\Magento2\Block\Adminhtml\Sales\Order\Invoice; | ||
|
||
use Magento\Framework\DataObject; | ||
use Magento\Framework\View\Element\Template; | ||
|
||
/** | ||
* Class Totals - Invoice. | ||
*/ | ||
class Totals extends Template | ||
{ | ||
/** | ||
* Get data (totals) source model. | ||
* | ||
* @return DataObject | ||
*/ | ||
public function getSource() | ||
{ | ||
return $this->getParentBlock()->getSource(); | ||
} | ||
|
||
/** | ||
* Get Invoice data. | ||
* | ||
* @return invoice | ||
*/ | ||
public function getInvoice() | ||
{ | ||
return $this->getParentBlock()->getInvoice(); | ||
} | ||
|
||
/** | ||
* Initialize payment moip_interest totals. | ||
* | ||
* @return $this | ||
*/ | ||
public function initTotals() | ||
{ | ||
$this->getParentBlock(); | ||
$this->getInvoice(); | ||
$this->getSource(); | ||
|
||
if (!$this->getSource()->getMoipInterestAmount()) { | ||
return $this; | ||
} | ||
|
||
$total = new DataObject( | ||
[ | ||
'code' => 'moip_interest', | ||
'value' => $this->getSource()->getMoipInterestAmount(), | ||
'label' => __('Moip Interest Amount'), | ||
] | ||
); | ||
|
||
$this->getParentBlock()->addTotalBefore($total, 'grand_total'); | ||
|
||
return $this; | ||
} | ||
} |
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 | ||
/** | ||
* Copyright © Wirecard Brasil. All rights reserved. | ||
* | ||
* @author Bruno Elisei <[email protected]> | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Moip\Magento2\Block\Adminhtml\Sales\Order; | ||
|
||
use Magento\Framework\DataObject; | ||
use Magento\Framework\View\Element\Template; | ||
use Magento\Sales\Model\Order; | ||
|
||
/** | ||
* Class Totals - Invoice. | ||
*/ | ||
class Totals extends Template | ||
{ | ||
/** | ||
* Retrieve current order model instance. | ||
* | ||
* @return Order | ||
*/ | ||
public function getOrder() | ||
{ | ||
return $this->getParentBlock()->getOrder(); | ||
} | ||
|
||
/** | ||
* Get Source. | ||
* | ||
* @return source | ||
*/ | ||
public function getSource() | ||
{ | ||
return $this->getParentBlock()->getSource(); | ||
} | ||
|
||
/** | ||
* @return $this | ||
*/ | ||
public function initTotals() | ||
{ | ||
$this->getParentBlock(); | ||
$this->getOrder(); | ||
$this->getSource(); | ||
|
||
if (!$this->getSource()->getMoipInterestAmount() || (int) $this->getSource()->getMoipInterestAmount() === 0) { | ||
return $this; | ||
} | ||
|
||
$total = new DataObject( | ||
[ | ||
'code' => 'moip_interest', | ||
'value' => $this->getSource()->getMoipInterestAmount(), | ||
'label' => __('Moip Interest Amount'), | ||
] | ||
); | ||
$this->getParentBlock()->addTotalBefore($total, 'grand_total'); | ||
|
||
return $this; | ||
} | ||
} |
Oops, something went wrong.