创建自定义网关 - 模型问题

Create a custom gateway - model-problems

我正在尝试创建一个自定义网关,并遵循了许多不同的文档。昨天我发现了新的 Payum/Skeleton 并以此为起点并遵循该示例。 虽然我在重定向到捕获页面时遇到问题,但我得到以下两个异常:

Fatal error: Uncaught exception 'Payum\Core\Exception\RequestNotSupportedException' with message 'Request Capture{model: Identity} is not supported. Make sure the storage extension for "Payum\Core\Model\Payment" is registered to the gateway. Make sure the storage find method returns an instance by id "5678ff3e481ba". Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker.' in /home/vagrant/code/payumdibs/vendor/payum/core/Payum/Core/Exception/RequestNotSupportedException.php on line 57

Payum\Core\Exception\RequestNotSupportedException: Request Capture{model: Identity} is not supported. Make sure the storage extension for "Payum\Core\Model\Payment" is registered to the gateway. Make sure the storage find method returns an instance by id "5678ff3e481ba". Make sure the gateway supports the requests and there is an action which supports this request (The method returns true). There may be a bug, so look for a related issue on the issue tracker. in /home/vagrant/code/payumdibs/vendor/payum/core/Payum/Core/Exception/RequestNotSupportedException.php on line 57

我使用了 x-debug 并发现当调用 CaptureAction::supports 时 $request->getModel() 不是 \ArrayAccess 的实例,因此 returns false。

使用标准支付网关时一切正常,但使用自定义支付网关时却不行。

我的配置:

$payum = (new PayumBuilder())
        ->addDefaultStorages()
        ->addGatewayFactory('paypal', new \Acme\Paypal\PaypalGatewayFactory([]))
        ->addGateway('offline', [
            'factory' => 'offline',
        ])->addGateway('paypal', [
            'factory' => 'paypal',
            'sandbox' => true,
        ])->getPayum();

有谁知道出了什么问题吗?

在 Maksim Kotlyar 的评论中得到了答案。 https://github.com/Payum/Payum/issues/452