davidjeddy / yii2-paypal
The PayPal extension for the Yii2 framework, forked from Marcio Camello's original work.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 928
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 41
Open Issues: 0
Type:yii2-extension
Requires
- php: ^5
- ext-curl: *
- ext-json: *
- paypal/rest-api-sdk-php: ^1
- yiisoft/yii2: ^2
This package is auto-updated.
Last update: 2020-06-05 09:29:33 UTC
README
PayPal extension for the Yii2
PayPal payment module extension for Yii 2.x
Installation
Add the dependancy to your project via composer (recommended)
composer require --prefer-dist davidjeddy/yii2-paypal "*"
OR"davidjeddy/yii2-paypal": "dev-master"
and runcomposer update
Configuration
'paypal'=> [ 'class' => 'davidjeddy\Paypal', 'clientId' => 'you_client_id', 'clientSecret' => 'you_client_secret', 'isProduction' => false, // These properties would be found in the Paypal sdk_config.ini 'config' => [ 'http.ConnectionTimeOut' => 30, 'http.Retry' => 1, 'mode' => \davidjeddy\Paypal::MODE_SANDBOX, // development (sandbox) or production (live) mode 'log.LogEnabled' => YII_DEBUG ? 1 : 0, 'log.FileName' => '@runtime/logs/paypal.log', 'log.LogLevel' => \davidjeddy\Paypal::LOG_LEVEL_FINE, ] ],
Usage
Class Someclass { ... /** * [pay description] * * @param array $paramData [description] * @return [type] [description] */ private function pay(array $paramData) { $paypalComponent = new Paypal(); try { return $paypalComponent->execTransaction($paramData); } catch (Exception $ex) { echo PaypalError($e); } return flase; } ... }