Jump to content

Dropdown values for payment gateway


Recommended Posts

Hi all.

I'm developing a gateway module using the provided php template.

I have a problem using the config function:

 

function template_config() {
   $configarray = array(
    "FriendlyName" => array("Type" => "System", "Value"=>"My Custom Module"),
    "username" => array("FriendlyName" => "Login ID", "Type" => "text", "Size" => "20", ),
    "transmethod" => array("FriendlyName" => "Transaction Method", "Type" => "dropdown", "Options" => "Option1,Value2,Method3", ),
    "instructions" => array("FriendlyName" => "Payment Instructions", "Type" => "textarea", "Rows" => "5", "Description" => "Do this then do that etc...", ),
    "testmode" => array("FriendlyName" => "Test Mode", "Type" => "yesno", "Description" => "Tick this to test", ),
   );
return $configarray;
}

When using input of type "dropdown" I must give a list of options ("Options" => "Option1, Value2, Method3"), but I need to know how can I use values for those options.

 

Right now I'm getting a dropdown like this:

<select name="language">
 <option>Spanish</option>
 <option>English</option>
</select>

 

But I need this, as y gateway provider needs the code, not the name:

<select name="language">
 <option value="1">Spanish</option>
 <option value="2">English</option>
</select>

 

And I can not show the admin a dropdown like: "Select language: 1, 2, 3", I need to show the full name of each option (language, coin, etc.) and retrieve the value.

 

I'm not asking for something that doesn't exist, just want to use the HTML value attribute.

What can I do?

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated