File "class-wc-payment-token-echeck.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/woocommerce/includes/payment-tokens/class-wc-payment-token-echeck.php
File size: 904 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

if (!defined('ABSPATH')) {
    exit;
}
class WC_Payment_Token_ECheck extends WC_Payment_Token
{
    protected $type = 'eCheck';
    protected $extra_data = array('last4' => '');
    public function get_display_name($deprecated = '')
    {
        $display = sprintf(__('eCheck ending in %1$s', 'woocommerce'), $this->get_last4());
        return $display;
    }
    protected function get_hook_prefix()
    {
        return 'woocommerce_payment_token_echeck_get_';
    }
    public function validate()
    {
        if (false === parent::validate()) {
            return false;
        }
        if (!$this->get_last4('edit')) {
            return false;
        }
        return true;
    }
    public function get_last4($context = 'view')
    {
        return $this->get_prop('last4', $context);
    }
    public function set_last4($last4)
    {
        $this->set_prop('last4', $last4);
    }
}