Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument 1 passed to Magento\Sales\Model\Order\Payment must be an instance of Magento\Framework\DataObject, none given #16184

Closed
Jakhotiya opened this issue Jun 16, 2018 · 5 comments
Assignees
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@Jakhotiya
Copy link
Contributor

$order->getPayment()->setTransactionId(null)->setParentTransactionId($response->getXTransId())->void();

Preconditions

Magento2 2.2 dev branch

Steps to reproduce

  1. Setup authorizenet
  2. Setup a plugin that uses declineOrder method of the Directpost model
  3. Checkout with authorizenet

Expected result

Order is declined

Actual result

Uncaught TypeError: Argument 1 passed to Magento\Sales\Model\Order\Payment\Interceptor::void() must be an instance of Magento\Framework\DataObject, none given.

Some points to note are

  1. void method is not part of the interface \Magento\Sales\Api\Data\OrderPaymentInterface
  2. void method is not called with any arguments in declineOrder method of Directpost Model
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jun 16, 2018
@xpoback xpoback self-assigned this Jun 17, 2018
@xpoback
Copy link
Contributor

xpoback commented Jun 17, 2018

@Jakhotiya other methods like capture(), authorize(), refund() are not in the interface as well, so this is either deliberate or just not done yet. The actual problem should now be fixed in the PR above.

@Jakhotiya
Copy link
Contributor Author

Thanks @xpoback . But I'm wondering why you passed response object to void method? More importantly how did you figure out that you have to pass response received by payment gateway.

@kkrieger85 kkrieger85 added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Jun 19, 2018
@VladimirZaets
Copy link
Contributor

Hi @Jakhotiya. Thank you for your report.
The issue has been fixed in #16194 by @xpoback in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.6 release.

@sidolov
Copy link
Contributor

sidolov commented Jul 19, 2018

Hi @Jakhotiya. Thank you for your report.
The issue has been fixed in #16801 by @gelanivishal in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.15 release.

@sidolov sidolov added the Fixed in 2.1.x The issue has been fixed in 2.1 release line label Jul 19, 2018
@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jul 19, 2018
@magento-engcom-team
Copy link
Contributor

Hi @Jakhotiya. Thank you for your report.
The issue has been fixed in #16603 by @gelanivishal in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

6 participants