-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5ddbf29
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: beqa | ||
* Date: 11/13/17 | ||
* Time: 12:25 PM | ||
*/ | ||
|
||
namespace omcrn\quickbooks; | ||
|
||
|
||
use QuickBooksOnline\API\DataService\DataService; | ||
use yii\base\Component; | ||
|
||
class Quickbooks extends Component | ||
{ | ||
public $authMode = 'oauth2'; | ||
public $clientID; | ||
public $clientSecret; | ||
public $accessTokenKey; | ||
public $refreshTokenKey; | ||
public $realmID; | ||
public $baseUrl; | ||
/** | ||
* @var DataService | ||
*/ | ||
private $dataService; | ||
public $dataServiceConfig = null; | ||
|
||
|
||
public function init() | ||
{ | ||
parent::init(); | ||
if ($this->dataServiceConfig === null){ | ||
$this->dataServiceConfig = [ | ||
'auth_mode' => $this->authMode, | ||
'ClientID' => $this->clientID, | ||
'ClientSecret' => $this->clientSecret, | ||
'accessTokenKey' => $this->accessTokenKey, | ||
'refreshTokenKey' => $this->refreshTokenKey, | ||
'QBORealmID' => $this->realmID, | ||
'baseUrl' => $this->baseUrl, | ||
]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Yii2 Extension for Quickbooks | ||
============================= | ||
quickbooks online oauth2 and API wrapper for Yii2 | ||
|
||
Installation | ||
------------ | ||
|
||
The preferred way to install this extension is through [composer](http://getcomposer.org/download/). | ||
|
||
Either run | ||
|
||
``` | ||
php composer.phar require --prefer-dist omcrn/yii2-quickbooks "*" | ||
``` | ||
|
||
or add | ||
|
||
``` | ||
"omcrn/yii2-quickbooks": "*" | ||
``` | ||
|
||
to the require section of your `composer.json` file. | ||
|
||
|
||
Usage | ||
----- | ||
|
||
Once the extension is installed, simply use it in your code by : | ||
|
||
```php | ||
<?= \omcrn\quickbooks\AutoloadExample::widget(); ?>``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "omcrn/yii2-quickbooks", | ||
"description": "quickbooks online oauth2 and API wrapper for Yii2", | ||
"type": "yii2-extension", | ||
"keywords": ["yii2"," extension"," quickbooks"], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Zura Sekhniashvili", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"yiisoft/yii2": "*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"omcrn\\quickbooks\\": "" | ||
} | ||
} | ||
} |