is_default() public method

Returns if the token is marked as default.
Since: 2.6.0
public is_default ( ) : boolean
return boolean True if the token is default
    /**
     * Gets saved payment method HTML from a token.
     * @since 2.6.0
     * @param  WC_Payment_Token $token Payment Token
     * @return string                  Generated payment method HTML
     */
    public function get_saved_payment_method_option_html($token)
    {
        $html = sprintf('<li class="woocommerce-SavedPaymentMethods-token">
				<input id="wc-%1$s-payment-token-%2$s" type="radio" name="wc-%1$s-payment-token" value="%2$s" style="width:auto;" class="woocommerce-SavedPaymentMethods-tokenInput" %4$s />
				<label for="wc-%1$s-payment-token-%2$s">%3$s</label>
			</li>', esc_attr($this->id), esc_attr($token->get_id()), esc_html($token->get_display_name()), checked($token->is_default(), true, false));
        return apply_filters('woocommerce_payment_gateway_get_saved_payment_method_option_html', $html, $token, $this);
    }
 /**
  * Update a payment token.
  *
  * @since 2.7.0
  * @param WC_Payment_Token $token
  */
 public function update(&$token)
 {
     if (false === $token->validate()) {
         throw new Exception(__('Invalid or missing payment token fields.', 'woocommerce'));
     }
     global $wpdb;
     $payment_token_data = array('gateway_id' => $token->get_gateway_id('edit'), 'token' => $token->get_token('edit'), 'user_id' => $token->get_user_id('edit'), 'type' => $token->get_type('edit'));
     $wpdb->update($wpdb->prefix . 'woocommerce_payment_tokens', $payment_token_data, array('token_id' => $token->get_id('edit')));
     $token->save_meta_data();
     $token->apply_changes();
     // Make sure all other tokens are not set to default
     if ($token->is_default() && $token->get_user_id() > 0) {
         WC_Payment_Tokens::set_users_default($token->get_user_id(), $token->get_id());
     }
     do_action('woocommerce_payment_token_updated', $token->get_id());
 }
 /**
  * Outputs a saved payment method from a token.
  * @since 2.6.0
  * @param  WC_Payment_Token $token Payment Token
  * @return string                  Generated payment method HTML
  */
 public function saved_payment_method($token)
 {
     $html = sprintf('<input type="radio" id="wc-%1$s-payment-token-%2$s" name="wc-%1$s-payment-token" style="width:auto;" class="wc-gateway-payment-token wc-%1$s-payment-token" value="%2$s" %3$s/>', esc_attr($this->id), esc_attr($token->get_id()), checked($token->is_default(), true, false));
     $html .= sprintf('<label class="wc-gateway-payment-form-saved-payment-method wc-gateway-payment-token-label" for="wc-%s-payment-token-%s">', esc_attr($this->id), esc_attr($token->get_id()));
     $html .= $this->saved_payment_method_title($token);
     $html .= '</label><br />';
     return apply_filters('wc_payment_gateway_form_saved_payment_method_html', $html, $token, $this);
 }