{"id":19509139,"url":"https://github.com/garystanton/utrustcfml","last_synced_at":"2026-05-01T03:31:59.367Z","repository":{"id":240084028,"uuid":"274530163","full_name":"GaryStanton/UtrustCFML","owner":"GaryStanton","description":"Utrust CFML provides a wrapper for the Utrust crypto payments API.","archived":false,"fork":false,"pushed_at":"2020-06-28T17:05:11.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T22:46:20.595Z","etag":null,"topics":["api-wrapper","bitcoin","cfml","coldfusion","ethereum","lucee","payment-integration"],"latest_commit_sha":null,"homepage":"","language":"ColdFusion","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GaryStanton.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-23T23:34:34.000Z","updated_at":"2023-08-18T20:04:48.000Z","dependencies_parsed_at":"2024-05-16T17:08:23.840Z","dependency_job_id":null,"html_url":"https://github.com/GaryStanton/UtrustCFML","commit_stats":null,"previous_names":["garystanton/utrustcfml"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/GaryStanton/UtrustCFML","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaryStanton%2FUtrustCFML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaryStanton%2FUtrustCFML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaryStanton%2FUtrustCFML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaryStanton%2FUtrustCFML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GaryStanton","download_url":"https://codeload.github.com/GaryStanton/UtrustCFML/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GaryStanton%2FUtrustCFML/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259580903,"owners_count":22879746,"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":["api-wrapper","bitcoin","cfml","coldfusion","ethereum","lucee","payment-integration"],"created_at":"2024-11-10T23:11:07.216Z","updated_at":"2026-05-01T03:31:54.343Z","avatar_url":"https://github.com/GaryStanton.png","language":"ColdFusion","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utrust CFML\n\nUtrust CFML provides a wrapper for the Utrust crypto payments API.  \nObtain an API key from https://utrust.com/.  \nCheck out the Utrust API documentation here: https://docs.api.utrust.com/.\n\n## Installation\n```js\nbox install utrustcfml\n```\n\n## Examples\nCheck out the `/examples` folder for an example order and response.\n\n## Usage\nThe Utrust CFML wrapper consists of two models. \nThe `stores` model is a singleton, used to create your order. \nThe `webhook` model is a transient used to process the payload returned by the Utrust order callback.\n\nThe wrapper may be used standalone, or as a ColdBox module.\n\n### Standalone\n```cfc\nutrustStores = new models.stores(\n\tapiKey = 'UTRUST_KEY'\n);\n```\n\n### ColdBox\n```cfc\nutrust = getInstance(\"stores@UtrustCFML\");\n```\nalternatively inject it directly into your handler\n```cfc\nproperty name=\"utrust\" inject=\"stores@UtrustCFML\";\n```\n\nWhen using with ColdBox, you'll want to insert your API key into your module settings:\n\n```cfc\nutrustCFML = {\n\t\tapiKey = getSystemSetting(\"UTRUST_KEY\", \"\")\n\t,\twebhookSecret = getSystemSetting(\"UTRUST_WEBHOOK\", \"\")\n\t,\tenvironment = 'sandbox'\n}\n```\n\n\n### Create an order\nTo create an order, send your order JSON to the `createOrder` function and redirect to the URL provided by the API.\nMore details are available at the Utrust API documention.\n\n```cfc\norderData = {\n\t'reference' : 'Order_#createUUID()#',\n\t'amount' : {\n\t\t'total' : '2172.00',\n\t\t'currency' : 'GBP'\n\t},\n\t'return_urls' : {\n\t\t'return_url' : 'https://example.com/payment_successful.cfm',\n\t\t'cancel_url' : 'https://example.com/payment_cancelled.cfm',\n\t\t'callback_url' : 'https://example.com/payment_callback.cfm'\n\t},\n\t'line_items' : [\n\t\t{\n\t\t\t'sku' : 'ACF2018',\n\t\t\t'name' : 'Adobe ColdFusion 2018',\n\t\t\t'price' : '2172.00',\n\t\t\t'currency' : 'GBP',\n\t\t\t'quantity' : 1\n\t\t}\n\t]\n};\n\ncustomerData = {\n\t'first_name' : 'Your',\n\t'last_name' : 'Name',\n\t'email' : 'your@email.com',\n\t'country' : 'GB'\n}\n\norderResponse = utrust.createOrder(\n\t\torderData \t= orderData\n\t,\tcustomerData \t= customerData\n);\n\ntry {\n\tlocation url=\"#orderResponse.data.attributes.redirect_url#\" addtoken=\"false\";\n}\ncatch (any e) {\n\twriteOutput('Error creating order');\n\twriteDump(orderResponse);\n}\n```\n\n\n### Handle the callback payload\nCrypto payments take a while to be confirmed on the blockchain. \nOnce complete, Utrust will send confirmation to your callback URL.\nYou can use the webhook object to confirm the signature and read the data.\n\n```cfc\nutrustWebhook = new models.webhook(\n\t\twebhookSecret \t= 'WEBHOOK_SECRET'\n\t,\tpayload \t= ToString(getHTTPRequestData().content)\n);\n```\n\nOr using ColdBox:\n```cfc\nutrustWebhook = getInstance(name='webhook@utrustCFML', initArguments={payload = ToString(getHTTPRequestData().content)});\n```\n\nValidate signature - Will throw an error if the signature is invalid.\n```cfc\nutrustWebhook.validateSignature();\n```\n\n## Author\nWritten by Gary Stanton.  \nhttps://garystanton.co.uk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarystanton%2Futrustcfml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarystanton%2Futrustcfml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarystanton%2Futrustcfml/lists"}