{"id":37014298,"url":"https://github.com/cloudblue/connect-quickstart-template-for-php","last_synced_at":"2026-01-14T01:25:04.017Z","repository":{"id":56949620,"uuid":"152555388","full_name":"cloudblue/connect-quickstart-template-for-php","owner":"cloudblue","description":"Sample processor script for the CloudBlue Connect Platform PHP SDK.","archived":false,"fork":false,"pushed_at":"2020-04-17T23:41:35.000Z","size":39,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-13T06:34:35.491Z","etag":null,"topics":["cloudblue","cloudblueconnect","connect","processor"],"latest_commit_sha":null,"homepage":"https://connect.cloudblue.com/documentation/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudblue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-11T08:12:59.000Z","updated_at":"2020-04-17T23:41:38.000Z","dependencies_parsed_at":"2022-08-21T07:50:17.942Z","dependency_job_id":null,"html_url":"https://github.com/cloudblue/connect-quickstart-template-for-php","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/cloudblue/connect-quickstart-template-for-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fconnect-quickstart-template-for-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fconnect-quickstart-template-for-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fconnect-quickstart-template-for-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fconnect-quickstart-template-for-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudblue","download_url":"https://codeload.github.com/cloudblue/connect-quickstart-template-for-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudblue%2Fconnect-quickstart-template-for-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudblue","cloudblueconnect","connect","processor"],"created_at":"2026-01-14T01:25:03.160Z","updated_at":"2026-01-14T01:25:04.000Z","avatar_url":"https://github.com/cloudblue.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect SDK Template for PHP\n\nThe Connect SDK Template for php provides developers an complete skeleton to start their automation project using the [Connect Fulfillment API](http://help.vendor.connect.cloud.im/support/solutions/articles/43000030735-fulfillment-management-module) together with the [Connect SDK for PHP](https://github.com/ingrammicro/connect-php-sdk).\n\n## Requirements\n\nIn order to use this template you will need an environment capable to run PHP scripts, any version starting PHP 5.6 is supported. Additionally please ensure that [composer](https://getcomposer.org/) it's functional.\n\n## Installation \n\nYou can download the quick start template with Composer `create-project` command in your terminal:\n\n```bash\ncomposer create-project --prefer-dist apsconnect/connect-quickstart-template project-name\n```\n\nOnce you have the skeleton project ready you can start developing your custom code \nin `app/ProductFulfillment.php` file in the `processRequest()` method.\n\n```php\n\u003c?php\n\nnamespace App;\n\n/**\n * Class ProductFulfillment\n * @package App\n */\nclass ProductFulfillment extends \\Connect\\FulfillmentAutomation\n{\n\n    /**\n     * Process each pending request\n     * @param \\Connect\\Request $request\n     */\n    public function processRequest($request)\n    {\n        // TODO: Implement processRequest() method.\n    }\n\n    /**\n     * Run the Product Fulfillment Request Processor\n     * @return bool\n     * @throws \\GuzzleHttp\\Exception\\GuzzleException\n     */\n    public function run()\n    {\n        try {\n\n            /**\n             * run the application in custom context, any error\n             * handling customization should be done here\n             */\n            $this-\u003eprocess();\n            return true;\n\n        } catch (\\Exception $e) {\n\n            $this-\u003elogger-\u003eerror($e-\u003egetMessage());\n            if (is_callable([$this-\u003elogger, 'dump'])) {\n                $this-\u003elogger-\u003edump();\n            }\n        }\n\n        return false;\n    }\n}\n```\n\n## Testing your project \n\nTest the `ProductFulfillment` class is quite easy, you just need to create your tests in `tests/Feature/` directory\nby default the skeleton have some common tests.\n\n### Mocking the FulFillment API calls\n\nTo mock the fulfillment API, and with that test like if a request is retrived, you only have to create a valid json file with the response that you want in the `tests/Feature/` \ndirectory with the name `YOUR-TEST-NAME.http.json` where `YOUR-TEST-NAME` is the name of the test file in where you want to \nuse that fake response, for example:\n\n- `ProcessSkipTest.http.json` will be injected in `ProcessSkipTest.php` test.\n- `RunAndFailTest.http.json` will be injected in `RunAndFailTest.php` test.\n\n### Mocking other services\n\nThe skeleton also provides a easy way to mock other services, for this you only need to create a new service provider in\n`tests/Providers`, this new service provider MUST extends the `MockServiceProvider`. Inside this file you should configure \nyour mocked service using the static property `$scope` to retrieve any auxiliary file like a fake json.\n\n```php\n\u003c?php\n\nnamespace Test\\Providers;\n\nuse Pimple\\Container;\n\n/**\n * Class HttpServiceProvider\n * @package Test\\Unit\\Runtime\\Providers\n */\nclass HttpServiceProvider extends MockServiceProvider\n{\n    public function register(Container $container)\n    {\n        $content = '[]';\n        $fakeRequestFile = dirname(__DIR__) . '/Feature/' . self::$scope . '.json';\n        if (is_readable($fakeRequestFile)) {\n            $content = trim(file_get_contents($fakeRequestFile));\n        }\n\n        $body = \\Mockery::mock('\\Psr\\Http\\Message\\StreamInterface');\n        $body-\u003eshouldReceive('getContents')\n            -\u003eandReturn($content);\n\n        $response = \\Mockery::mock('\\Psr\\Http\\Message\\ResponseInterface');\n        $response-\u003eshouldReceive('getStatusCode')\n            -\u003eandReturn(200);\n\n        $response-\u003eshouldReceive('getBody')\n            -\u003eandReturn($body);\n\n        $client = \\Mockery::mock('GuzzleHttp\\ClientInterface');\n        $client-\u003eshouldReceive('request')\n            -\u003ewithAnyArgs()\n            -\u003eandReturn($response);\n\n        return $client;\n    }\n}\n``` \n\nFinally you need to register your mocked service in the `$providers` property of `tests/TestCase` file.\n\n```php\n    /**\n     * List of Mocked Service Providers\n     * @var MockServiceProvider[]\n     */\n    protected $providers = [\n        'logger' =\u003e '\\Test\\Providers\\LoggerServiceProvider',\n        'http' =\u003e '\\Test\\Providers\\HttpServiceProvider'\n    ];\n```\n\nThe scope id has the format `YOUR-TEST-NAME.serviceId.json` where:\n\n- `YOUR-TEST-NAME` is the filename of the test that is running.\n- `serviceId` is the id of the service for example `logger` is the logger service id and `http` is the default Http service for the FulFillment API.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudblue%2Fconnect-quickstart-template-for-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudblue%2Fconnect-quickstart-template-for-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudblue%2Fconnect-quickstart-template-for-php/lists"}