2

I installed a new custom gateway I use via omnipay into EE2 backend, but when I go to 'Expresso Store' and click on 'Payment Gateways' to see if my payment gateway displays in the list, it gives me the following error:

Fatal error: Uncaught exception 'Omnipay\Common\Exception\RuntimeException' with message 'Class '\Omnipay\PayU\Gateway' not found' in C:\wamp\www\flook\trunk\backend\expressionengine\third_party\store\vendor\omnipay\common\src\Omnipay\Common\GatewayFactory.php

What could the problem be?

3

You need to tell Store about your new gateway in the ext. file. Use the store_payment_gateways hook and pass in the $gateways array:

public function store_payment_gateways($gateways)

Then ensure that you add your gateway to the list:

$gateways[] = 'PayU';

Include the autoloader:

$composer = require(PATH_THIRD.'store/autoload.php');

And tell Composer where to find your gateway:

$composer->add('Omnipay', __DIR__);

Putting it all together it should look something like this as a single method:

public function store_payment_gateways($gateways)
{
    // Language file?
    ee()->lang->loadfile('store_payu');

    // Add the new gateway to Store's known list
    $gateways[] = 'PayU';

    // Tell Store where to find the class files
    $composer = require(PATH_THIRD.'store/autoload.php');
    $composer->add('Omnipay', __DIR__);

    return $gateways;
}
| improve this answer | |
  • 1
    Oh my goodness - I misspelt Omnipay - I had it as Onmipay. OOOPS. This is why programming is so much fun.... – heinkasner Jun 12 '14 at 14:26
  • Ha, yeah those typos can take away hours of your life that you'll never get back. Glad you got it figured out. – Ian Jun 12 '14 at 16:11
0

I misspelt Omnipay (Onmipay) in my extension. Watch your spelling guys! Stupid mistake by me!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.