public function toArray()
    {
        if (! isset($this->payload['title'])) {
            throw CouldNotCreateCard::titleNotProvided();
        }

        if (count($this->buttons) > 0) {
            $this->payload['buttons'] = $this->buttons;
        }

        return $this->payload;
    }
public function toArray()
    {
        if (! isset($this->payload['title'])) {
            throw CouldNotCreateCard::titleNotProvided();
        }

        if (count($this->buttons) > 0) {
            $this->payload['buttons'] = $this->buttons;
        }

        return $this->payload;
    }
public function toArray ( ) { if ( ! isset ( $ this -> payload [ 'title' ] ) ) { throw CouldNotCreateCard :: titleNotProvided ( ) ; } if ( count ( $ this -> buttons ) > 0 ) { $ this -> payload [ 'buttons' ] = $ this -> buttons ; } return $ this -> payload ; }
Returns a payload for API request.

@return array
@throws CouldNotCreateCard
Returns a payload for API request .