Download the PHP package zohaib-vaival/php-cartzy without Composer
On this page you can find all versions of the php package zohaib-vaival/php-cartzy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zohaib-vaival/php-cartzy
More information about zohaib-vaival/php-cartzy
Files in zohaib-vaival/php-cartzy
Package php-cartzy
Short Description PHP SDK for Cartzy API
License Apache-2.0
Homepage https://github.com/zohaib-vaival/php-cartzy
Informations about the package php-cartzy
PHP Cartzy SDK
PHPCartzy is a simple SDK implementation of Cartzy API. It helps accessing the API in an object oriented way.
Installation
Install with Composer
Requirements
PHPCartzy uses curl extension for handling http calls. So you need to have the curl extension installed and enabled with PHP.
However if you prefer to use any other available package library for handling HTTP calls, you can easily do so by modifying 1 line in each of the
get()
,post()
,put()
,delete()
methods inPHPCartzy\HttpRequestJson
class.
Usage
You can use PHPCartzy in a pretty simple object oriented way.
Configure CartzySDK
If you are using your own private API, provide the ApiKey and Password.
For Third party apps, use the permanent access token.
How to get the permanent access token for a shop?
There is a AuthHelper class to help you getting the permanent access token from the shop using oAuth.
1) First, you need to configure the SDK with additional parameter SharedSecret
2) Create the authentication request
The redirect url must be white listed from your app admin as one of Application Redirect URLs.
If you want the function to return the authentication url instead of auto-redirecting, you can set the argument
$return
(5th argument) totrue
.
3) Get the access token when redirected back to the $redirectUrl
after app authorization.
You can use the same page for creating the request and getting the access token (redirect url). In that case just skip the 2nd parameter
$redirectUrl
while callingcreateAuthRequest()
method. The AuthHelper class will do the rest for you.
Get the CartzySDK Object
You can provide the configuration as a parameter while instantiating the object (if you didn't configure already by calling config()
method)
Discount Code
You can get list of discount codes created in store admin.
Reference
All versions of php-cartzy with dependencies
ext-curl Version *
ext-json Version *