WordPress at Your Fingertips
function is not described

WC_Payment_Token_Data_Store::read_extra_data() protected WC 3.0.0

Read extra data associated with the token (like last4 digits of a card for expiry dates).

{} It's a method of the class: WC_Payment_Token_Data_Store{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->read_extra_data( $token );
$token(WC_Payment_Token) (required) (passed by reference — &)
Payment token object.

Changelog

Since 3.0.0 Introduced.

Code of WC_Payment_Token_Data_Store::read_extra_data() WC 5.8.0

protected function read_extra_data( &$token ) {
	foreach ( $token->get_extra_data_keys() as $key ) {
		$function = 'set_' . $key;
		if ( is_callable( array( $token, $function ) ) ) {
			$token->{$function}( get_metadata( 'payment_token', $token->get_id(), $key, true ) );
		}
	}
}