An open API service indexing awesome lists of open source software.

https://github.com/shahariaazam/zoho-subscription

Integrate Zoho Subscription in your PHP application.
https://github.com/shahariaazam/zoho-subscription

subscription zoho

Last synced: 2 months ago
JSON representation

Integrate Zoho Subscription in your PHP application.

Awesome Lists containing this project

README

          

# PHP Library Templates

[![Code Checks](https://github.com/shahariaazam/zoho-subscription/workflows/Code-Checks/badge.svg)](https://github.com/shahariaazam/zoho-subscription/actions?query=workflow%3ACode-Checks)
[![Build](https://scrutinizer-ci.com/g/shahariaazam/zoho-subscription/badges/build.png)](https://scrutinizer-ci.com/g/shahariaazam/zoho-subscription)
[![Code Coverage](https://scrutinizer-ci.com/g/shahariaazam/zoho-subscription/badges/coverage.png)](https://scrutinizer-ci.com/g/shahariaazam/zoho-subscription)
[![Code Rating](https://scrutinizer-ci.com/g/shahariaazam/zoho-subscription/badges/quality-score.png)](https://scrutinizer-ci.com/g/shahariaazam/zoho-subscription)
[![Code Intellegence](https://scrutinizer-ci.com/g/shahariaazam/zoho-subscription/badges/code-intelligence.svg)](https://scrutinizer-ci.com/g/shahariaazam/zoho-subscription)

Integrate Zoho Subscription in your PHP application.

## Usage
```
';
$authToken = '';

$httpClient = new Client();
$apiClient = new ApiClient($authToken, $orgId, $httpClient);

$customer = new Customer();
$customer->setFirstName('John')
->setLastName('Doe')
->setDisplayName("JohnD")
->setEmail('demo@example.com');

$plan = new Plan();
$plan->setPlanCode('TS-DP1');

$subscription = new Subscription();
$subscription->setCustomer($customer);
$subscription->setPlan($plan);

try {
$zohoSubscription = new ZohoSubscription($apiClient);
$subscriptionResult = $zohoSubscription->create($subscription);
echo $subscriptionResult->getSubscriptionId();
} catch (SubscriptionException $e) {
echo $e->getMessage() . PHP_EOL;
echo $e->getCode();
}
```