Magento 2 order PayPal information

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();

With the heplp of addiotnal information obejct we get paypal expreess token.

// get 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'];

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!

Leave a Reply