admin管理员组文章数量:1122846
I am trying to create Worldpay gateway with help of Worldpay library and my own extending code. Here is my code which I tried and failed to work on.
require_once('init.php');
use lib\Worldpay;
if($_POST == $_SERVER['REQUEST_METHOD']) {
//Form Submit Actions, Here i have called Worldpay class to create object.
$worldpay = new Worldpay('Key'); //line no: 25
} ?>
<script src=".js"></script>
<form action="" method="post">
</form>
I have tried to find similar question and answer. I found this. Eventhough i can't make it work, when form is submitted to the same page. Here is the error message how it looks like.
Fatal error: Class 'lib\Worldpay' not found in /var/www/wp/kvcodes/wp-content/plugins/kvcodes-worldpay/WorldPay.php on line 25
How do I fix this issue, when form is submitted.
I am trying to create Worldpay gateway with help of Worldpay library and my own extending code. Here is my code which I tried and failed to work on.
require_once('init.php');
use lib\Worldpay;
if($_POST == $_SERVER['REQUEST_METHOD']) {
//Form Submit Actions, Here i have called Worldpay class to create object.
$worldpay = new Worldpay('Key'); //line no: 25
} ?>
<script src="https://cdn.worldpay.com/v1/worldpay.js"></script>
<form action="" method="post">
</form>
I have tried to find similar question and answer. I found this. Eventhough i can't make it work, when form is submitted to the same page. Here is the error message how it looks like.
Fatal error: Class 'lib\Worldpay' not found in /var/www/wp/kvcodes/wp-content/plugins/kvcodes-worldpay/WorldPay.php on line 25
How do I fix this issue, when form is submitted.
Share Improve this question edited May 8, 2017 at 10:59 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked May 8, 2017 at 10:20 KvvaradhaKvvaradha 9363 gold badges12 silver badges24 bronze badges 2- The error indicates that the lib\Worldpay class is not included correctly - via include, require or autoloading - you need to ensure that library is available. – Q Studio Commented Jan 26, 2021 at 21:19
- its been 3 years ago i asked this question, and it was fixed and i forget the solution as well. but it was fixed. thank you for the contribution even after 3 years, you have an intention to comment about it. – Kvvaradha Commented Jan 27, 2021 at 5:48
1 Answer
Reset to default 0Have you tried:
require_once(__DIR__ .'/init.php');
本文标签: pluginsworldpay class not working with namespace in WordPress
版权声明:本文标题:plugins - worldpay class not working with namespace in WordPress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283783a1927078.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论