Skip to content

Commit

Permalink
Merge pull request #5 from ursuleacv/1.0.4-dev
Browse files Browse the repository at this point in the history
v2.0 	Creating MerchantOS class for api requests and methods
  • Loading branch information
ursuleacv committed Mar 31, 2016
2 parents aea2f64 + 52d4894 commit 0c5ef14
Show file tree
Hide file tree
Showing 4 changed files with 347 additions and 320 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/ursuleacv/oauth2-lightspeed.png?branch=master)](https://travis-ci.org/ursuleacv/oauth2-lightspeed)

This package provides LightSpeed OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/ursuleacv/oauth2-client).
This package provides LightSpeed OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

This package is compliant with [PSR-1][], [PSR-2][], [PSR-4][], and [PSR-7][]. If you notice compliance oversights, please send a patch via pull request.

Expand Down Expand Up @@ -44,7 +44,6 @@ $provider = new League\OAuth2\Client\Provider\Lightspeed([
'clientId' => LIGHTSPEED_CLIENT_ID,
'clientSecret' => LIGHTSPEED_CLIENT_SECRET,
'redirectUri' => LIGHTSPEED_REDIRECT_URI,
'accountId' => LIGHTSPEED_ACCOUNT_ID,
]);

if (!isset($_GET['code'])) {
Expand Down Expand Up @@ -75,8 +74,11 @@ $token = $provider->getAccessToken('authorization_code', [
try {

// We got an access token, let's now get the Account ID and sale details
$client = $ls->getAccountId($token);
$sale = $ls->getSale($token, 1);
$client = $provider->getResourceOwner($token);
$merchantos = $provider->merchantosApi($token, $client->getId());

$clientId = $client->getId();
$sale = $merchantos->getSale(1);

echo '<pre>';
print_r($client); echo '<br>';
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ursuleacv/oauth2-lightspeed",
"description": "LightSpeed OAuth 2.0 Client Provider for The PHP League OAuth2-Client",
"license": "MIT",
"version": "1.0.2",
"version": "2.0.0",
"authors": [
{
"name": "Valentin Ursuleac",
Expand All @@ -21,7 +21,9 @@
],
"require": {
"php": ">=5.5.0",
"league/oauth2-client": "~1.0"
"ext-curl": "*",
"league/oauth2-client": "~1.0",
"guzzlehttp/guzzle": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
Expand Down
Loading

0 comments on commit 0c5ef14

Please sign in to comment.