Skip to content
Docs
Get RestroPress

Filter

rpress_paypal_set_payment_transaction_id

Updated
On this page

Filters the PayPal transaction ID read from an order's notes.

Runs in rpress_paypal_get_payment_transaction_id, which is the callback for rpress_get_payment_transaction_id-paypal. The transaction ID is parsed from the order note that begins with PayPal Transaction ID, and is empty if no such note exists.

Parameters#

ParameterTypeDescription
$transaction_idstringTransaction ID from the order notes, or an empty string.
$payment_idintID of the order.

Return value#

string. The transaction ID.

Example#

function my_paypal_transaction_id( $transaction_id, $payment_id ) {
	if ( '' === $transaction_id ) {
		return (string) get_post_meta( $payment_id, '_my_paypal_txn_id', true );
	}
	return $transaction_id;
}
add_filter( 'rpress_paypal_set_payment_transaction_id', 'my_paypal_transaction_id', 10, 2 );

Notes#

Despite the word set in the name, the filter runs when reading the transaction ID.

Source#

Applied in:

  • includes/gateways/paypal-standard.php (line 2059), in rpress_paypal_get_payment_transaction_id()

See also#

  • rpress_get_payment_transaction_id-paypal
Was this page helpful?