You are here

public function CheckoutSdk::captureOrder in Commerce PayPal 8

Capture payment for order.

Parameters

string $remote_id: The PayPal order ID.

Return value

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

Overrides CheckoutSdkInterface::captureOrder

File

src/CheckoutSdk.php, line 159

Class

CheckoutSdk
Provides a replacement of the PayPal SDK.

Namespace

Drupal\commerce_paypal

Code

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