You didn’t mention whether users could only reach this page when logged in, so this example includes a check to make sure the current visitor is logged in, otherwise it won’t output anything.
<?php
// create the shortcode
add_shortcode('wpse_312268_show_cc_info', 'create_wpse_312268_shortcode');
function create_wpse_312268_shortcode() {
// only do something if user is logged in
if(is_user_logged_in()) {
// get their id
$user_id = get_current_user_id();
// get the specific usermeta value as an array
$cc_meta = get_user_meta($user_id, '_wc_braintree_credit_card_payment_tokens', false);
// get specific values from the array
$last_four = $cc_meta['last_four'];
$card_type = $cc_meta['card_type'];
// only show if the values aren't empty
if(!empty($last_four) && !empty($card_type)) {
// display with whatever markup you like
echo "<div class="cc_info">$card_type ending in
$last_four</div>";
}
}
}
?>
Depending on your needs you may also want to make the text translatable.