How can I modify an eTapestry Payment transaction?

There is a hook for modifying a transaction before it is sent to eTapestry. The transaction is an array. To see the API structure visit the Blackbaud API documentation HERE.

For example, let’s say you want to add a note to the Payment that would be attached to the gift. (A gift is created when a donation is made using the Payment plugin. If you wish to create another type of journal entry, you need to use the eTapestry Mapping plugin.)

Add a filter to your functions.php file in your theme (or even better, create a little plugin so your functionality is separated from your theme ):

add_filter('eTapPayment_transaction', 'custom_filter_gift', 10, 4);

function custom_filter_gift( $transaction, $feed, $data, $entry){
if ( $entry[‘form_id’]  !=  “16” ) { // change to your form ID or remove this condition to apply to all your forms with an eTap Payment feed
return $transaction;
}
$my_field_no = “8”; // change to your field id number
if ( ! empty( $entry[ $my_field_no ] ) ){
$transaction[‘note’] = sanitize_text_field( $entry[$my_field_no] ); // choose appropriate filter for your field
}
return $transaction;
}