From 313bc48975a03768465e3b2050b73fc9e0adad49 Mon Sep 17 00:00:00 2001 From: SudiptoChoudhury Date: Mon, 16 Jul 2018 19:05:08 +0530 Subject: [PATCH] ### 0.0.8 - Release help documentation --- CHANGELOG.md | 5 +++- README.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d3df0b..c7c2c08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,4 +22,7 @@ - Generate and update cleaner documentation ### 0.0.7 -- Generate and update cleaner documentation \ No newline at end of file +- Generate and update cleaner documentation + +### 0.0.8 +- Release help documentation \ No newline at end of file diff --git a/README.md b/README.md index cced329..757291f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,86 @@ # php-zoho-subscriptions +[![Latest Stable Version](https://poser.pugx.org/sudiptochoudhury/php-zoho-subscriptions/version)](https://packagist.org/packages/sudiptochoudhury/php-zoho-subscriptions) +[![Latest Unstable Version](https://poser.pugx.org/sudiptochoudhury/php-zoho-subscriptions/v/unstable)](//packagist.org/packages/sudiptochoudhury/php-zoho-subscriptions) +[![License](https://poser.pugx.org/sudiptochoudhury/php-zoho-subscriptions/license)](https://packagist.org/packages/sudiptochoudhury/php-zoho-subscriptions) +[![Total Downloads](https://poser.pugx.org/sudiptochoudhury/php-zoho-subscriptions/downloads)](https://packagist.org/packages/sudiptochoudhury/php-zoho-subscriptions) +[![composer.lock available](https://poser.pugx.org/sudiptochoudhury/php-zoho-subscriptions/composerlock)](https://packagist.org/packages/sudiptochoudhury/php-zoho-subscriptions) + + Zoho Subscriptions API Client for PHP +```php + +use SudiptoChoudhury\Zoho\Subscriptions\Api; + +... + +$subscriptions = new Api([ + 'authtoken' => '<>', // https://accounts.zoho.com/apiauthtoken/nb/create + 'zohoOrgId' => '<>', + ]); + + +$resultJson = $subscriptions->addCustomer($data); // create a customer + +$resultJson = $subscriptions->addSubscription($data); // create a subscription + +``` + + +## Installation + + + +### Requirements + +- Any flavour of PHP 7.0+ should do + + + +### Install With Composer + +You can install the library via [Composer](http://getcomposer.org) by adding the following line to the +**require** block of your *composer.json* file (replace dev-master with latest stable version): + +```` +"sudiptochoudhury/php-zoho-subscriptions": "dev-master" +```` + +or run the following command: + +```` +composer require sudiptochoudhury/php-zoho-subscriptions +```` + + + +## Setting up + +All you need to do is to retrieve from your Zoho account and set the AuthToken and Organization ID in the constructor. +````php +new Api([ + 'authtoken' => '<>', // https://accounts.zoho.com/apiauthtoken/nb/create + 'zohoOrgId' => '<>', +]); +```` + + + +## How to use + +Next, call the desired method from the table given below. In some methods you may need to pass parameters. The parameters +are to be passed as an associative array. The required list of parameters can be found in the parameters column of the +table or you may get more details going to the original Zoho Subscription API documentation. + +Examples: +````php +$resultJson = $subscriptions->getOrganizations(); + +$resultJson = $subscriptions->addCustomer(['display_name'=> 'Sudipto Choudhury', 'email'=> 'mail@sudipto.net']); // create a customer + +```` + ### Available API Methods | Method & Endpoint | Parameters | Description |