{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Configuration","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"configuration","__idx":0},"children":["Configuration"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configuration-1","__idx":1},"children":["Configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A payment gateway module can have user configurable settings that are set via the WHMCS admin interface."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These are defined in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["yourmodulename_config"]}," function of the module which is a required function for all gateway modules."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This function should define both the display name for the module (for backwards compatibility), and any settings that the gateway module requires."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"defining-configuration-fields","__idx":2},"children":["Defining configuration fields"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The supported configuration field types include the following:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Text"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Password"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Yes/No Checkboxes"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Dropdown Menus"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Radio Buttons"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Text Areas"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Below is an example config function that demonstrates each type of field and the parameters available for them."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"function yourmodulename_config()\n{\n    return array(\n        // the friendly display name for a payment gateway should be\n        // defined here for backwards compatibility\n        'FriendlyName' => array(\n            'Type' => 'System',\n            'Value' => 'Sample Third Party Payment Gateway Module',\n        ),\n        // a text field type allows for single line text input\n        'accountID' => array(\n            'FriendlyName' => 'Account ID',\n            'Type' => 'text',\n            'Size' => '25',\n            'Default' => '',\n            'Description' => 'Enter your account ID here',\n        ),\n        // a password field type allows for masked text input\n        'secretKey' => array(\n            'FriendlyName' => 'Secret Key',\n            'Type' => 'password',\n            'Size' => '25',\n            'Default' => '',\n            'Description' => 'Enter secret key here',\n        ),\n        // the yesno field type displays a single checkbox option\n        'testMode' => array(\n            'FriendlyName' => 'Test Mode',\n            'Type' => 'yesno',\n            'Description' => 'Tick to enable test mode',\n        ),\n        // the dropdown field type renders a select menu of options\n        'dropdownField' => array(\n            'FriendlyName' => 'Dropdown Field',\n            'Type' => 'dropdown',\n            'Options' => array(\n                'option1' => 'Display Value 1',\n                'option2' => 'Second Option',\n                'option3' => 'Another Option',\n            ),\n            'Description' => 'Choose one',\n        ),\n        // the radio field type displays a series of radio button options\n        'radioField' => array(\n            'FriendlyName' => 'Radio Field',\n            'Type' => 'radio',\n            'Options' => 'First Option,Second Option,Third Option',\n            'Description' => 'Choose your option!',\n        ),\n        // the textarea field type allows for multi-line text input\n        'textareaField' => array(\n            'FriendlyName' => 'Textarea Field',\n            'Type' => 'textarea',\n            'Rows' => '3',\n            'Cols' => '60',\n            'Description' => 'Freeform multi-line text input field',\n        ),\n    );\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each field includes:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["System Name"]}," - a normalized name by which the field can be referenced in module code"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Friendly Name"]}," - a human readable friendly display name for the field"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type"]}," - The type of field. The available field types are \"text\", \"password\", \"yesno\" (checkbox), \"dropdown\", \"radio\" and \"textarea\""]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Any settings specific to that field type such as Size, Rows, Cols, Default Value and Description"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Any fields defined here will be available along with their configured values in all gateway module functions in the $params array."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Avoid common names like currency, invoiceid, etc, as these may conflict with the standard variables."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"build-your-gateway","__idx":3},"children":["Build your gateway"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now it's time to integrate your payment gateway provider."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a Third Party Gateway, ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/payment-gateways/third-party-gateway","title":"Third Party Gateway"},"children":["click here"]},". For a Merchant Gateway, ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/payment-gateways/merchant-gateway","title":"Merchant Gateway"},"children":["click here"]},"."]}]},"headings":[{"value":"Configuration","id":"configuration","depth":1},{"value":"Configuration","id":"configuration-1","depth":2},{"value":"Defining configuration fields","id":"defining-configuration-fields","depth":3},{"value":"Build your gateway","id":"build-your-gateway","depth":2}],"frontmatter":{"title":"Configuration","seo":{"title":"Configuration"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/payment-gateways/configuration","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}