Skip to content

Commit 1b45b87

Browse files
authored
Merge pull request #10 from OpenSTFoundation/develop
Readme changes and bug fixes
2 parents 27a1ead + cec1438 commit 1b45b87

4 files changed

Lines changed: 34 additions & 24 deletions

File tree

README.md

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ Initialize the SDK object:
3939
```php
4040

4141
$params = array();
42-
$params['apiKey']='API_KEY';
43-
$params['apiSecret']='API_SECRET';
42+
$params['apiKey']=API_KEY;
43+
$params['apiSecret']=API_SECRET;
4444
$params['apiBaseUrl']='https://sandboxapi.ost.com/v1/';
4545

46-
$ostObj = new OSTSDK($params);
46+
$ostObj = new OSTSdk($params);
4747

4848
```
4949

@@ -72,6 +72,15 @@ $response = $userService->edit($editUserParams)->wait();
7272
var_dump($response);
7373
```
7474

75+
Get a user:
76+
77+
```php
78+
$getUserParams = array();
79+
$getUserParams['id'] = '7ac1da33-b1d2-4f03-b39c-fbac0f1e2b92';
80+
$response = $userService->get($getUserParams)->wait();
81+
var_dump($response);
82+
```
83+
7584
Get a list of users and other data:
7685

7786
```php
@@ -170,21 +179,8 @@ $response = $actionService->get($getActionParams)->wait();
170179
var_dump($response);
171180
```
172181

173-
### Token Module
174-
175-
```php
176-
$tokenService = $ostObj->services->token;
177-
```
178-
179-
Get Token Detail:
180-
181-
```php
182-
$getParams = array();
183-
$response = $tokenService->get($getParams)->wait();
184-
var_dump($response);
185-
```
186182

187-
### Transaction Module
183+
### Transactions Module
188184

189185
```php
190186
$transactionService = $ostObj->services->transactions;
@@ -221,7 +217,21 @@ $response = $transactionService->execute($executeParams)->wait();
221217
var_dump($response);
222218
```
223219

224-
### Transfer Module
220+
### Token Module
221+
222+
```php
223+
$tokenService = $ostObj->services->token;
224+
```
225+
226+
Get Token Detail:
227+
228+
```php
229+
$getParams = array();
230+
$response = $tokenService->get($getParams)->wait();
231+
var_dump($response);
232+
```
233+
234+
### Transfers Module
225235

226236
```php
227237
$transferService = $ostObj->services->transfers;

README_V0.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ Initialize the SDK object:
3939
```php
4040

4141
$params = array();
42-
$params['apiKey']='API_KEY';
43-
$params['apiSecret']='API_SECRET';
42+
$params['apiKey']=API_KEY;
43+
$params['apiSecret']=API_SECRET;
4444
$params['apiBaseUrl']='https://playgroundapi.ost.com/';
4545

46-
$ostObj = new OSTSDK($params);
46+
$ostObj = new OSTSdk($params);
4747

4848
```
4949

src/Lib/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ private function isInternalResponse($jsonObject) {
229229
/**
230230
* copy over the passed input args and process
231231
*
232-
* @param object $arguments json object
232+
* @param array $arguments json object
233233
*
234-
* @return object
234+
* @return array
235235
*
236236
*/
237237
private function copyAndSanitizeArgs($arguments) {

src/Services/Base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct($requestObj, $urlPrefix)
4343
protected function getId($params)
4444
{
4545
if (\Lib\Validate::isPresent($params['id'])) {
46-
return $params['id'];
46+
return urlencode($params['id']);
4747
} else {
4848
throw new \Exception('id missing in request params');
4949
}

0 commit comments

Comments
 (0)