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

Version 2.8 dicompile error - Omise\Payment\Controller\Cards\DeleteAction #211

Closed
BrainTurner opened this issue Jul 24, 2019 · 16 comments
Closed

Comments

@BrainTurner
Copy link

Hello,

Env:
Magento 2.2.7
Php 7.1.30

After updating to version 2.8 on di:complie comand we get the following error

Omise\Payment\Controller\Cards\DeleteAction
Extra parameters passed to parent construct: $customerSession. File: /var/www/schmidt.co.th/web/vendor/omise/omise-magento/Controller/Cards/DeleteAction.php

Also not sure if its due to the dicompile error but when i choose internet banking i an not redirected to the banks page. Instead i am redirected to the Magento 2 My Account Page??

Please advise. We have been waiting along time to reactive internet banking

@jacstn
Copy link
Contributor

jacstn commented Jul 24, 2019

Thanks for this bug report, let me assist you here.

Did you try to do first:
php bin/magento setup:upgrade
?

@BrainTurner
Copy link
Author

BrainTurner commented Jul 24, 2019 via email

@jacstn
Copy link
Contributor

jacstn commented Jul 24, 2019

Could you do me a favor please and check what happens if you don't run di-compile command.
Just run setup:upgrade command, it should automatically clean cache, and go to checkout, please.
try to make test payment with credit card.. put some wrong data, not important.

@BrainTurner
Copy link
Author

BrainTurner commented Jul 24, 2019 via email

@jacstn
Copy link
Contributor

jacstn commented Jul 24, 2019

custom shipping module as I understand, developers did this module for you? I wish to get it and debug your problem, could you share it with me? send it to my email?

@BrainTurner
Copy link
Author

BrainTurner commented Jul 25, 2019 via email

@BrainTurner
Copy link
Author

So i have found a couple of errors and will explain what happens.

Step 1: Add items to basket and click checkout
Step 2: Fill in shipping and billing info. Select shipping type
Step 3: Choose Payment Method. Select either Installments or Bank Transfer
Step 4: Choose you bank
Step 5 Click Place order.
Following error on checkout page: The "" value's type is invalid. The "int" type was expected. Verify and try again.
Error message in exception log file: ไม่มีเอนทิตีที่มี customerId = 38 {"exception":"[object] (Magento\Framework\Exception\NoSuchEntityException(code: 0): ไม่มีเอนทิตีที่มี customerId = 38 at /var/www/*********/web/vendor/magento/framework/Exception/NoSuchEntityException.php:50)"} []

Whats weird is the order is place, no payment taken and you remain on the checkout page. Shipment however not placed.
Also if you tried to click Place order again you get the following error message:
Customer Cart is not active

@jacstn
Copy link
Contributor

jacstn commented Jul 26, 2019

it looks like your session has expired..

I mean.. you left your webbrowser opened for long time before you finished order, and session expired, is that possible?
could you make sure please you are logged in as customer?
so please do test again, but this time after you login do it immediately - testing

@BrainTurner
Copy link
Author

BrainTurner commented Jul 26, 2019 via email

@BrainTurner
Copy link
Author

After turning on debug in backend the payment method sends this error when you click place order for internet banking:

jquery.storageapi.min.js:2 Uncaught TypeError: Cannot convert undefined or null to object
at Object.i (jquery.storageapi.min.js:2)
at Object.callMethod (jquery.storageapi.min.js:2)
at Object.remove (jquery.storageapi.min.js:2)
at customer-data.js:182
at Function.
.each._.forEach (underscore.js:145)
at Object.remove (customer-data.js:181)
at Object.invalidate (customer-data.js:351)
at HTMLDocument. (customer-data.js:386)
at HTMLDocument.dispatch (jquery.js:5087)
at HTMLDocument.elemData.handle (jquery.js:4895)

Following that error. I disable all javascript bundling and

omise-offsite-internetbanking-method.js:142 Uncaught TypeError: self.isPlaceOrderActionAllowed is not a function
at Object. (omise-offsite-internetbanking-method.js:142)
at fire (jquery.js:3240)
at Object.fireWith [as rejectWith] (jquery.js:3370)
at done (jquery.js:9063)
at XMLHttpRequest. (jquery.js:9303)

Hope that helps a bit more

@jacstn
Copy link
Contributor

jacstn commented Jul 26, 2019

ok.. thank you..
do you have in line 31 in file: omise-offsite-internetbanking-method.js following code:

            isPlaceOrderActionAllowed: ko.observable(quote.billingAddress() != null),

@BrainTurner
Copy link
Author

Confirmed on line 31.

Maybe this is the final key to unlocking the problem:
GET http://192.168.28.132/en/rest/en/V1/orders//omise-offsite?_=1564125581958 400 (Bad Request)

Omise2 8_internet_banking

@Renu05
Copy link

Renu05 commented Jul 29, 2019

@BrainTurner
This issue is due to the extra parameter passed in the parent construct of vendor/omise/omise-magento/Controller/Cards/DeleteAction.php.

class DeleteAction extends \Magento\Framework\App\Action\Action
{
    const WRONG_REQUEST = 1;

    const WRONG_TOKEN = 2;

    const ACTION_EXCEPTION = 3;

    /**
     * @var array
     */
    private $errorsMap = [];

    /**
     * @var Magento\Customer\Model\Session
     */
    private $customerSession;

    /**
     * @var Omise\Payment\Model\Customer
     */
    private $customer;

    /**
     * @param Context  $context
     * @param Session  $customerSession
     * @param Customer $customer
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Customer\Model\Session       $customerSession,
        \Omise\Payment\Model\Customer         $customer
    ) {
        parent::__construct($context, customerSession);

as we have extended the class by \Magento\Framework\App\Action\Action so the parent constructor parameters should be

  parent::__construct($context);

@BrainTurner
Copy link
Author

@Renu05

Thank you. That has fix the dicompile error. Shall i open a new issue for the order number not being passed for internet banking or will it be fix here?

@jacstn
Copy link
Contributor

jacstn commented Jul 30, 2019

Thank @Renu05 you for proposition how to solve this issue.

@jacstn
Copy link
Contributor

jacstn commented Jul 30, 2019

yes, @BrainTurner I think it is better to keep each of bug in a separated report.

Although I cannot reproduce it. And will need more information from you.

@jacstn jacstn closed this as completed Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants