-
Notifications
You must be signed in to change notification settings - Fork 6
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 #57 from elisei/Magento@2.4.6
PagBank 😍 Magento
- Loading branch information
Showing
38 changed files
with
1,826 additions
and
16 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,78 @@ | ||
<?php | ||
/** | ||
* PagBank Payment Magento Module. | ||
* | ||
* Copyright © 2023 PagBank. All rights reserved. | ||
* | ||
* @author Bruno Elisei <brunoelisei@o2ti.com> | ||
* @license See LICENSE for license details. | ||
*/ | ||
|
||
namespace PagBank\PaymentMagento\Block\Sales\Form; | ||
|
||
use Magento\Framework\View\Element\Template\Context; | ||
use PagBank\PaymentMagento\Gateway\Config\ConfigDeepLink; | ||
|
||
/** | ||
* Class DeepLink - Form for payment by DeepLink. | ||
*/ | ||
class DeepLink extends \Magento\Payment\Block\Form | ||
{ | ||
/** | ||
* DeepLink Form template. | ||
*/ | ||
public const TEMPLATE = 'PagBank_PaymentMagento::form/deep-link.phtml'; | ||
|
||
/** | ||
* Get relevant path to template. | ||
* | ||
* @return string | ||
*/ | ||
public function getTemplate() | ||
{ | ||
return self::TEMPLATE; | ||
} | ||
|
||
/** | ||
* @var ConfigDeepLink | ||
*/ | ||
protected $configDeepLink; | ||
|
||
/** | ||
* @param Context $context | ||
* @param ConfigDeepLink $configDeepLink | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
ConfigDeepLink $configDeepLink | ||
) { | ||
parent::__construct($context); | ||
$this->configDeepLink = $configDeepLink; | ||
} | ||
|
||
/** | ||
* Title - DeepLink. | ||
* | ||
* @return string | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->configDeepLink->getTitle(); | ||
} | ||
|
||
/** | ||
* Get Instruction. | ||
* | ||
* @param int|null $storeId | ||
* | ||
* @return Phrase | ||
*/ | ||
public function getInstruction() | ||
{ | ||
$text = $this->configDeepLink->getInstructionCheckout(); | ||
|
||
$replaceText = __($text); | ||
|
||
return $replaceText; | ||
} | ||
} |
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 | ||
/** | ||
* PagBank Payment Magento Module. | ||
* | ||
* Copyright © 2023 PagBank. All rights reserved. | ||
* | ||
* @author Bruno Elisei <brunoelisei@o2ti.com> | ||
* @license See LICENSE for license details. | ||
*/ | ||
|
||
namespace PagBank\PaymentMagento\Block\Sales\Info; | ||
|
||
use Magento\Framework\Phrase; | ||
use Magento\Payment\Block\ConfigurableInfo; | ||
|
||
/** | ||
* Class DeepLink - DeepLink payment information. | ||
*/ | ||
class DeepLink extends ConfigurableInfo | ||
{ | ||
/** | ||
* DeepLink Info template. | ||
*/ | ||
public const TEMPLATE = 'PagBank_PaymentMagento::info/deep-link/instructions.phtml'; | ||
|
||
/** | ||
* Get relevant path to template. | ||
* | ||
* @return string | ||
*/ | ||
public function getTemplate() | ||
{ | ||
return self::TEMPLATE; | ||
} | ||
|
||
/** | ||
* Returns value view. | ||
* | ||
* @param string $field | ||
* @param string $value | ||
* | ||
* @return string | Phrase | ||
*/ | ||
protected function getValueView($field, $value) | ||
{ | ||
if ($field === 'qr_code_url_image') { | ||
return $this->getImageQrCode($value); | ||
} | ||
|
||
return parent::getValueView($field, $value); | ||
} | ||
|
||
/** | ||
* Get Url to Image Qr Code. | ||
* | ||
* @param string $qrCode | ||
* | ||
* @return string | ||
*/ | ||
public function getImageQrCode($qrCode) | ||
{ | ||
return $this->_urlBuilder->getBaseUrl(['_type' => \Magento\Framework\UrlInterface::URL_TYPE_MEDIA]).$qrCode; | ||
} | ||
} |
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
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
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
Oops, something went wrong.