Today we talk about how in Magento 2 order PayPal information. In this tutorial, we focus on how to get order PayPal information which includes the PayPal express token and PayPal correlation id. So let start with our example.
First, we get payment additional information.
[cc lang="php" tab_size="2" lines="40"]
$paymentAdditionalInfo = $order->getPayment()->getAdditionalInformation();
[cc lang="php" tab_size="2" lines="40"]
$paymentAdditionalInfo = $order->getPayment()->getAdditionalInformation();
With the heplp of addiotnal information obejct we get paypal expreess token.
// get PayPal express checkout token
$token = $paymentAdditionalInfo['paypal_express_checkout_token'];
$token = $paymentAdditionalInfo['paypal_express_checkout_token'];
With the heplp of addiotnal information obejct we get paypal correlation id.
// get PayPal correlation ID
$correlationId = $paymentAdditionalInfo['paypal_correlation_id'];
$correlationId = $paymentAdditionalInfo['paypal_correlation_id'];