Comments (5)
I think for thr addresses it's just a matter or removing the if clause. I will have to check where the setting of bankdata occurs to remove that issue, too. I will post my findings here during the next days.
from magento-2.
Thanks for your precise analysis. To save us the hassle of writing code that creates a lot of orders, can you test a workaround, where you explicitly reset the company parameter (or the entire address for that matter) and see if the issue goes away?
Thanks
Florian
from magento-2.
I looked a little deeper into the extension code and I found, that the request object itself gets injected when creating an order. Magentos DI component injects singletons so the same object is reused every time. Every parameter that was present on the last request and is ot overriden will continue to exist.
To create a blank request object for each order we have to inject a factory that creates the request object for us. These factory methods are created by Magento automatically when requested. I only tested it with AuthorizationRequest (and it works) but there is no reason the same pattern should not be applied to Debit, Capture,... as well.
To reproduce the problem and test the solution you will not have to create lots of orders. Just two in one "PHP run" will be enough.
diff --git a/Model/Methods/BaseMethod.php b/Model/Methods/BaseMethod.php
index deb08ee..89ebea1 100644
--- a/Model/Methods/BaseMethod.php
+++ b/Model/Methods/BaseMethod.php
@@ -208,7 +208,7 @@ abstract class BaseMethod extends AbstractMethod
* @param \Magento\Checkout\Model\Session $checkoutSession
* @param \Payone\Core\Model\Api\Request\Debit $debitRequest
* @param \Payone\Core\Model\Api\Request\Capture $captureRequest
- * @param \Payone\Core\Model\Api\Request\Authorization $authorizationRequest
+ * @param \Payone\Core\Model\Api\Request\AuthorizationFactory $authorizationRequestFactory
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
@@ -227,7 +227,7 @@ abstract class BaseMethod extends AbstractMethod
\Magento\Checkout\Model\Session $checkoutSession,
\Payone\Core\Model\Api\Request\Debit $debitRequest,
\Payone\Core\Model\Api\Request\Capture $captureRequest,
- \Payone\Core\Model\Api\Request\Authorization $authorizationRequest,
+ \Payone\Core\Model\Api\Request\AuthorizationFactory $authorizationRequestFactory,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
@@ -239,7 +239,7 @@ abstract class BaseMethod extends AbstractMethod
$this->checkoutSession = $checkoutSession;
$this->debitRequest = $debitRequest;
$this->captureRequest = $captureRequest;
- $this->authorizationRequest = $authorizationRequest;
+ $this->authorizationRequest = $authorizationRequestFactory->create();
}
from magento-2.
Wow, thanks :)
We'll see that we put this in one of the upcoming sprints.
from magento-2.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from magento-2.
Related Issues (20)
- when selecting credit card type showing error HOT 3
- Magento2 dont have option to map paid to processing HOT 1
- Facing multiple issue after integrate payone HOT 3
- Facing multiple issue after integrate payone HOT 1
- PayOne ApplePay compatibility with Magento Cloud HOT 2
- Adding PHP 8.2 support for Magento 2.4.6 release HOT 1
- deprecated _isScopePrivate in Totals.php HOT 3
- Credit card payment after canceling payment process still authorized and order status processing HOT 2
- Add compatibility to PHP 8.2 HOT 2
- Cannot checkout with PayPal Express HOT 6
- Version 3.8.1 : Deprecated Functionality: Function utf8_encode() HOT 8
- Version 3.8.1: Deprecated Functionality: Creation of dynamic property HOT 3
- PayPal Express Button does not respect Minimal Order Amount HOT 1
- Error 923 Payment type not available for this currency or card type Set correct currency, type of payment, type of card, type of account or portalid HOT 3
- Errorcode 1610 - probably rounding error in calculation of order amount HOT 1
- Issue with canceled orders HOT 1
- Random paypal/creditcard orders stuck in status "processing" HOT 1
- Comply with strict CSP ruling in Magento Checkout HOT 2
- Cannot modify readonly property Magento\Framework\HTTP\PhpEnvironment\RemoteAddress::$alternativeHeaders HOT 3
- Support of PHP 8.3 HOT 2
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 magento-2.