Comments (7)
Hi @kingjia90 here is the Stacktrace:
[2023-03-18T09:57:04.352127+01:00] request.CRITICAL: Uncaught PHP Exception Pimcore\Bundle\EcommerceFrameworkBundle\Exception\VoucherServiceException: "Token has already been used." at /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php line 140 {"exception":"[object] (Pimcore\Bundle\EcommerceFrameworkBundle\Exception\VoucherServiceException(code: 1): Token has already been used. at /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php:140)"} []
[2023-03-18T09:57:04.352301+01:00] app.ERROR: Pimcore\Bundle\EcommerceFrameworkBundle\Exception\VoucherServiceException: Token has already been used. in /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/VoucherService/TokenManager/Pattern.php:140 Stack trace:
#0 /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/VoucherService/DefaultService.php(136): Pimcore\Bundle\EcommerceFrameworkBundle\VoucherService\TokenManager\Pattern->applyToken('STUcard-AfWkb', Object(App\Ecommerce\CartManager\SessionCart), Object(App\Model\DataObject\OnlineShopOrder))
#1 /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/OrderManager/V7/OrderManager.php(744): Pimcore\Bundle\EcommerceFrameworkBundle\VoucherService\DefaultService->applyToken('STUcard-AfWkb', Object(App\Ecommerce\CartManager\SessionCart), Object(App\Model\DataObject\OnlineShopOrder))
#2 /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/OrderManager/V7/OrderManager.php(246): Pimcore\Bundle\EcommerceFrameworkBundle\OrderManager\V7\OrderManager->applyVoucherTokens(Object(App\Model\DataObject\OnlineShopOrder), Object(App\Ecommerce\CartManager\SessionCart)) #3 /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/OrderManager/V7/OrderManager.php(349): Pimcore\Bundle\EcommerceFrameworkBundle\OrderManager\V7\OrderManager->getOrCreateOrderFromCart(Object(App\Ecommerce\CartManager\SessionCart))
#4 /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/CheckoutManager/V7/CheckoutManager.php(227): Pimcore\Bundle\EcommerceFrameworkBundle\OrderManager\V7\OrderManager->recreateOrder(Object(App\Ecommerce\CartManager\SessionCart))
#5 /home/.../www/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/CheckoutManager/V7/CheckoutManager.php(247): Pimcore\Bundle\EcommerceFrameworkBundle\CheckoutManager\V7\CheckoutManager->checkIfPaymentIsPossible()
#6 /home/.../www/src/Controller/PaymentController.php(72): Pimcore\Bundle\EcommerceFrameworkBundle\CheckoutManager\V7\CheckoutManager->initOrderPayment()
#7 /home/.../www/vendor/symfony/http-kernel/HttpKernel.php(153): App\Controller\PaymentController->paymentAction(Object(Symfony\Component\HttpFoundation\Request), Object(Pimcore\Log\ApplicationLogger))
#8 /home/.../www/vendor/symfony/http-kernel/HttpKernel.php(75): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#9 /home/.../www/vendor/symfony/http-kernel/Kernel.php(202): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /home/.../www/public/index.php(35): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#11 {main} [] []
Pimcore Demo definitely throws an Error with this steps:
Configure Commercial voucher
add commercial car and voucher
Checkout until payment and start creditcard payment (but don't complete the payment)
Go Back to Cart and Change the amount to 2 (so pimcore will recreate the order)
checkout again until Payment select and click on creditcard again and it will throw an error:
from ecommerce-framework-bundle.
Thanks a lot for reporting the issue. We did not consider the issue as "Priority" or "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.
from ecommerce-framework-bundle.
Is it reproducible on the Pimcore demo?
I wasn't able to simulate, can you check if usages
of the given token is still 0?
can you also provide the screenshot of the error message (stack trace or any code/error message)?
from ecommerce-framework-bundle.
Confirming the problem.
When one step into the payment, in the backend it would create the order which logs the payment history and there the price is the already discounted as if it applied the voucher and triggers its usage.
From user perspective, going back to change the cart should be naturally possible, but i am having some concern about concurrent same one-time vouchers on these pending orders, if we trigger usage only at successfull payments. 🤔 Need digging some more on how to fix this
from ecommerce-framework-bundle.
My thoughts on this:
Finishing the original and the recreated order is most likely some unwanted scenario. It is possible though, and to make it traceable and also fixable for customer service we decided to do it that way and keeping both orders.
From that perspective, I think most reasonable fix for that would be to remove the voucher from the original order when recreating the order (and place the information in notes or version notes for traceability)?
@kingjia90 WDYT?
from ecommerce-framework-bundle.
@fashxp had some time to look into it and seems that #121 may fix it
from ecommerce-framework-bundle.
Fixed by #121
from ecommerce-framework-bundle.
Related Issues (20)
- [Pimcore 11] Exclude AdminBundle
- [Bug]: Attributes are not built yet. Is the service properly configured to set an attribute factory? / Table pimcore/object_store_ef_fd is corrupted. Please drop the table and recreate HOT 13
- [Bug]: Cannot create empty order in backend
- [Bug]: make getParam failsafe
- [Bug]: symfony/twig-bridge v6.2.8 conflicts with symfony/form v6.2.0 HOT 1
- [Improvement] [Codeception]: Update database version on the lowest dependency. HOT 1
- [Bug]: searchAttributes accessed before initialization HOT 2
- Replace usages of strftime
- [Bug]: Price filter "not implemented yet" HOT 1
- [Bug]: SelectFromMultiSelect -> trim(null) HOT 1
- [Bug]: Array to string conversion while product indexing HOT 2
- [Bug]: Pimcore 11 ecommerceframework_productindex does not migrate column name prefixes HOT 1
- [Bug]: Creating offer from cart throws error HOT 1
- [Bug]: Filter might cause Exceptions when they are not set HOT 1
- [Bug]: IndexService DefaultMysql
- [Bug]: use Carbon instead of DateTime setPaymentFinished method HOT 2
- [Bug]: quantityScale may be null in case of setting the price info quantity HOT 1
- [Bug]: Pricing Rule Brackets don't work HOT 1
- [Bug]: Cannot use a custom TrackingManager HOT 1
- [Bug]: Mismatching return type in `...\Fieldcollection\Data\FilterSelectClsStoreAttributes::getField() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecommerce-framework-bundle.