Filter
rpress_paypal_set_payment_transaction_id
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#
| Parameter | Type | Description |
|---|---|---|
$transaction_id | string | Transaction ID from the order notes, or an empty string. |
$payment_id | int | ID 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), inrpress_paypal_get_payment_transaction_id()
See also#
rpress_get_payment_transaction_id-paypal
Was this page helpful?
