Model/Fields/UserCards.php
public function getOptionArray()
    {
        // Prepare the options array
        $options = [];

        // Get the customer id 
        // TODO get from model or user select
        $customerId = 2;

        // Get the cards list
        $cardList = $this->paymentTokenManagement->getListByCustomerId($customerId);

        // Prepare the options list
        foreach ($cardList as $card) {
            // Get the card data
            $cardData = $card->getData();

            // Create the option
            //if ((int) $cardData->is_active == 1 && (int) $cardData->is_visible == 1) {
            if ($cardData) {
                $options[$cardData['gateway_token']] = $this->_getOptionString(json_decode($cardData['details']));
            }
        }

        return $options;
    }
public function getOptionArray()
    {
        // Prepare the options array
        $options = [];

        // Get the customer id 
        // TODO get from model or user select
        $customerId = 2;

        // Get the cards list
        $cardList = $this->paymentTokenManagement->getListByCustomerId($customerId);

        // Prepare the options list
        foreach ($cardList as $card) {
            // Get the card data
            $cardData = $card->getData();

            // Create the option
            //if ((int) $cardData->is_active == 1 && (int) $cardData->is_visible == 1) {
            if ($cardData) {
                $options[$cardData['gateway_token']] = $this->_getOptionString(json_decode($cardData['details']));
            }
        }

        return $options;
    }
public function getOptionArray ( ) { // Prepare the options array $ options = [ ] ; // Get the customer id  // TODO get from model or user select $ customerId = 2 ; // Get the cards list $ cardList = $ this -> paymentTokenManagement -> getListByCustomerId ( $ customerId ) ; // Prepare the options list foreach ( $ cardList as $ card ) { // Get the card data $ cardData = $ card -> getData ( ) ; // Create the option //if ((int) $cardData->is_active == 1 && (int) $cardData->is_visible == 1) { if ( $ cardData ) { $ options [ $ cardData [ 'gateway_token' ] ] = $ this -> _getOptionString ( json_decode ( $ cardData [ 'details' ] ) ) ; } } return $ options ; }
Get Grid row type labels array.
@return array
Get Grid row type labels array .