Site icon Hip-Hop Website Design and Development

worldpay class not working with namespace in WordPress

I’m making an attempt to create Worldpay gateway with assist of Worldpay library and my very own extending code. Right here is my code which I attempted and didn’t work on.

require_once('init.php');

use libWorldpay;

if($_POST == $_SERVER['REQUEST_METHOD']) {
    //Type Submit Actions, Right here i've known as Worldpay class to create object.
 $worldpay = new Worldpay('Key');   //line no:  25
}  ?>
<script src="https://cdn.worldpay.com/v1/worldpay.js"></script>
<type  motion="" methodology="put up"> 


</type>

I’ve tried to search out related query and reply. I discovered this. Eventhough i am unable to make it work, when type is submitted to the identical web page. Right here is the error message the way it seems like.

Deadly error: Class ‘libWorldpay’ not present in /var/www/wp/kvcodes/wp-content/plugins/kvcodes-worldpay/WorldPay.php on line 25

How do I repair this problem, when type is submitted.