Y
Y
Yuriy2018-01-19 12:44:31
Yii
Yuriy, 2018-01-19 12:44:31

Yii how to connect extension paypal?

Good afternoon!
Tell me how to connect rest-api-sdk-php in Yii v1? https://github.com/paypal/PayPal-PHP-SDK
Added to composer in extensions folder

{
    "require": {
        "paypal/rest-api-sdk-php": "*"
    }
}

Updated composer update
Installed here:
protected/extensions/vendor/paypal/rest-api-sdk-php/

in main.php config
added
'import'=>array(
            'application.models.*',
            'application.components.*',
            'application.extensions.*',
            'application.extensions.PayPal.*'
  ),

I write in my controller:
...
$apiContext = new \PayPal\Rest\ApiContext(
...

I get an error:
Fatal error: Class 'PayPal\Rest\ApiContext' not found in /var/DEV/www/est.loc/web/protected/controllers/AccountController.php on line 26

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Sergovantsev, 2018-01-25
@malenkiy_rak

Did not work from the first version, but:
www.yiiframework.com/doc/guide/1.1/en/extension.in...
Here is the path to the extension: protected/vendors/Zend/Search/Lucene.php
PayPal: protected/ extensions/vendor/paypal/rest-api-sdk-php/
Next, at the very beginning of the file containing the controller class, add the line:

Yii::import('application.vendors.*');
require_once('Zend/Search/Lucene.php');

That is, you need
But it is not exactly :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question