Skip to content

Commit

Permalink
feat(subscribe): delete access and refresh tokens and all api calls w…
Browse files Browse the repository at this point in the history
…here it's needed
  • Loading branch information
maximedasilva committed Jul 5, 2022
1 parent 01dc16e commit 0e1b8e4
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 544 deletions.
100 changes: 0 additions & 100 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,6 @@ public function __construct($client, $options = [])
}
}

/**
* Sign a user in
* @param string $username - Customer username
* @param string $password - Customer password
* @param mixed[] $options (optional) Guzzle request options
* @return mixed[] Returns generated auth tokens
*
* <code>
* $auth->signin('username@email.com', 'password123');
* </code>
*/
public function signin($username, $password, $options = [])
{
$tokens = $this->client->request(array_merge($options, [
'method' => 'POST',
'resource' => '/subscribe/auth/token',
'json' => [
'grantType' => 'password',
'username' => $username,
'password' => $password,
],
]));

if (isset($tokens['accessToken'])) {
$this->accessToken = $tokens['accessToken'];
$this->refreshToken = $tokens['refreshToken'];
}

return $tokens;
}

/**
* Step 1 of the JSAT (JSON Security Assertion Token) auth flow.
* This flow requires the creation of a callbackId from the provider that
Expand Down Expand Up @@ -134,73 +103,4 @@ public function verifyCallback($callbackId, $options = [])

return $callback;
}

/**
* Get information about the currently authenticated user
* @param mixed[] $options (optional) Guzzle request options
* @return mixed[] Returns info on the current authenticated user
*
* <code>
* $auth->me();
* </code>
*/
public function me($options = [])
{
$result = $this->client->requestWithRetry(array_merge($options, [
'method' => 'GET',
'resource' => '/subscribe/auth/me',
]));

return $result;
}

/**
* Create a new user account
* @param mixed[] $account Account information
* @param mixed[] $options (optional) Guzzle request options
* @return mixed[] Returns info on the current authenticated user
*
* <code>
* $auth->signup([
* 'firstName' => 'John',
* 'lastName' => 'Doe',
* 'email' => 'john@doe.com',
* 'password' => 'password123',
* ]);
* </code>
*/
public function signup($account, $options = [])
{
$result = $this->client->request(array_merge($options, [
'method' => 'PUT',
'resource' => '/subscribe/account',
'json' => $account,
]));

return $result;
}

/**
* Update the currently authenticated user account
* @param mixed[] $updates Account information
* @param mixed[] $options (optional) Guzzle request options
* @return mixed[] Returns info on the current authenticated user
*
* <code>
* $auth->set([
* 'firstName' => 'John',
* 'lastName' => 'Doe',
* ]);
* </code>
*/
public function set($updates, $options = [])
{
$result = $this->client->requestWithRetry(array_merge($options, [
'method' => 'POST',
'resource' => '/subscribe/account',
'json' => $updates,
]));

return $result;
}
}
101 changes: 0 additions & 101 deletions src/Payments.php

This file was deleted.

119 changes: 0 additions & 119 deletions src/Subscriptions.php

This file was deleted.

Loading

0 comments on commit 0e1b8e4

Please sign in to comment.