You are here

public function CheckoutSdk::authorizeOrder in Commerce PayPal 8

Authorize payment for order.

Parameters

string $remote_id: The PayPal order ID.

Return value

\Psr\Http\Message\ResponseInterface The HTTP response.

Overrides CheckoutSdkInterface::authorizeOrder

File

src/CheckoutSdk.php, line 149

Class

CheckoutSdk
Provides a replacement of the PayPal SDK.

Namespace

Drupal\commerce_paypal

Code

public function authorizeOrder($remote_id) {
  $headers = [
    'Content-Type' => 'application/json',
  ];
  return $this->client
    ->post(sprintf('/v2/checkout/orders/%s/authorize', $remote_id), [
    'headers' => $headers,
  ]);
}