-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add public method to get facade and get IPP Instance to Batch Sync
- Loading branch information
Luis F. Gonzalez
committed
Nov 8, 2019
1 parent
520845b
commit b583a46
Showing
8 changed files
with
176 additions
and
46 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
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
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,33 @@ | ||
<?php | ||
namespace LifeOnScreen\LaravelQuickBooks\Facades; | ||
|
||
use QuickBooksOnline\API\Facades\FacadeHelper; | ||
|
||
/** | ||
* Provisional Facade while is incorporated in QuickBooksOnline Package | ||
* Class PaymentMethod | ||
* @package LifeOnScreen\LaravelQuickBooks\Facades | ||
*/ | ||
class PaymentMethod{ | ||
|
||
public static function create(array $data, $throwException = TRUE){ | ||
if(!isset($data) || empty($data)) throw new \Exception("Passed array for creating PaymentMethod is Empty"); | ||
$PaymentObject = FacadeHelper::reflectArrayToObject("PaymentMethod", $data, $throwException ); | ||
return $PaymentObject; | ||
} | ||
|
||
/** | ||
* This is an immutable function | ||
*/ | ||
public static function update($objToUpdate, array $data){ | ||
$classOfObj = get_class($objToUpdate); | ||
if(strcmp($classOfObj, FacadeHelper::simpleAppendClassNameSpace("PaymentMethod")) != 0){ | ||
throw new \Exception("Target object class:{" . $classOfObj . "} is not an instance of PaymentMethod."); | ||
} | ||
$newPaymentObj = Payment::create($data); | ||
$clonedOfObj = FacadeHelper::cloneObj($objToUpdate); | ||
FacadeHelper::mergeObj($clonedOfObj, $newPaymentObj); | ||
return $clonedOfObj; | ||
} | ||
|
||
} |
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
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
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
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,23 @@ | ||
<?php | ||
|
||
namespace LifeOnScreen\LaravelQuickBooks\Resources; | ||
|
||
use LifeOnScreen\LaravelQuickBooks\QuickBooksResource; | ||
use LifeOnScreen\LaravelQuickBooks\Facades as QuickBooksFacades; | ||
|
||
class PaymentMethod extends QuickBooksResource | ||
{ | ||
/** | ||
* The name of this resource. | ||
* | ||
* @var string | ||
*/ | ||
protected $name = 'PaymentMethod'; | ||
|
||
/** | ||
* QuickBooks Online API Facade | ||
* | ||
* @var string | ||
*/ | ||
protected $facade = QuickBooksFacades\PaymentMethod::class; | ||
} |
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