{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Getting Started","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":"getting-started","__idx":0},"children":["Getting Started"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Payment gateway modules allow you to connect and integrate WHMCS with additional payment service providers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"types-of-payment-gateway","__idx":1},"children":["Types of payment gateway"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before you begin, you need to determine the type of payment gateway module you will be creating."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are 3 primary types of payment gateway module:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Third Party Gateways"]}," – Where a customer leaves the site to pay and returns when the payment process is complete. Examples include PayPal Standard, 2Checkout"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Merchant Gateways"]}," – Where a customer enters credit card details in WHMCS. The payment processes in the background. Can also include 3D Secure where the user leaves your site. Examples include PayPal Pro, Authorize.net AIM"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tokenised Gateways"]}," - A variation of a merchant gateway where credit card details are not stored locally. Tokenised Gateways can be further broken down into two groups:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["i. Remote Storage - Where the customer enters credit card details within WHMCS but the card details are not stored locally within the database instead being submitted immediately to the payment gateway and only a token returned by the gateway being stored."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ii. iFrame Gateways - Where the gateway payment checkout process is loaded within an iframe. Examples include SagePay Form, Quantum Vault"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"getting-started-1","__idx":2},"children":["Getting Started"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To get started, begin by downloading the appropriate sample module from our ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/whmcs"},"children":["GitHub page"]},"."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Third Party Gateway: https://github.com/WHMCS/sample-gateway-module"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Merchant Gateway: https://github.com/WHMCS/sample-merchant-gateway"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Take the gateway module example file within the repo and rename it to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["yourgatewayname.php"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The filename should be all lowercase and must start with a letter."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After renaming it, open the file and replace all occurrences of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["gatewaymodule_"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["yourgatewayname_"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All files within the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/modules/gateways/"]}," directory should contain code that adheres to the expected format/functions found within a WHMCS gateway module. Non-WHMCS related files, such as success/failure return pages or library files, should be located within a directory dedicated to the gateway module itself, for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/modules/gateways/yourgatewayname"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We recommend prefixing all functions within a gateway module with the filename to avoid naming conflicts."]}]}]},"headings":[{"value":"Getting Started","id":"getting-started","depth":1},{"value":"Types of payment gateway","id":"types-of-payment-gateway","depth":2},{"value":"Getting Started","id":"getting-started-1","depth":2}],"frontmatter":{"title":"Getting Started","seo":{"title":"Getting Started"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/payment-gateways/getting-started","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}