$payment = $order->getPayment(); $transactionId = $payment->getRefundTransactionId('creditcard');
$payment = $order->getPayment(); $transactionId = $payment->getRefundTransactionId('paypal');In this example, we retrieve the payment object from an order and use the getRefundTransactionId method to retrieve the transaction ID of a refund for the PayPal payment method. This method is part of the Magento core code and is not part of any third-party package or library.