You are here

public function Connect::getAccessToken in Commerce Square Connect 8

Gets the access token.

Parameters

string $mode: The mode.

Return value

string The access token.

1 call to Connect::getAccessToken()
Connect::getClient in src/Connect.php
Gets a Square API client.

File

src/Connect.php, line 88

Class

Connect
Represents the Connect application for Square.

Namespace

Drupal\commerce_square

Code

public function getAccessToken($mode) {
  if ($mode == 'production') {
    return $this->state
      ->get('commerce_square.production_access_token');
  }
  return $this->settings
    ->get('sandbox_access_token');
}