rpress_payment_meta

Author: RestroPress 21 views

This run of the rpress_payment_meta filter is for backward compatibility purposes, it is including two parameters.

An example of how you can append additional information:

function record_fees( $payment_meta, $payment_data ) {
if ( $this->has_fees( 'all' ) ) {
$payment_meta['fees'] = $this->get_fees( 'all' );
// Only clear fees from session when status is not pending
if( ! empty( $payment_data['status'] ) && 'pending' !== strtolower( $payment_data['status']
) ) {
RPRESS()->session->set( 'rpress_cart_fees', null );
}
}
return $payment_meta;
}
}
add_filter( 'rpress_payment_meta', array( $this, 'record_fees' ), 10, 2 );