Skip to content

Commit abb01a2

Browse files
author
root
committed
Release 2.1.0
1 parent fd66188 commit abb01a2

17 files changed

+112
-17
lines changed

Model/Webhook/Listener/Transaction/AuthorizedCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public function execute($entity, Order $order)
6363
$payment->registerAuthorizationNotification($entity->getAuthorizationAmount());
6464

6565
if ($entity->getState() != TransactionState::FULFILL) {
66-
$order->setState(Order::STATE_PROCESSING);
67-
$order->addStatusToHistory('processing_postfinancecheckout',
66+
$order->setState(Order::STATE_PAYMENT_REVIEW);
67+
$order->addStatusToHistory('pending',
6868
\__('The order should not be fulfilled yet, as the payment is not guaranteed.'));
6969
}
7070

Model/Webhook/Listener/Transaction/FulfillCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function execute($entity, Order $order)
5656
$payment = $order->getPayment();
5757
$payment->setIsTransactionApproved(true);
5858
$payment->update(false);
59-
} elseif ($order->getStatus() == 'processing_postfinancecheckout') {
59+
} elseif ($order->getStatus() == 'processing') {
6060
$order->setState(Order::STATE_PROCESSING);
6161
$order->addStatusToHistory(true, \__('The order can be fulfilled now.'));
6262
}

Model/Webhook/Listener/Transaction/VoidedCommand.php

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use Magento\Sales\Api\OrderRepositoryInterface;
1414
use Magento\Sales\Model\Order;
15+
use PostFinanceCheckout\Sdk\Model\TransactionState;
1516

1617
/**
1718
* Webhook listener command to handle voided transactions.
@@ -51,6 +52,12 @@ public function execute($entity, Order $order)
5152
$invoice->cancel();
5253
$order->addRelatedObject($invoice);
5354
}
55+
56+
if ($entity->getState() == TransactionState::VOIDED) {
57+
$order->setState(Order::STATE_CANCELED);
58+
$order->addStatusToHistory('canceled',
59+
\__('The order has been canceled.'));
60+
}
5461
$this->orderRepository->save($order);
5562
}
5663
}

Model/Webhook/Listener/TransactionInvoice/CaptureCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function execute($entity, Order $order)
9191
}
9292

9393
if ($transaction->getState() == TransactionState::COMPLETED) {
94-
$order->setStatus('processing_postfinancecheckout');
94+
$order->setStatus('processing');
9595
}
9696

9797
if ($isOrderInReview) {

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This repository contains the Magento 2 extension that enables to process payment
1212

1313
## Documentation
1414

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

1717

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

3131
## License
3232

33-
Please see the [license file](https://github.com/pfpayments/magento-2/blob/2.0.9/LICENSE) for more information.
33+
Please see the [license file](https://github.com/pfpayments/magento-2/blob/2.1.0/LICENSE) for more information.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?php
2+
namespace PostFinanceCheckout\Payment\Setup\Patch\Data;
3+
use \Magento\Framework\Setup\Patch\DataPatchInterface;
4+
use \Magento\Framework\Setup\Patch\PatchVersionInterface;
5+
use \Magento\Framework\Module\Setup\Migration;
6+
use \Magento\Framework\Setup\ModuleDataSetupInterface;
7+
8+
9+
/**
10+
* Class AddSetupData
11+
* @package PostFinanceCheckout\Payment\Setup\Patch\Data
12+
*/
13+
14+
class AddSetupDataStateProcessing implements DataPatchInterface
15+
{
16+
private $status;
17+
protected $moduleDataSetup;
18+
19+
/**
20+
*
21+
* @param \PostFinanceCheckout\Payment\Model\Author $status
22+
* @param \Magento\Framework\Setup\ModuleDataSetupInterface $moduleDataSetup
23+
*/
24+
25+
public function __construct(
26+
\Magento\Sales\Model\Order\Status $status,
27+
ModuleDataSetupInterface $moduleDataSetup
28+
) {
29+
$this->status = $status;
30+
$this->moduleDataSetup = $moduleDataSetup;
31+
}
32+
33+
34+
/**
35+
* It will create and remove some status/states.
36+
* We've rolled back the first patch, which means we're using the processing status again.
37+
* Also I'm making sure we're setting processing, shipped_postfinancecheckout and pending_payment as default.
38+
* @return:none
39+
*/
40+
41+
public function apply()
42+
{
43+
$statuses = array(
44+
array('status' => 'pending', 'label' => 'Hold Delivery')
45+
);
46+
47+
foreach ($statuses as $statusData) {
48+
$this->status->addData($statusData);
49+
$this->status->getResource()->save($this->status);
50+
$this->status->assignState('pending', 'pending', true);
51+
}
52+
53+
$tableName = $this->moduleDataSetup->getTable('sales_order_status_state');
54+
$updateSql = "UPDATE " . $tableName . " SET is_default = 1, visible_on_front = 0 WHERE status = 'pending_payment'";
55+
$this->moduleDataSetup->getConnection()->query($updateSql);
56+
57+
$tableName = $this->moduleDataSetup->getTable('sales_order_status_state');
58+
$updateSql = "UPDATE " . $tableName . " SET state = 'shipped_postfinancecheckout', is_default = 1 WHERE status = 'shipped_postfinancecheckout'";
59+
$this->moduleDataSetup->getConnection()->query($updateSql);
60+
61+
$tableName = $this->moduleDataSetup->getTable('sales_order_status_state');
62+
$updateSql = "UPDATE " . $tableName . " SET state = 'processing', is_default = 1 WHERE status = 'processing'";
63+
$this->moduleDataSetup->getConnection()->query($updateSql);
64+
65+
$stateToRemove = 'processing_postfinancecheckout';
66+
$status = $this->status->load($stateToRemove);
67+
68+
if ($status->getStatus()) {
69+
$this->status->getResource()->delete($status);
70+
}
71+
}
72+
73+
/**
74+
* @return array:
75+
*/
76+
77+
public static function getDependencies(){
78+
return [];
79+
}
80+
81+
/**
82+
* @return array:
83+
*/
84+
85+
public function getAliases(){
86+
return [];
87+
}
88+
}

composer.json

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

docs/en/documentation.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
2222
</a>
2323
</li>
2424
<li>
25-
<a href="https://github.com/pfpayments/magento-2/releases/tag/2.0.9/">
25+
<a href="https://github.com/pfpayments/magento-2/releases/tag/2.1.0/">
2626
Source
2727
</a>
2828
</li>

etc/adminhtml/system.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<resource>PostFinanceCheckout_Payment::config</resource>
1919
<group id="information" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
2020
<label>Information</label>
21-
<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.0.9/docs/en/documentation.html" target="_blank">documentation</a>.]]></comment>
21+
<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.0/docs/en/documentation.html" target="_blank">documentation</a>.]]></comment>
2222
<field id="version" translate="label" type="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
2323
<label>Module Version</label>
2424
</field>

etc/config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<default>
1515
<postfinancecheckout_payment>
1616
<information>
17-
<version>2.0.9</version>
17+
<version>2.1.0</version>
1818
<sdk_version>3.2.0</sdk_version>
1919
</information>
2020
<general>

etc/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
-->
1313
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
14-
<module name="PostFinanceCheckout_Payment" setup_version="2.0.9">
14+
<module name="PostFinanceCheckout_Payment" setup_version="2.1.0">
1515
<sequence>
1616
<module name="Magento_Sales"/>
1717
<module name="Magento_Payment"/>

i18n/de_DE.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Geschenkverpackung"
5151
"Hold Delivery","Lieferung halten"
5252
"ID required","ID erforderlich"
53-
"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.0.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.0.9/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
53+
"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.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.0/docs/en/documentation.html"" target=""_blank"">Dokumentation</a> an."
5454
"Inactive","Inaktiv"
5555
"Information","Informationen"
5656
"Invoice","Rechnung"

i18n/en_US.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Gift Wrap"
5151
"Hold Delivery","Hold Delivery"
5252
"ID required","ID required"
53-
"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.0.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.0.9/docs/en/documentation.html"" target=""_blank"">documentation</a>."
53+
"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.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.0/docs/en/documentation.html"" target=""_blank"">documentation</a>."
5454
"Inactive","Inactive"
5555
"Information","Information"
5656
"Invoice","Invoice"

i18n/fr_CH.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Papier cadeau"
5151
"Hold Delivery","Suspendre la livraison"
5252
"ID required","Pièce d'identité requise"
53-
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/2.0.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.0.9/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
53+
"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.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.0/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
5454
"Inactive","Inactif"
5555
"Information","Information"
5656
"Invoice","Facture"

i18n/fr_FR.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Papier cadeau"
5151
"Hold Delivery","Suspendre la livraison"
5252
"ID required","Pièce d'identité requise"
53-
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/2.0.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.0.9/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
53+
"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.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.0/docs/en/documentation.html"" target=""_blank"">documentation</a> an."
5454
"Inactive","Inactif"
5555
"Information","Information"
5656
"Invoice","Facture"

i18n/it_CH.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Confezione regalo"
5151
"Hold Delivery","Sospendi la consegna"
5252
"ID required","ID richiesto"
53-
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/2.0.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.0.9/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
53+
"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.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.0/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
5454
"Inactive","Inattivo"
5555
"Information","Informazione"
5656
"Invoice","Fattura"

i18n/it_IT.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"Gift Wrap","Confezione regalo"
5151
"Hold Delivery","Sospendi la consegna"
5252
"ID required","ID richiesto"
53-
"If you need help setting up the wallee extension, check out the <a href=""https://plugin-documentation.postfinance-checkout.ch/pfpayments/magento-2/2.0.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.0.9/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
53+
"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.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.0/docs/en/documentation.html"" target=""_blank"">documentazione</a> an."
5454
"Inactive","Inattivo"
5555
"Information","Informazione"
5656
"Invoice","Fattura"

0 commit comments

Comments
 (0)