找不到Hashmode Stripe CakePHP插件库

时间:2016-06-20 07:21:40

标签: php cakephp plugins stripe-payments

我遇到了CakePHP插件的问题

错误:
    “找不到条带化PHP库。请确保它已在app / Vendor / stripe目录中解压缩。可以从https://stripe.com/docs/libraries下载”

if (!class_exists('Stripe\Stripe')) {
        throw new CakeException('Stripe PHP Library not found. Be sure it is unpacked in app/Vendor/stripe directory.
                                It can be downloaded from https://stripe.com/docs/libraries');
    }

https://github.com/hashmode/CakePHP-Stripe-Component-Full

使用CakePHP 2.9

条纹3.14

Stripe.php的路径是app \ Vendor \ stripe \ lib \ Stripe.php

我在控制器中包括如下

public $components = array('Paginator', 'Stripe');

打电话
$this->Stripe->createCustomer();

1 个答案:

答案 0 :(得分:0)

组件文件中存在错误,声明了错误的路径。 在StripeComponent.php第4行中,替换

$path = $base . 'lib' . str_replace('Stripe\\', DS, $class) . '.php';

$path = $base . 'stripe' . DS . 'lib' . str_replace('Stripe\\', DS, $class) . '.php';

它应该开始工作了。