You are here

public function CheckoutSdk::voidPayment in Commerce PayPal 8

Voids, or cancels, an authorized payment, by ID.

Parameters

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

Return value

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

Overrides CheckoutSdkInterface::voidPayment

File

src/CheckoutSdk.php, line 214

Class

CheckoutSdk
Provides a replacement of the PayPal SDK.

Namespace

Drupal\commerce_paypal

Code

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