1

I am trying to integrate a payment gateway (PayU) to an ExpressionEngine2 website. I have created the payment gateway extension and believe I have the required code to execute the payment.

When I do the checkout and I reach the credit card payment stage and clicking on 'Pay', I get the following error: Fatal error: Class 'Omnipay\PayU\Message\SoapVar' not found in C:\wamp\www\flook\trunk\backend\expressionengine\third_party\store_payu\Omnipay\PayU\Message\PurchaseRequest.php on line 182

I have also tried to use the SimpleXMLElement() object in php, but get the same error (SimpleXMLElement not found in...). It's as if objects may not be used within this PurchaseRequest class.

I have activated the php_soap extension in my wamp server and restarted it, but still get the same error. Is there perhaps something else I am missing?

1

These errors are caused by PHP namespaces. Because your gateway is in the Omnipay\PayU\Message\ namespace, if you call new SimpleXMLElement() then PHP will look for the Omnipay\PayU\Message\SimpleXMLElement class, which obviously doesn't exist.

To prevent this error, you either need to add use SimpleXMLElement; at the top of your PHP file, or you can add a single backslash at the beginning of the class name (e.g. new \SimpleXMLElement().

For more information, see PHP Namespaces Overview.

| improve this answer | |
  • Also you might need to uncomment the line: extension=php_openssl.dll in the php.ini file – heinkasner Jun 26 '14 at 14:30

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.