You are here

public function ExpressCheckout::getExpressCheckoutDetails in Commerce PayPal 8

GetExpressCheckoutDetails API Operation (NVP) request.

Builds the data for the request and make the request.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: The order.

Return value

array PayPal response data array.

Overrides ExpressCheckoutInterface::getExpressCheckoutDetails

See also

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

1 call to ExpressCheckout::getExpressCheckoutDetails()
ExpressCheckout::onReturn in src/Plugin/Commerce/PaymentGateway/ExpressCheckout.php
Processes the "return" request.

File

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

Class

ExpressCheckout
Provides the Paypal Express Checkout payment gateway.

Namespace

Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway

Code

public function getExpressCheckoutDetails(OrderInterface $order) {

  // Get the Express Checkout order token.
  $order_express_checkout_data = $order
    ->getData('paypal_express_checkout');

  // Build a name-value pair array to obtain buyer information from PayPal.
  $nvp_data = [
    'METHOD' => 'GetExpressCheckoutDetails',
    'TOKEN' => $order_express_checkout_data['token'],
  ];

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