Skip to content
Docs
Get RestroPress

Filter

rpress_set_payment_transaction_id

Updated
On this page

Filters the transaction ID before it is saved on a payment.

Runs in rpress_set_payment_transaction_id() when both a payment ID and a transaction ID are provided, before the value is saved to the _rpress_payment_transaction_id meta key. Gateways call this function to record the processor's reference.

Parameters#

ParameterTypeDescription
$transaction_idstringThe transaction ID to store.
$payment_idintThe payment (order) ID.

Return value#

string. The transaction ID to store.

Example#

add_filter( 'rpress_set_payment_transaction_id', 'my_trim_transaction_id', 10, 2 );
function my_trim_transaction_id( $transaction_id, $payment_id ) {
	return trim( $transaction_id );
}

Source#

Applied in:

  • includes/payments/functions.php (line 1647), in rpress_set_payment_transaction_id()

See also#

Was this page helpful?