/** * Display saved cards */ public function output() { if (!is_user_logged_in() || !($customer_id = get_user_meta(get_current_user_id(), '_stripe_customer_id', true)) || !is_string($customer_id)) { return; } $stripe = new WC_Gateway_Stripe(); $cards = $stripe->get_saved_cards($customer_id); if ($cards) { wc_get_template('saved-cards.php', array('cards' => $cards), 'woocommerce-gateway-stripe/', WC_STRIPE_TEMPLATE_PATH); } }