You are here

public function CheckoutSdk::reAuthorizePayment in Commerce PayPal 8

Reauthorizes an authorized PayPal account payment, by ID.

Parameters

string $authorization_id: The PayPal-generated ID of the authorized payment to reauthorize.

array $parameters: (optional An array of parameters to pass as the request body.

Return value

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

Overrides CheckoutSdkInterface::reAuthorizePayment

File

src/CheckoutSdk.php, line 184

Class

CheckoutSdk
Provides a replacement of the PayPal SDK.

Namespace

Drupal\commerce_paypal

Code

public function reAuthorizePayment($authorization_id, array $parameters = []) {
  $options = [
    'headers' => [
      'Content-Type' => 'application/json',
    ],
  ];
  if ($parameters) {
    $options['json'] = $parameters;
  }
  return $this->client
    ->post(sprintf('/v2/payments/authorizations/%s/reauthorize', $authorization_id), $options);
}