{"id":21044588,"url":"https://github.com/tripflex/whmcs-purchaseorder","last_synced_at":"2025-05-15T17:32:58.054Z","repository":{"id":19447355,"uuid":"22691446","full_name":"tripflex/whmcs-purchaseorder","owner":"tripflex","description":"Custom WHMCS Gateway to allow clients to use Purchase Orders, and Auto Activate, using Custom Client Field","archived":false,"fork":false,"pushed_at":"2014-08-13T19:37:28.000Z","size":420,"stargazers_count":6,"open_issues_count":4,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T12:52:19.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tripflex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-06T17:20:59.000Z","updated_at":"2024-03-16T00:42:47.000Z","dependencies_parsed_at":"2022-08-21T09:40:58.624Z","dependency_job_id":null,"html_url":"https://github.com/tripflex/whmcs-purchaseorder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripflex%2Fwhmcs-purchaseorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripflex%2Fwhmcs-purchaseorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripflex%2Fwhmcs-purchaseorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripflex%2Fwhmcs-purchaseorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tripflex","download_url":"https://codeload.github.com/tripflex/whmcs-purchaseorder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254388349,"owners_count":22063034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T14:17:39.907Z","updated_at":"2025-05-15T17:32:57.525Z","avatar_url":"https://github.com/tripflex.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"WHMCS Purchase Order Gateway\n===================\n\nThis is an open source gateway file for WHMCS.  This module will allow you to add an option to your checkout page with \"Purchase Order\" as an option.  \n\nThis also includes an auto activation option as well.  By using a custom client checkbox field you can configure WHMCS to automatically approve/activate orders if the client has the checkbox enabled under their profile.\n\n### Installation\n---\nCopy the `purchaseorder.php` file to your WHMCS installation under `/modules/gateways/purchaseorder.php`, then go to WHMCS admin and enable Purchase Order as a Gateway.\n\n### Initial Setup\n---\nTo set everything up you will need to create at least 2 custom client fields.  One checkbox (also called tickbox) for **Approved to use Purchase Orders** and another checkbox (tickbox) field for **Auto Order Activation**.\n\nOnce you have created those fields go back to the **Gateway Configuration** and select the fields you created from the dropdown menu under the Purchase Order configuration.\n\nProfit!\n\n### Planned Features\n---\n\nFeature | Description\n--- | ---\nClient Group | Ability to auto activate based on client groups, if user is in client group auto activate.\nEnter PO # | Ability to enter a Purchase Order number at the end of checking out which will be tied to the order.\nCredit Limit | Set a specific credit limit for a client, once they reach that limit they can no longer auto activate\nAvailable Credit | Field that shows the available credit left for the client\n\nGot an idea?  Add an issue here on GitHub!\n\n\n### Screenshots\n---\n\n\nDescription | Screenshot\n--- | ---\nPurchase Order Gateway Configuration | ![](screenshots/gatewayconfig.png)\nClient Custom Fields | ![](screenshots/customclientfields.png)\nClient Profile Custom Fields | ![](screenshots/clientprofile.png)\nInvoice Page Output | ![](screenshots/invoicepage.png)\n\nFor reference here's a `var_dump` of the $param values:\n\n### `$params` values\n\nA general layout of the $params array is like the array below.\n\n\n```\nArray\n(\n    [companyname] =\u003e My Company\n    [systemurl] =\u003e https://yourhostingcompany.com\n    [langpaynow] =\u003e Pay Now\n    [convertto] =\u003e \n    [instructions] =\u003e \n    [name] =\u003e Purchase Order\n    [type] =\u003e Invoices\n    [visible] =\u003e on\n    [paymentmethod] =\u003e purchaseorder\n    [invoiceid] =\u003e 111111\n    [invoicenum] =\u003e 111111\n    [amount] =\u003e 10.00\n    [description] =\u003e My Company - Invoice #111111\n    [returnurl] =\u003e https://yourhostingcompany.com/viewinvoice.php?id=111111\n    [clientdetails] =\u003e Array\n        (\n            [userid] =\u003e 1\n            [id] =\u003e 1\n            [firstname] =\u003e Myles\n            [lastname] =\u003e McNamara\n            [fullname] =\u003e Myles McNamara\n            [companyname] =\u003e \n            [email] =\u003e name@domain.com\n            [address1] =\u003e 123 My Way\n            [address2] =\u003e \n            [city] =\u003e Orlando\n            [fullstate] =\u003e Florida\n            [state] =\u003e FL\n            [postcode] =\u003e 32808\n            [countrycode] =\u003e US\n            [country] =\u003e US\n            [statecode] =\u003e FL\n            [countryname] =\u003e United States\n            [phonecc] =\u003e 1\n            [phonenumber] =\u003e 4072224444\n            [phonenumberformatted] =\u003e +1.4072224444\n            [billingcid] =\u003e 13\n            [notes] =\u003e \n            [password] =\u003e \n            [twofaenabled] =\u003e \n            [currency] =\u003e 1\n            [defaultgateway] =\u003e purchaseorder\n            [cctype] =\u003e \n            [cclastfour] =\u003e \n            [securityqid] =\u003e 0\n            [securityqans] =\u003e \n            [groupid] =\u003e 1\n            [status] =\u003e Active\n            [credit] =\u003e 4.17\n            [taxexempt] =\u003e on\n            [latefeeoveride] =\u003e on\n            [overideduenotices] =\u003e on\n            [separateinvoices] =\u003e \n            [disableautocc] =\u003e on\n            [emailoptout] =\u003e 0\n            [overrideautoclose] =\u003e 0\n            [language] =\u003e \n            [lastlogin] =\u003e Date: 08/05/2014 16:39\u0026lt;br\u0026gt;IP Address: 2.2.2.2\u0026lt;br\u0026gt;Host: 2.2.2.2.res.bhn.net\n            [customfields1] =\u003e 12344\n            [customfields] =\u003e Array\n                (\n                    [0] =\u003e Array\n                        (\n                            [id] =\u003e 1\n                            [value] =\u003e 12344\n                        )\n\n                    [1] =\u003e Array\n                        (\n                            [id] =\u003e 36\n                            [value] =\u003e name@domain.com\n                        )\n\n                    [2] =\u003e Array\n                        (\n                            [id] =\u003e 37\n                            [value] =\u003e anotherfield\n                        )\n\n                    [3] =\u003e Array\n                        (\n                            [id] =\u003e 74\n                            [value] =\u003e 1234\n                        )\n\n                    [4] =\u003e Array\n                        (\n                            [id] =\u003e 75\n                            [value] =\u003e ABC123\n                        )\n\n                    [5] =\u003e Array\n                        (\n                            [id] =\u003e 76\n                            [value] =\u003e on\n                        )\n\n                    [6] =\u003e Array\n                        (\n                            [id] =\u003e 77\n                            [value] =\u003e $3,000\n                        )\n\n                )\n\n            [customfields2] =\u003e name@domain.com\n            [customfields3] =\u003e anotherfield\n            [customfields4] =\u003e 1234\n            [customfields5] =\u003e ABC123\n            [customfields6] =\u003e on\n            [customfields7] =\u003e $3,000\n            [domainemails] =\u003e 0\n            [generalemails] =\u003e 0\n            [invoiceemails] =\u003e 0\n            [productemails] =\u003e 0\n            [supportemails] =\u003e 0\n        )\n\n    [currency] =\u003e USD\n)\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftripflex%2Fwhmcs-purchaseorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftripflex%2Fwhmcs-purchaseorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftripflex%2Fwhmcs-purchaseorder/lists"}