WC_Payment_Gateway::get_transaction_url
Get a link to the transaction on the 3rd party gateway site (if applicable).
Method of the class: WC_Payment_Gateway{}
Hooks from the method
Returns
String. transaction URL, or empty string.
Usage
$WC_Payment_Gateway = new WC_Payment_Gateway(); $WC_Payment_Gateway->get_transaction_url( $order );
- $order(WC_Order) (required)
- the order object.
WC_Payment_Gateway::get_transaction_url() WC Payment Gateway::get transaction url code WC 10.7.0
public function get_transaction_url( $order ) {
$return_url = '';
$transaction_id = $order->get_transaction_id();
if ( ! empty( $this->view_transaction_url ) && ! empty( $transaction_id ) ) {
$return_url = sprintf( $this->view_transaction_url, $transaction_id );
}
/**
* Filter the transaction url.
*
* @since 2.2.0
* @param string $return_url Transaction URL.
* @param WC_Order|null $order Order object.
* @return string
*/
return apply_filters( 'woocommerce_get_transaction_url', $return_url, $order, $this );
}