oanhnn / shopify-php-sdk
An unofficial Shopify PHP SDK
dev-master
2018-05-28 10:43 UTC
Requires
- php: ^7.1.3
- php-http/cache-plugin: ^1.4
- php-http/client-common: ^1.6
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.0
- php-http/httplug: ^1.1
- psr/cache: ^1.0
- psr/http-message: ^1.0
- psr/log: ^1.0
- symfony/options-resolver: ^4.0
- symfony/serializer: ^4.0
Requires (Dev)
- cache/array-adapter: ^0.4
- guzzlehttp/psr7: ^1.2
- php-http/guzzle6-adapter: ^1.0
- php-http/mock-client: ^1.0
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: ^3.2
This package is auto-updated.
Last update: 2024-11-08 08:02:51 UTC
README
Unoffical Shopify SDK for PHP
Requirements
- php >=7.1.3
Installation
Begin by pulling in the package through Composer.
$ composer require oanhnn/shopify-php-sdk php-http/guzzle6-adapter
Why php-http/guzzle6-adapter
? We are decoupled from any HTTP messaging client with help by HTTPlug.
You can find other HTTP messaging client implement \Http\Client\HttpClient
in here.
Usage
$sdk = new ShopifySDK([ 'app_key' => getenv(static::APP_KEY_ENV_NAME), 'app_secret' => getenv(static::APP_SECRET_ENV_NAME), 'app_password' => getenv(static::APP_PASSWORD_ENV_NAME), 'shop_domain' => 'your-store.myshopify.com', 'http_client' => new \Http\Adapter\Guzzle6\Client(), ]); // Make authorization url $sdk->getAuthorizationUrl( 'https://example.com/shopify', ['read_products', 'write_products'], ['state' => 'random-string'] ); // Get access token from code $accessToken = $sdk->getAccessTokenFromCode( 'https://example.com/shopify', $_GET['code'] ); // Get shop information $shop = $sdk->setAccessToken($accessToken)->getClient()->get('/shop.json');
Changelog
See all change logs in CHANGELOG
Testing
$ git clone git@github.com/oanhnn/shopify-php-sdk.git /path
$ cd /path
$ composer install
$ composer phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.
Credits
License
This project is released under the MIT License.
Copyright © 2018 Oanh Nguyen.