pimcore / ecommerce-framework-bundle

Ecommerce Framework community bundle provides e-commerce functionality such as product listing and filtering, pricing, carts and checkouts for Pimcore.
https://pimcore.com/docs/platform/Ecommerce_Framework/
Other
8 stars 28 forks source link

[Bug]: use Carbon instead of DateTime setPaymentFinished method #170

Closed sshehuelements closed 3 months ago

sshehuelements commented 4 months ago

Expected behavior

$providerData->setPaymentFinished(new Carbon());

Actual behavior

$providerData->setPaymentFinished(new \DateTime());

Which throws an Error:

Pimcore\Model\DataObject\Objectbrick\Data\PaymentProviderQpay::setPaymentFinished(): Argument #1 ($paymentFinished) must be of type ?Carbon\Carbon, DateTime given, called in .../vendor/pimcore/ecommerce-framework-bundle/src/OrderManager/V7/OrderAgent.php on line 321

Steps to Fix

diff --git a/src/OrderManager/V7/OrderAgent.php b/src/OrderManager/V7/OrderAgent.php
index 95e89c48..70d3d4b9 100644
--- a/src/OrderManager/V7/OrderAgent.php
+++ b/src/OrderManager/V7/OrderAgent.php
@@ -318,7 +318,7 @@ class OrderAgent implements OrderAgentInterface
         }

         if (method_exists($providerData, 'setPaymentFinished')) {
-            $providerData->setPaymentFinished(new \DateTime());
+            $providerData->setPaymentFinished(new Carbon());
         }

         if (method_exists($providerData, 'setConfigurationKey')) {
github-actions[bot] commented 3 months ago

Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

blankse commented 3 months ago

@sshehuelements I created a PR: https://github.com/pimcore/ecommerce-framework-bundle/pull/173