You are here

public function ExpressCheckout::doVoid in Commerce PayPal 8

DoVoid API Operation (NVP) request.

Builds the data for the request and make the request.

Parameters

\Drupal\commerce_payment\Entity\PaymentInterface $payment: The payment.

Return value

array PayPal response data.

Overrides ExpressCheckoutInterface::doVoid

See also

https://developer.paypal.com/docs/classic/api/merchant/DoVoid_API_Operat...

1 call to ExpressCheckout::doVoid()
ExpressCheckout::voidPayment in src/Plugin/Commerce/PaymentGateway/ExpressCheckout.php
Voids the given payment.

File

src/Plugin/Commerce/PaymentGateway/ExpressCheckout.php, line 751

Class

ExpressCheckout
Provides the Paypal Express Checkout payment gateway.

Namespace

Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway

Code

public function doVoid(PaymentInterface $payment) {

  // Build a name-value pair array for this transaction.
  $nvp_data = [
    'METHOD' => 'DoVoid',
    'AUTHORIZATIONID' => $payment
      ->getRemoteId(),
  ];

  // Make the PayPal NVP API request.
  return $this
    ->doRequest($nvp_data, $payment
    ->getOrder());
}