Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Release 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
victoralbala committed Aug 31, 2022
1 parent db9eb4d commit eaadecf
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 19 deletions.
28 changes: 24 additions & 4 deletions Block/Method/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use PostFinanceCheckout\Payment\Helper\Data as Helper;
use PostFinanceCheckout\Payment\Helper\Document as DocumentHelper;
use PostFinanceCheckout\Payment\Helper\Locale as LocaleHelper;
use Magento\Framework\Url as UrlHelper;
use PostFinanceCheckout\Payment\Model\Provider\LabelDescriptorGroupProvider;
use PostFinanceCheckout\Payment\Model\Provider\LabelDescriptorProvider;
use PostFinanceCheckout\Sdk\Model\TransactionState;
Expand All @@ -29,6 +30,12 @@
class Info extends \Magento\Payment\Block\Info
{

/**
*
* @var urlHelper
*/
protected $urlHelper;

/**
*
* @var PriceCurrencyInterface
Expand Down Expand Up @@ -103,7 +110,7 @@ class Info extends \Magento\Payment\Block\Info
* @param array $data
*/
public function __construct(Context $context, PriceCurrencyInterface $priceCurrency, Registry $registry,
Helper $helper, LocaleHelper $localeHelper, DocumentHelper $documentHelper,
Helper $helper, LocaleHelper $localeHelper, DocumentHelper $documentHelper, UrlHelper $urlHelper,
TransactionInfoRepositoryInterface $transactionInfoRepository, LabelDescriptorProvider $labelDescriptorProvider,
LabelDescriptorGroupProvider $labelDescriptorGroupProvider, array $data = [])
{
Expand All @@ -113,6 +120,7 @@ public function __construct(Context $context, PriceCurrencyInterface $priceCurre
$this->helper = $helper;
$this->localeHelper = $localeHelper;
$this->documentHelper = $documentHelper;
$this->urlHelper = $urlHelper;
$this->transactionInfoRepository = $transactionInfoRepository;
$this->labelDescriptorProvider = $labelDescriptorProvider;
$this->labelDescriptorGroupProvider = $labelDescriptorGroupProvider;
Expand Down Expand Up @@ -203,6 +211,7 @@ public function getTransactionState()
* @param float $amount
* @return number
*/
#[\ReturnTypeWillChange]
public function formatAmount($amount)
{
//NULL was changed to 0 because PHP8.1 does not allow NULL as parameter
Expand All @@ -215,6 +224,7 @@ public function formatAmount($amount)
*
* @return string
*/
#[\ReturnTypeWillChange]
public function getTransactionUrl()
{
return \rtrim($this->_scopeConfig->getValue('postfinancecheckout_payment/general/base_gateway_url'), '/') .
Expand All @@ -227,6 +237,7 @@ public function getTransactionUrl()
*
* @return string
*/
#[\ReturnTypeWillChange]
public function getCustomerUrl()
{
return \rtrim($this->_scopeConfig->getValue('postfinancecheckout_payment/general/base_gateway_url'), '/') .
Expand All @@ -239,6 +250,7 @@ public function getCustomerUrl()
*
* @return \PostFinanceCheckout\Payment\Model\TransactionInfo|false
*/
#[\ReturnTypeWillChange]
public function getTransaction()
{
if ($this->transaction === null) {
Expand All @@ -260,9 +272,10 @@ public function getTransaction()
*
* @return string
*/
#[\ReturnTypeWillChange]
public function getInvoiceDownloadUrl()
{
return $this->getUrl('postfinancecheckout_payment/order/downloadInvoice',
return $this->urlHelper->getUrl('postfinancecheckout_payment/order/downloadInvoice',
[
'order_id' => $this->getTransaction()
->getOrderId()
Expand All @@ -274,9 +287,10 @@ public function getInvoiceDownloadUrl()
*
* @return string
*/
#[\ReturnTypeWillChange]
public function getPackingSlipDownloadUrl()
{
return $this->getUrl('postfinancecheckout_payment/order/downloadPackingSlip',
return $this->urlHelper->getUrl('postfinancecheckout_payment/order/downloadPackingSlip',
[
'order_id' => $this->getTransaction()
->getOrderId()
Expand All @@ -288,9 +302,10 @@ public function getPackingSlipDownloadUrl()
*
* @return string
*/
#[\ReturnTypeWillChange]
public function getRefundDownloadUrl()
{
return $this->getUrl('postfinancecheckout_payment/order/downloadRefund',
return $this->urlHelper('postfinancecheckout_payment/order/downloadRefund',
[
'creditmemo_id' => $this->registry->registry('current_creditmemo')
->getId()
Expand All @@ -302,6 +317,7 @@ public function getRefundDownloadUrl()
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function isInvoiceDownloadAllowed()
{
if ($this->getTransaction()) {
Expand All @@ -322,6 +338,7 @@ public function isInvoiceDownloadAllowed()
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function isPackingSlipDownloadAllowed()
{
if ($this->getTransaction()) {
Expand All @@ -342,6 +359,7 @@ public function isPackingSlipDownloadAllowed()
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function isRefundDownloadAllowed()
{
$creditmemo = $this->registry->registry('current_creditmemo');
Expand All @@ -363,6 +381,7 @@ public function isRefundDownloadAllowed()
*
* @return LabelGroup[]
*/
#[\ReturnTypeWillChange]
public function getGroupedLabels()
{
if ($this->getTransaction() && $this->getTransaction()->getLabels()) {
Expand Down Expand Up @@ -400,6 +419,7 @@ public function getGroupedLabels()
* @param array $translatedString
* @return string|NULL
*/
#[\ReturnTypeWillChange]
public function translate($translatedString)
{
return $this->localeHelper->translate($translatedString);
Expand Down
6 changes: 4 additions & 2 deletions Controller/Order/DownloadInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ public function __construct(Context $context, ForwardFactory $resultForwardFacto
$this->apiClient = $apiClient;
}

#[\ReturnTypeWillChange]
public function execute()
{
$result = $this->orderLoader->load($this->_request);
if ($result instanceof ResultInterface) {
return $result;
$redirect = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT);
return $redirect->setUrl('/sales/order/history');
}

/** @var \Magento\Sales\Model\Order $order */
Expand All @@ -114,4 +116,4 @@ public function execute()
return $this->resultForwardFactory->create()->forward('noroute');
}
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This repository contains the Magento 2.2 extension that enables to process payme

## Documentation

* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html)
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html)

## Support

Expand All @@ -28,4 +28,4 @@ We do provide special integrations for the following one step checkouts:

## License

Please see the [license file](https://github.com/pfpayments/magento-2.2/blob/1.2.9/LICENSE) for more information.
Please see the [license file](https://github.com/pfpayments/magento-2.2/blob/1.3.0/LICENSE) for more information.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"type" : "magento2-module",
"version" : "1.2.9",
"version" : "1.3.0",
"require" : {
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0|~8.0|~8.1",
"magento/framework" : "^101.0.2",
Expand Down
2 changes: 1 addition & 1 deletion docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/pfpayments/magento-2.2/releases/tag/1.2.9/">
<a href="https://github.com/pfpayments/magento-2.2/releases/tag/1.3.0/">
Source
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<resource>PostFinanceCheckout_Payment::config</resource>
<group id="information" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Information</label>
<comment><![CDATA[If you need help setting up the PostFinance Checkout extension, check out the <a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html" target="_blank">documentation</a>.]]></comment>
<comment><![CDATA[If you need help setting up the PostFinance Checkout extension, check out the <a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html" target="_blank">documentation</a>.]]></comment>
<field id="version" translate="label" type="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Module Version</label>
</field>
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<default>
<postfinancecheckout_payment>
<information>
<version>1.2.9</version>
<version>1.3.0</version>
<sdk_version>3.1.1</sdk_version>
</information>
<general>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="PostFinanceCheckout_Payment" setup_version="1.2.9">
<module name="PostFinanceCheckout_Payment" setup_version="1.3.0">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down
2 changes: 1 addition & 1 deletion i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"Gift Wrap","Geschenkverpackung"
"Hold Delivery","Lieferung halten"
"ID required","ID erforderlich"
"If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Falls Sie Hilfe benötigen beim Einrichten der PostFinance Checkout-Erweiterung, sehen Sie sich die <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
"If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Falls Sie Hilfe benötigen beim Einrichten der PostFinance Checkout-Erweiterung, sehen Sie sich die <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
"Inactive","Inaktiv"
"Information","Informationen"
"Invoice","Rechnung"
Expand Down
2 changes: 1 addition & 1 deletion i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"Gift Wrap","Gift Wrap"
"Hold Delivery","Hold Delivery"
"ID required","ID required"
"If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a>.","If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a>."
"If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a>.","If you need help setting up the PostFinance Checkout extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a>."
"Inactive","Inactive"
"Information","Information"
"Invoice","Invoice"
Expand Down
2 changes: 1 addition & 1 deletion i18n/fr_CH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"Gift Wrap","Papier cadeau"
"Hold Delivery","Suspendre la livraison"
"ID required","Pièce d'identité requise"
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
"Inactive","Inactif"
"Information","Information"
"Invoice","Facture"
Expand Down
2 changes: 1 addition & 1 deletion i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"Gift Wrap","Papier cadeau"
"Hold Delivery","Suspendre la livraison"
"ID required","Pièce d'identité requise"
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Si vous avez besoin d'aide pour configurer l'extension wallee, consultez la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
"Inactive","Inactif"
"Information","Information"
"Invoice","Facture"
Expand Down
2 changes: 1 addition & 1 deletion i18n/it_CH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"Gift Wrap","Confezione regalo"
"Hold Delivery","Sospendi la consegna"
"ID required","ID richiesto"
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
"Inactive","Inattivo"
"Information","Informazione"
"Invoice","Fattura"
Expand Down
2 changes: 1 addition & 1 deletion i18n/it_IT.csv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"Gift Wrap","Confezione regalo"
"Hold Delivery","Sospendi la consegna"
"ID required","ID richiesto"
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.2.9/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentation</a>.","Se hai bisogno di aiuto per configurare l'estensione wallee, consulta la <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2.2/1.3.0/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
"Inactive","Inattivo"
"Information","Informazione"
"Invoice","Fattura"
Expand Down

0 comments on commit eaadecf

Please sign in to comment.