Skip to content

Commit 2707a40

Browse files
Release 2.1.28
1 parent 5362696 commit 2707a40

File tree

17 files changed

+104
-18
lines changed

17 files changed

+104
-18
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?php
2+
/**
3+
* PostFinance Checkout Magento 2
4+
*
5+
* This Magento 2 extension enables to process payments with PostFinance Checkout (https://postfinance.ch/en/business/products/e-commerce/postfinance-checkout-all-in-one.html).
6+
*
7+
* @package PostFinanceCheckout_Payment
8+
* @author wallee AG (https://postfinance.ch/en/business/products/e-commerce/postfinance-checkout-all-in-one.html)
9+
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Software License (ASL 2.0)
10+
11+
*/
12+
namespace PostFinanceCheckout\Payment\Controller\Checkout;
13+
14+
use Magento\Framework\App\Action\Context;
15+
use Magento\Checkout\Model\Session as CheckoutSession;
16+
use Magento\Framework\App\Config\ScopeConfigInterface;
17+
use PostFinanceCheckout\Payment\Model\Service\Order\TransactionService;
18+
use Magento\Store\Model\ScopeInterface;
19+
20+
/**
21+
* Frontend controller action to handle payment page url.
22+
*/
23+
class PaymentPageUrl extends \PostFinanceCheckout\Payment\Controller\Checkout
24+
{
25+
26+
/**
27+
*
28+
* @var CheckoutSession
29+
*/
30+
private $checkoutSession;
31+
32+
/**
33+
*
34+
* @var ScopeConfigInterface
35+
*/
36+
private $scopeConfig;
37+
38+
/**
39+
*
40+
* @var TransactionService
41+
*/
42+
private $transactionService;
43+
44+
/**
45+
*
46+
* @param Context $context
47+
* @param CheckoutSession $checkoutSession
48+
* @param ScopeConfigInterface $scopeConfig
49+
* @param TransactionService $transactionService
50+
*/
51+
public function __construct(Context $context, CheckoutSession $checkoutSession,
52+
ScopeConfigInterface $scopeConfig, TransactionService $transactionService)
53+
{
54+
parent::__construct($context);
55+
$this->checkoutSession = $checkoutSession;
56+
$this->scopeConfig = $scopeConfig;
57+
$this->transactionService = $transactionService;
58+
}
59+
60+
public function execute()
61+
{
62+
$redirect = $this->resultRedirectFactory->create();
63+
$order = $this->checkoutSession->getLastRealOrder();
64+
65+
if (!$order) {
66+
$this->messageManager->addErrorMessage(__('No order found. Please try again.'));
67+
return $redirect->setPath('checkout/cart');
68+
}
69+
70+
try {
71+
$integrationMethod = $this->scopeConfig->getValue('postfinancecheckout_payment/checkout/integration_method', ScopeInterface::SCOPE_STORE, $order->getStoreId());
72+
$url = $this->transactionService->getTransactionPaymentUrl($order, $integrationMethod);
73+
$configurationId = $order->getPayment()
74+
->getMethodInstance()
75+
->getPaymentMethodConfiguration()
76+
->getConfigurationId();
77+
return $redirect->setPath($url . '&paymentMethodConfigurationId=' . (string)$configurationId);
78+
} catch (\Exception $e) {
79+
$this->messageManager->addErrorMessage(__('An error occurred while trying to redirect to payment page. Please try again.'));
80+
return $redirect->setPath('checkout/cart');
81+
}
82+
}
83+
}

Model/ApiClientHeaders.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected static function getDefaultData()
7070
self::SHOP_SYSTEM => 'magento',
7171
self::SHOP_SYSTEM_VERSION => $shop_version,
7272
self::SHOP_SYSTEM_AND_VERSION => 'magento-' . $major_version . '.' . $minor_version,
73-
self::PLUGIN_SYSTEM_VERSION => '2.1.27',
73+
self::PLUGIN_SYSTEM_VERSION => '2.1.28',
7474
];
7575
}
7676
}

Model/Checkout/ConfigProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ public function getConfig()
130130
}
131131
} else {
132132
try {
133-
$config['postfinancecheckout']['paymentPageUrl'] = $this->transactionService->getPaymentPageUrl($quote);
133+
$config['postfinancecheckout']['paymentPageUrl'] = $quote->getStore()->getUrl(
134+
'postfinancecheckout_payment/checkout/paymentPageUrl',
135+
['_secure' => true]
136+
);
134137
} catch (\Exception $e) {
135138
$this->logger->critical($e);
136139
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ This repository contains the Magento 2 extension that enables to process payment
77

88
## Requirements
99

10-
* [Magento 2](https://magento.com/) 2.4.4 to 2.4.7. For previous version, see table below
10+
* [Magento 2](https://magento.com/) 2.4.4 to 2.4.8. For previous version, see table below
1111
* [PHP](http://php.net/) version supported by the Magento version.
1212

1313
## Documentation
1414

15-
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/2.1.27/docs/en/documentation.html)
15+
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/2.1.28/docs/en/documentation.html)
1616

1717

1818
## Support
@@ -39,4 +39,4 @@ We do provide special integrations for the following one step checkouts:
3939

4040
## License
4141

42-
Please see the [license file](https://github.com/pfpayments/magento-2/blob/2.1.27/LICENSE) for more information.
42+
Please see the [license file](https://github.com/pfpayments/magento-2/blob/2.1.28/LICENSE) for more information.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"type" : "magento2-module",
19-
"version" : "2.1.27",
19+
"version" : "2.1.28",
2020
"require" : {
2121
"php" : "~7.1.3||~7.2.0||~7.3.0||~7.4.0||~8.0||~8.1||~8.2",
2222
"magento/framework" : "^102.0.0||^103.0.0",

docs/en/documentation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h2>Documentation</h2> </div>
2323
</a>
2424
</li>
2525
<li>
26-
<a href="https://github.com/pfpayments/magento-2/releases/tag/2.1.27/">
26+
<a href="https://github.com/pfpayments/magento-2/releases/tag/2.1.28/">
2727
Source
2828
</a>
2929
</li>

etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<resource>PostFinanceCheckout_Payment::config</resource>
2020
<group id="information" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
2121
<label>Information</label>
22-
<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.27/docs/en/documentation.html" target="_blank">documentation</a>.]]></comment>
22+
<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.28/docs/en/documentation.html" target="_blank">documentation</a>.]]></comment>
2323
<field id="version" translate="label" type="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
2424
<label>Module Version</label>
2525
</field>

etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<default>
1616
<postfinancecheckout_payment>
1717
<information>
18-
<version>2.1.27</version>
18+
<version>2.1.28</version>
1919
<sdk_version>4.8.0</sdk_version>
2020
</information>
2121
<general>

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
-->
1414
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
15-
<module name="PostFinanceCheckout_Payment" setup_version="2.1.27">
15+
<module name="PostFinanceCheckout_Payment" setup_version="2.1.28">
1616
<sequence>
1717
<module name="Magento_Sales"/>
1818
<module name="Magento_Payment"/>

i18n/de_CH.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"Hold Delivery","Lieferung halten"
5252
"ID required","ID erforderlich"
5353
"When a refund request is in a pending state, update its status to successful", "Wenn die Rückerstattung aussteht, markieren Sie sie als erfolgreich"
54-
"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.27/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.27/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
54+
"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.28/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.28/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
5555
"Inactive","Inaktiv"
5656
"Information","Informationen"
5757
"Invoice","Rechnung"

0 commit comments

Comments
 (0)