Skip to content

Commit

Permalink
v1
Browse files Browse the repository at this point in the history
  • Loading branch information
BeycanDeveloper committed May 7, 2023
1 parent 5f3845e commit 4e550dd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor/beycanpress/freshbooks/src/token.json
vendor/beycanpress/freshbooks/src/token.json
debug.log
6 changes: 6 additions & 0 deletions app/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@

use \BeycanPress\Http\Request;
use \BeycanPress\Http\Response;
use \BeycanPress\FreshBooks\Connection;

class Api extends PluginHero\Api
{
/**
* @var Request
*/
private $request;

public function __construct()
Expand All @@ -32,6 +36,7 @@ public function __construct()
*/
public function getAccessToken()
{
/** @var Connection */
$conn = $this->callFunc('initFbConnection');

try {
Expand All @@ -52,6 +57,7 @@ public function getAccessToken()
public function refrestAuthentication()
{
try {
/** @var Connection */
$this->callFunc('initFbConnection')->refreshAuthentication();
$this->updateSetting('connected', true);
Response::success();
Expand Down
5 changes: 4 additions & 1 deletion app/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

class Loader extends PluginHero\Plugin
{
/**
* @var Connection
*/
private $conn;

public function __construct($pluginFile)
Expand All @@ -28,7 +31,7 @@ public function __construct($pluginFile)
$this->conn = new Connection(
$this->setting('clientId'),
$this->setting('clientSecret'),
home_url('/wp-json/wcfb/get-access-token')
'https://beycanpress.net/get-access-code'
);

if ($authenticate) {
Expand Down
7 changes: 7 additions & 0 deletions app/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
namespace BeycanPress\WooCommerce\FreshBooks;

use \BeycanPress\FreshBooks\Connection;
use \BeycanPress\FreshBooks\Model\Invoice;
use \BeycanPress\FreshBooks\Model\InvoiceLine;

class WooCommerce
{
use PluginHero\Helpers;

/**
* @var Connection
*/
private $conn;

/**
* @var Invoice
*/
private $invoice;

public function __construct()
Expand Down

0 comments on commit 4e550dd

Please sign in to comment.