diff --git a/src/Contracts/ZoopPlans.php b/src/Contracts/ZoopPlans.php new file mode 100644 index 0000000..de4ab46 --- /dev/null +++ b/src/Contracts/ZoopPlans.php @@ -0,0 +1,49 @@ +APIResource = $APIResource; + } + + /** + * @param array $post + * @return mixed + */ + public function create($post = []){ + $api = 'plans'; + return $this->APIResource->createAPI($api, $post); + } + + /** + * @param string $planID + * @param array $post + * @return mixed + */ + public function update($planID, $post){ + $api = 'plans/' . $planID; + return $this->APIResource->updateAPI($api, $post); + } + + /** + * @param string $planID + * @return mixed + */ + public function delete($planID){ + $api = 'plans/' . $planID; + return $this->APIResource->deleteAPI($api); + } + + /** + * @param string $planID + * @return mixed + */ + public function get($planID){ + $api = 'plans/' . $planID; + return $this->APIResource->searchAPI($api); + } + + /** + * @return mixed + */ + public function getAll(){ + $api = 'plans'; + return $this->APIResource->searchAPI($api); + } +} \ No newline at end of file diff --git a/src/ZoopServiceProvider.php b/src/ZoopServiceProvider.php index f054067..83d07d2 100644 --- a/src/ZoopServiceProvider.php +++ b/src/ZoopServiceProvider.php @@ -13,6 +13,7 @@ use Zoop\Lib\ZoopSplitTransactions; use Zoop\Lib\ZoopTokens; use Zoop\Lib\ZoopTransfers; +use Zoop\Lib\ZoopPlans; class ZoopServiceProvider extends ServiceProvider { @@ -65,6 +66,10 @@ public function register(){ $this->app->singleton('ZoopTransfers', function () use ($service) { return new ZoopTransfers(APIResource::getSingleton($service)); }); + + $this->app->singleton('ZoopPlans', function () use ($service) { + return new ZoopPlans(APIResource::getSingleton($service)); + }); } /** @@ -78,7 +83,8 @@ public function provides(){ ZoopChargesCNP::class, ZoopSellers::class, ZoopTokens::class, - ZoopTransfers::class + ZoopTransfers::class, + ZoopPlans::class ]; }