You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Connect PHP SDK allows an easy and fast integration with [Connect](http://connect.cloud.im/)fulfillment API and usage API. Thanks to it you can automate the fulfillment of orders generated by your products and report usage for it.
9
+
Connect PHP SDK allows an easy and fast integration with [Connect](http://connect.cloud.im/) Fulfillment and Usage APIs with PHP-based integrations. This SDK enables you to automate fulfillment of orders for your products and report usage data for them.
10
10
11
-
In order to use this library, please ensure that you have read first the documentation available on Connect knowladge base article located [here](http://help.vendor.connect.cloud.im/support/solutions/articles/43000030735-fulfillment-management-module), this one will provide you a great information on the rest api that this library implements.
11
+
Before using the library, please first to go through the documentation in the Connect knowledge base, which could be used as a source of information on the rest APIs used by this SDK.
12
12
13
13
## Class Features
14
14
15
-
This library may be consumed in your project in order to automate the fulfillment of requests and perform the usage reporting, this class once imported into your project will allow you to:
15
+
This library can be utilized in your project for the automation of the fulfillment logic as well as usage reporting. This class, once imported into your project, will enable you to:
16
16
17
-
-Connect to Connect using your api credentials
18
-
- List all requests, and even filter them:
19
-
- for a concrete product
20
-
- for a concrete status
21
-
- for a concrete asset
22
-
-etc..
17
+
-Establish connectivity to Connect APIs
18
+
- List all requests and apply filters like
19
+
- Filter requests by Product
20
+
- Filter requests by Status
21
+
- Filter requests by Asset
22
+
-etc.
23
23
- Process each request and obtain full details of the request
24
-
- Modify for each request the activation parameters in order to:
25
-
-Inquiry for changes
24
+
- Modify parameters of a request in order to:
25
+
-Inquire for changes
26
26
- Store information into the fulfillment request
27
27
- Change the status of the requests from it's initial pending state to either inquiring, failed or approved.
28
28
- Generate and upload usage files to report usage for active contracts and listings
@@ -34,12 +34,12 @@ This library may be consumed in your project in order to automate the fulfillmen
34
34
Your code may use any scheduler to execute, from a simple cron to a cloud scheduler like the ones available in Azure, Google, Amazon or other cloud platforms.
35
35
36
36
## Installation & loading
37
-
Connect PHP SDK is available on[Packagist](https://packagist.org/packages/apsconnect/connect-sdk) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install Connect PHP SDK. Just add this line to your `composer.json` file:
37
+
Connect PHP SDK is available through[Packagist](https://packagist.org/packages/apsconnect/connect-sdk) (using semantic versioning), and installation via the [Composer](https://getcomposer.org) is the recommended way to install the Connect PHP SDK. Just add these lines to your `composer.json` file:
Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer
54
54
55
-
## A Simple Example of fulfillment
55
+
## A Simple Example of the fulfillment
56
+
57
+
This example demonstrates a script that will retrieve all requests in the status pending and process them based on their type (purchase, change, cancel, suspend or resume)
56
58
57
59
```php
58
60
<?php
@@ -67,20 +69,38 @@ class ProductRequests extends \Connect\FulfillmentAutomation
@@ -204,7 +230,7 @@ class UsageFilesWorkflow extends \Connect\UsageFileAutomation
204
230
//Provider use case, needs to be reviewed and accept it
205
231
throw new \Connect\Usage\Accept("File looks good");
206
232
default:
207
-
throw new \Connect\Usage\Skip("not controled status");
233
+
throw new \Connect\Usage\Skip("not valid status");
208
234
}
209
235
}
210
236
}
@@ -223,3 +249,93 @@ try {
223
249
print "Error processing usage for active listing requests:" . $e->getMessage();
224
250
}
225
251
```
252
+
253
+
## Client class
254
+
255
+
Starting with the Connect PHP SDK version 17 the Client class has been introduced. This class allows running multiple operations in Connect like get the list of requests, configurations, etc. Client class may be instantiated from any application to obtain information needed to run an operation, like, for example, get the Asset information in the context of an action. Client will provide access to:
256
+
* Directory
257
+
* Fulfillment
258
+
* Tier Configurations
259
+
260
+
### Creating a Client
261
+
262
+
This is an example to create a client:
263
+
264
+
```php
265
+
<?php
266
+
require_once ("./vendor/autoload.php");
267
+
268
+
##Note that in case of no Configuration passed to constructor, system will check if config.json exists
269
+
$connect = new Connect\ConnectClient(new \Connect\Config([
0 commit comments