aaronkaa/ccpclient

There is no license information available for the latest version (dev-master) of this package.

Cloud Commerce Pro API Client for Laravel

dev-master 2019-03-11 11:25 UTC

This package is not auto-updated.

Last update: 2024-11-13 20:41:51 UTC


README

Cloud Commerce Pro API Client for Laravel

This package is in its very early stages but will be added to frequently, feel free to get in touch to make suggestions and all pull requests are welcome.

Getting Started

Install with composer

composer require aaronkaa/ccpclient

Publish the config with :

php artisan vendor:publish

Add your 'brand_id' and 'hash' to config/ccpapi.php file and that should be everything set.

Usage

At the minute, each seperate service has its own object :

use AKaa\CCPClient\Client\ProductClient;
use AKaa\CCPClient\Client\ProductRangeClient;
use AKaa\CCPClient\Client\ProductOptionClient;
use AKaa\CCPClient\Client\OrderClient;
use AKaa\CCPClient\Client\PaymentClient;
use AKaa\CCPClient\Client\CustomerClient;

To use the API, get an instance of the service youd like to use

$productClient = new ProductClient();

$result = $productClient->getProductByID(12345);

The current return from this would be the standard response from CCP with a top level result object (ie. 'getProductByManufacturerSKUResult' from getProductByManufacturerSKU) and 'Success', 'ErrorLevel', 'Content' and 'Errors' below this.