You are here

public function Square::getApiClient in Commerce Square Connect 8

Gets a configured API client.

Return value

\SquareConnect\ApiClient The API client.

Overrides SquareInterface::getApiClient

Deprecated

Use \Drupal\commerce_square\Connect::getClient

4 calls to Square::getApiClient()
Square::capturePayment in src/Plugin/Commerce/PaymentGateway/Square.php
Captures the given authorized payment.
Square::createPayment in src/Plugin/Commerce/PaymentGateway/Square.php
Creates a payment.
Square::refundPayment in src/Plugin/Commerce/PaymentGateway/Square.php
Refunds the given payment.
Square::voidPayment in src/Plugin/Commerce/PaymentGateway/Square.php
Voids the given payment.

File

src/Plugin/Commerce/PaymentGateway/Square.php, line 171

Class

Square
Provides the Square payment gateway.

Namespace

Drupal\commerce_square\Plugin\Commerce\PaymentGateway

Code

public function getApiClient() {
  $api_mode = $this
    ->getMode() == 'test' ? 'sandbox' : 'production';
  return $this->connect
    ->getClient($api_mode);
}