[WC 3.3] Fix fatal if gateway is deactivated

This commit is contained in:
Beka Rice 2017-12-13 13:59:07 -05:00
parent b0189363c2
commit f0a33bfa79
1 changed files with 3 additions and 2 deletions

View File

@ -575,9 +575,10 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table {
$transaction_id = $order->get_transaction_id();
if ( $transaction_id ) {
$url = $payment_gateways[ $payment_method ]->get_transaction_url( $order );
if ( isset( $payment_gateways[ $payment_method ] ) && $url ) {
$url = isset( $payment_gateways[ $payment_method ] ) ? $payment_gateways[ $payment_method ]->get_transaction_url( $order ) : false;
if ( $url ) {
$payment_via .= ' (<a href="' . esc_url( $url ) . '" target="_blank">' . esc_html( $transaction_id ) . '</a>)';
} else {
$payment_via .= ' (' . esc_html( $transaction_id ) . ')';