thephpleague / omnipay

A framework agnostic, multi-gateway payment processing library for PHP 5.6+
http://omnipay.thephpleague.com/
MIT License
5.92k stars 928 forks source link

Error after updating(`composer update`) Omnipay #379

Open karlpatrickespiritu opened 8 years ago

karlpatrickespiritu commented 8 years ago

I'm using ExpressoStore in EE which uses Omnipay as a payment library. And tried to update the omnipay by running composer update.

Fatal error: Call to undefined method Omnipay\Common\Item::getCode() in [My server path]system\expressionengine\third_party\store\vendor\omnipay\paypal\src\Message\AbstractRequest.php on line 308

I used paypal with this transaction. Or maybe this should be an omnipay/paypal issue? hmmn :disappointed:

barryvdh commented 8 years ago

It should use this Item: https://github.com/thephpleague/omnipay-paypal/blob/master/src/PayPalItem.php Not sure why it has the wrong item, could be a problem with ExpressoStore.

judgej commented 8 years ago

Just had this issue creating a new driver - the Item needed to be customised to add some new properties required by the gateway. It helps if the plugin either uses default values for the missing properties in the standard Item, or throws an exception so you know it does not support the default OmniPay Item. Just making the assumption that the extended Item will be used is probably not so helpful, especially as the interface effectively says that it does support it.