souzadavi Posted May 8, 2018 Share Posted May 8, 2018 Hello I'm trying to create a gateway payment integrate with whmcs credit card default system. In Gateway payment configs (admin/configgateways.php) I would like to set an option of each customfields with dropbox than input text. check the image: https://prnt.sc/jffxs1 I need to set it on method getwayname_config() check the image: https://prnt.sc/jffyap function GATEWAYNAME_config() { return array( // the dropdown field type renders a select menu of options 'dropdownField' => array( 'FriendlyName' => 'Dropdown Field', 'Type' => 'dropdown',//// HOW TO SHOW CUSTOMFIELDS INTO DROPDOWNFIELD? 'Options' => $params["clientdetails"]["customfields"], 'Description' => 'Choose one', )); } How to populate the dropdown field on admin payment gateway config with customsfields names? any help will great!!! thanks 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted May 16, 2018 Author Share Posted May 16, 2018 No one?? function GATEWAYNAME_config() { return array( // the dropdown field type renders a select menu of options 'dropdownField' => array( 'FriendlyName' => 'Dropdown Field', 'Type' => 'dropdown',//// HOW TO SHOW CUSTOMFIELDS INTO DROPDOWNFIELD? 'Options' => $params["customfield"], 'Description' => 'Choose one', )); } HOW TO SHOW CUSTOMFIELDS INTO DROPDOWNFIELD? I would like to show a dropdownfield in config of gateway, the custom customers fields is like birthday, brazilian document numbers etc. I set it by number in a text box, is very hard, because is doubt.. I would like to bring it automatic with dropdown (select and option) at gateway config in admin. is it clear? i hope so... Thanks 0 Quote Link to comment Share on other sites More sharing options...
edvancombr Posted May 16, 2018 Share Posted May 16, 2018 29 minutes ago, souzadavi said: No one?? function GATEWAYNAME_config() { return array( // the dropdown field type renders a select menu of options 'dropdownField' => array( 'FriendlyName' => 'Dropdown Field', 'Type' => 'dropdown',//// HOW TO SHOW CUSTOMFIELDS INTO DROPDOWNFIELD? 'Options' => $params["customfield"], 'Description' => 'Choose one', )); } HOW TO SHOW CUSTOMFIELDS INTO DROPDOWNFIELD? I would like to show a dropdownfield in config of gateway, the custom customers fields is like birthday, brazilian document numbers etc. I set it by number in a text box, is very hard, because is doubt.. I would like to bring it automatic with dropdown (select and option) at gateway config in admin. is it clear? i hope so... Thanks Olá, Davi! como vai? Pelo que entendi você quer listar os campos customizáveis nas configurações do módulo? Veja o vídeo http://nimb.ws/4xwC5y e confira se é isso que necessita. 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted May 16, 2018 Author Share Posted May 16, 2018 YESSSS.... Olá Edvan, obrigado pelo retorno... É exatamente isso que eu preciso... 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted May 23, 2018 Author Share Posted May 23, 2018 Hello? Any one??? thanks 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted May 25, 2018 Author Share Posted May 25, 2018 I got it!! thanks for whmcs support team and programmers friends.... the solution was: I created a function: function get_customfield_id() { $fields = mysql_query("SELECT id, fieldname FROM tblcustomfields WHERE type = 'client';"); if (!$fields) { return '<br><br>Erro geral no banco de dados'; } elseif (mysql_num_rows($fields) >= 1) { $dropFieldArray = array(); $tutorial = '<br><br>Para sua comodidade, listamos abaixo os campos que podem ser usados e seus IDs. Basta pegar o ID e preencher acima. <ul>'; while ($field = mysql_fetch_assoc($fields)) { // the dropdown field type renders a select menu of options $dropFieldArray[$field['id']] = $field['fieldname']; } return $dropFieldArray; } else { return array('0' => 'nada definido'); } } and into _config() method i just give a call to this function like this: 'birthday' => array( 'FriendlyName' => 'Birthday Date', 'Type' => 'dropdown', 'Options' =>get_customfield_id(), 'Description' => 'Birthday date type the array number here', ), 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.