RestroPress

⌘K
  1. Home
  2. Docs
  3. RestroPress
  4. Developer Docs
  5. Filters
  6. rpress_payment_meta

rpress_payment_meta

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 );

How can we help?