简体   繁体   中英

connect Braintree php sdk with yii

How can connect Braintree php sdk with yii .I have placed my all sdk files in component folder and calling main file in controller like: include Yii::app()->basePath.'/components/braintree/lib/Braintree.php';

But this shows error to me include(Braintree_Configuration.php) : failed to open stream: No such file or directory .Can anyone help me?

Standard practise to include third party library in Yii (1.x) is to put the code under protected/vendors directory, ie protected/vendors/braintree .

Then include this file in your code like this.

Yii::import('application.vendors.*');
require_once('braintree/lib/Braintree.php');

Make sure you have provided read permissions for braintree folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM