craftcms / commerce-omnipay

Omnipay gateway bridge for Craft Commerce
MIT License
5 stars 6 forks source link

Call to undefined method Omnipay\Mollie\Message\CompletePurchaseResponse::isPending() #4

Closed boboldehampsink closed 5 years ago

boboldehampsink commented 5 years ago
Jan 17 06:44:06 q-line app/web.1: 2019-01-17 15:44:05 [163.158.172.153][1][a179971aeec8d20c462b880c9912db2f][error][Error] Error: Call to undefined method Omnipay\Mollie\Message\CompletePurchaseResponse::isPending() in /app/vendor/craftcms/commerce-omnipay/src/base/RequestResponse.php:46 
Jan 17 06:44:06 q-line app/web.1: Stack trace: 
Jan 17 06:44:06 q-line app/web.1: #0 /app/vendor/craftcms/commerce/src/services/Payments.php(366): craft\commerce\omnipay\base\RequestResponse->isProcessing() 
Jan 17 06:44:06 q-line app/web.1: #1 /app/vendor/craftcms/commerce/src/controllers/PaymentsController.php(352): craft\commerce\services\Payments->completePayment(Object(craft\commerce\models\Transaction), '') 
Jan 17 06:44:06 q-line app/web.1: #2 [internal function]: craft\commerce\controllers\PaymentsController->actionCompletePayment() 
Jan 17 06:44:06 q-line app/web.1: #3 /app/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array) 
Jan 17 06:44:06 q-line app/web.1: #4 /app/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array) 
Jan 17 06:44:06 q-line app/web.1: #5 /app/vendor/craftcms/cms/src/web/Controller.php(104): yii\base\Controller->runAction('complete-paymen...', Array) 
Jan 17 06:44:06 q-line app/web.1: #6 /app/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('complete-paymen...', Array) 
Jan 17 06:44:06 q-line app/web.1: #7 /app/vendor/craftcms/cms/src/web/Application.php(284): yii\base\Module->runAction('commerce/paymen...', Array) 
Jan 17 06:44:06 q-line app/web.1: #8 /app/vendor/craftcms/cms/src/web/Application.php(548): craft\web\Application->runAction('commerce/paymen...', Array) 
Jan 17 06:44:06 q-line app/web.1: #9 /app/vendor/craftcms/cms/src/web/Application.php(268): craft\web\Application->_processActionRequest(Object(craft\web\Request)) 
Jan 17 06:44:06 q-line app/web.1: #10 /app/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request)) 
Jan 17 06:44:06 q-line app/web.1: #11 /app/web/index.php(22): yii\base\Application->run() 
Jan 17 06:44:06 q-line app/web.1: #12 {main} 
boboldehampsink commented 5 years ago

I found that the isPending() method is not available in the used omnipay/common package (2.3.3). This was only added in 2.4.0, see https://github.com/thephpleague/omnipay-common/commit/3d7fd40754220063c9191f31393d2f2b63cd0d4e

boboldehampsink commented 5 years ago

Can't seem to upgrade to omnipay/common 2.4+ due to composer constraints, so here's a workaround that fixes this issue: #5

boboldehampsink commented 5 years ago

@andris-sevcenko was hoping to have an interesting discussion with you about this ;-)

andris-sevcenko commented 5 years ago

@boboldehampsink just pinged you on discord :)

boboldehampsink commented 5 years ago

Upgrading to Omnipay 3 doesn't seem to fix this issue. The omnipay-mollie package also does not implement isPending() but does implement the very similar isOpen(). I've updated this package to pick that up.

andris-sevcenko commented 5 years ago

How come updating to Omnipay v3 didn't fix this? https://github.com/thephpleague/omnipay-common/blob/v3.0.0/src/Common/Message/AbstractResponse.php#L75

boboldehampsink commented 5 years ago

Sorry, my conclusion was that the omnipay-mollie never implements isPending().

In #5 I assume that omnipay-mollie's isOpen() is somewhat the same thing. Yesterday I found out that it isn't quite te same. So with the upgrade to Omnipay 3 this issue can be closed.

andris-sevcenko commented 5 years ago

Closing this, then.