Get a link to the transaction on the 3rd party gateway size (if applicable).
public get_transaction_url ( WC_Order $order ) : string | ||
$order | WC_Order | the order object. |
Результат | string | transaction URL, or empty string. |
/** * Get the transaction URL. * * @param WC_Order $order * * @return string */ public function get_transaction_url($order) { if ($this->testmode) { $this->view_transaction_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s'; } else { $this->view_transaction_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s'; } return parent::get_transaction_url($order); }
/** * Get the transaction URL. * * @TODO Replace both 'view_transaction_url'\'s. * One for sandbox/testmode and one for live. * @param WC_Order $order * @return string */ public function get_transaction_url($order) { if ($this->sandbox == 'yes') { $this->view_transaction_url = 'https://www.sandbox.payment-gateway.com/?trans_id=%s'; } else { $this->view_transaction_url = 'https://www.payment-gateway.com/?trans_id=%s'; } return parent::get_transaction_url($order); }