vphat28 / stripe-module-core

1 stars 1 forks source link

Fatal error when creating invoice of order that does not have a payment yet #3

Open aadmathijssen opened 5 years ago

aadmathijssen commented 5 years ago

It is possible to trigger a fatal error by manually creating an invoice by performing the following steps:

  1. In the frontend, place an order using iDEAL or Bancontact as a payment method, but do not finish the payment (yet).
  2. In the admin, go the newly created order, click on "Invoice" and select "Capture Online" en click "Submit Invoice".

I would have expected to get an error stating that this is not yet possible. However, the following fatal error occurs:

Fatal error: Uncaught Error: Call to undefined method Magento\Framework\Exception\LocalizedException::getStripeCode() in /path/to/magento/vendor/stripeofficial/module-core/Gateway/Http/Client/ClientMock.php:208 Stack trace: #0 /path/to/magento/vendor/stripeofficial/module-ideal/Gateway/Http/Client/ClientMock.php(31): Stripeofficial\Core\Gateway\Http\Client\ClientMock->placeCaptureOnlyRequest(Array) #1 /path/to/magento/vendor/magento/module-payment/Gateway/Command/GatewayCommand.php(102): Stripeofficial\IDeal\Gateway\Http\Client\ClientMock->placeRequest(Object(Magento\Payment\Gateway\Http\Transfer)) #2 /path/to/magento/vendor/magento/module-payment/Model/Method/Adapter.php(546): Magento\Payment\Gateway\Command\GatewayCommand->execute(Array) #3 /path/to/magento/vendor/magento/module-payment/Model/Method/Adapter.php(461): Magento\Payment\Model\Method\Adapter->executeCommand('capture', Ar in /path/to/magento/vendor/stripeofficial/module-core/Gateway/Http/Client/ClientMock.php on line 208