Download the PHP package chemistrymarketing/zoho-subscriptions-sdk without Composer
On this page you can find all versions of the php package chemistrymarketing/zoho-subscriptions-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chemistrymarketing/zoho-subscriptions-sdk
More information about chemistrymarketing/zoho-subscriptions-sdk
Files in chemistrymarketing/zoho-subscriptions-sdk
Package zoho-subscriptions-sdk
Short Description Zoho Subscriptions SDK
License MIT
Informations about the package zoho-subscriptions-sdk
Zoho Subscriptions PHP SDK
Partial PHP SDK for Zoho Subscriptions
Usage
To instantiate a client, use the static build
method with your organisation ID and Auth token from Zoho.
Customers
If you're creating a customer, most of the customer data is not technically required (except the email address), so we have setter methods to add it when it is provided:
You can add custom fields to customers like so:
Then when you're ready to save the customer, you send it to the method in the client, which returns the customer ID:
Customer Addresses
adding an address to a customer requires you to create Address objects:
then you can add it to the billing address or the shipping address on the customer before sending the request:
Hosted Page: Subscriptions
Creating a subscription is, at it's simplest, a case of creating a Subscription entity and sending it to the client:
This creates a hosted page, and returns the URL which your user needs to be redirected to in order to complete their subscription.
You can optionally add a redirect url to the subscription before you send the request to let Zoho know where to send the user after the order has been completed:
Regions
Zoho Subscriptions are available in different regions, which have different URL's to access the API.
To change to the EU region, you can use the setApiRegionEU()
method on the Client
class, and change it back with the setApiRegionCOM()
Creating new API methods
I have currently only created API classes for the functionality that is needed for the current project I am working on.
If you need anything else, you can easily do so by implementing the ZohoSubscription\Contracts\Requestable
interface and
optionally using the ZohoSubscription\Partials\HasRequestables
trait, for example this is a very basic Payment API implementation:
which you could build up and pass to the client's send
method.