I reply to all queries on the forums and via email, once per day, Monday to Friday (not weekends).

If you are new here, please see some information on how to ask for support. Thank you!

Reply To: New TX hook

dashed-slug.net Forums General discussion New TX hook Reply To: New TX hook

#5430
alexg
Keymaster

Hello and happy new year,

You can get notified about transaction data by binding to the wallets_transaction action. For example you could add this to your child theme’s functions.php file, or in a new plugin:

function wallets_transaction_cb( $tx ) {
    error_log( print_r( $tx, true ) ); // prints out a stdClass object
}
add_action( 'wallets_transaction', 'wallets_transaction_cb' );

You will get multiple notifications for each transaction, because the confirmations number is updated each time.

It is your responsibility to handle each transaction only once, so you would have to somehow keep a record of already seen TXIDs. Alternatively, you could perform your action only when the confirmation count is equal to some integer value.

Hope this helps. Please let me know if you have any further questions.

with regards