tonioseiler / craft-commerce-wallee

Craft Commerce Payment Gateway for Wallee
Other
1 stars 0 forks source link

wallee breaks capturing manual payments #3

Closed frederik-station closed 4 months ago

frederik-station commented 4 months ago

Versions

Craft: 4.8.7 Craft Commerce: 4.5.3 Wallee: 2.3.7

We are using two payment gateways, 1. wallee for online payments and 2. the manual gateway for invoice payments. For orders using the manual gateway we need to capture the payment manually in the Craft backend but unfortunately the "Make payment" button in the Transactions tab of an order doesn't work anymore (see screenshot).

image

Looking stacktrace that get's returned by the error 500 response I see some wallee functions being called although this order has been made using the manual gateway:

[
  {
    "file": "/var/www/html/vendor/furbo/craft-commerce-wallee/src/gateways/Gateway.php",
    "line": 139,
    "function": "__set",
    "class": "yii\\base\\Component",
    "type": "->"
  },
  {
    "file": "/var/www/html/vendor/craftcms/commerce/src/controllers/OrdersController.php",
    "line": 925,
    "function": "getPaymentFormHtml",
    "class": "craft\\commerce\\wallee\\gateways\\Gateway",
    "type": "->"
  },
  {
    "function": "actionGetPaymentModal",
    "class": "craft\\commerce\\controllers\\OrdersController",
    "type": "->"
  },
  {
    "file": "/var/www/html/vendor/yiisoft/yii2/base/InlineAction.php",
    "line": 57,
    "function": "call_user_func_array"
  },
  {
    "file": "/var/www/html/vendor/yiisoft/yii2/base/Controller.php",
    "line": 178,
    "function": "runWithParams",
    "class": "yii\\base\\InlineAction",
    "type": "->"
  },
  {
    "file": "/var/www/html/vendor/yiisoft/yii2/base/Module.php",
    "line": 552,
    "function": "runAction",
    "class": "yii\\base\\Controller",
    "type": "->"
  },
  {
    "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
    "line": 341,
    "function": "runAction",
    "class": "yii\\base\\Module",
    "type": "->"
  },
  {
    "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
    "line": 642,
    "function": "runAction",
    "class": "craft\\web\\Application",
    "type": "->"
  },
  {
    "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
    "line": 303,
    "function": "_processActionRequest",
    "class": "craft\\web\\Application",
    "type": "->"
  },
  {
    "file": "/var/www/html/vendor/yiisoft/yii2/base/Application.php",
    "line": 384,
    "function": "handleRequest",
    "class": "craft\\web\\Application",
    "type": "->"
  },
  {
    "file": "/var/www/html/web/index.php",
    "line": 12,
    "function": "run",
    "class": "yii\\base\\Application",
    "type": "->"
  }
]

If I disable the wallee plugin everything works fine and I can capture the manual payment.

tonioseiler commented 4 months ago

try the latest version 2.3.9

frederik-station commented 4 months ago

Thanks for the quick reply! With the new 2.3.9 version I get a different error:

{
  "name": "PHP Warning",
  "message": "Undefined variable $html",
  "code": 2,
  "error": "Undefined variable $html",
  "exception": "yii\\base\\ErrorException",
  "file": "/var/www/html/vendor/furbo/craft-commerce-wallee/src/gateways/Gateway.php",
  "line": 163,
  "trace": [
    {
      "file": "/var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php",
      "line": 79,
      "function": "handleError",
      "class": "yii\\base\\ErrorHandler",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/furbo/craft-commerce-wallee/src/gateways/Gateway.php",
      "line": 163,
      "function": "handleError",
      "class": "craft\\web\\ErrorHandler",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/craftcms/commerce/src/controllers/OrdersController.php",
      "line": 925,
      "function": "getPaymentFormHtml",
      "class": "craft\\commerce\\wallee\\gateways\\Gateway",
      "type": "->"
    },
    {
      "function": "actionGetPaymentModal",
      "class": "craft\\commerce\\controllers\\OrdersController",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/yiisoft/yii2/base/InlineAction.php",
      "line": 57,
      "function": "call_user_func_array"
    },
    {
      "file": "/var/www/html/vendor/yiisoft/yii2/base/Controller.php",
      "line": 178,
      "function": "runWithParams",
      "class": "yii\\base\\InlineAction",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/yiisoft/yii2/base/Module.php",
      "line": 552,
      "function": "runAction",
      "class": "yii\\base\\Controller",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
      "line": 341,
      "function": "runAction",
      "class": "yii\\base\\Module",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
      "line": 642,
      "function": "runAction",
      "class": "craft\\web\\Application",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
      "line": 303,
      "function": "_processActionRequest",
      "class": "craft\\web\\Application",
      "type": "->"
    },
    {
      "file": "/var/www/html/vendor/yiisoft/yii2/base/Application.php",
      "line": 384,
      "function": "handleRequest",
      "class": "craft\\web\\Application",
      "type": "->"
    },
    {
      "file": "/var/www/html/web/index.php",
      "line": 12,
      "function": "run",
      "class": "yii\\base\\Application",
      "type": "->"
    }
  ]
}

It probably doesn't matter for this issue but we are using the Lightbox integration mode.

tonioseiler commented 4 months ago

I tried to simulate your environment with 2 gateways and for me with the latest version it works. Can you double check? Is your shop online?

frederik-station commented 4 months ago

Yes, it's working with the latest 2.3.12 version 🙌 Thanks for the quick fix, I appreciate it!