{"id":20039049,"url":"https://github.com/defra/rpa-mit-payment","last_synced_at":"2025-08-23T06:05:13.702Z","repository":{"id":177574851,"uuid":"660270895","full_name":"DEFRA/rpa-mit-payment","owner":"DEFRA","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-02T11:31:57.000Z","size":172,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-02T06:29:47.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DEFRA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-06-29T16:10:54.000Z","updated_at":"2024-05-02T11:32:02.000Z","dependencies_parsed_at":"2024-11-19T21:00:12.527Z","dependency_job_id":null,"html_url":"https://github.com/DEFRA/rpa-mit-payment","commit_stats":null,"previous_names":["defra/est-mit-payment","defra/rpa-mit-payment"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/DEFRA/rpa-mit-payment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-payment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-payment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-payment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-payment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/rpa-mit-payment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-payment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271745661,"owners_count":24813515,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-13T10:35:09.877Z","updated_at":"2025-08-23T06:05:13.673Z","avatar_url":"https://github.com/DEFRA.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Payment Generation\r\n\r\nThis repository contains an azure function with a Service Bus trigger, the messages to the service bus are sent via other services, its use is as a method of sending complete validated invoices to the system that can produce a payment.\r\n\r\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=est-mit-payment\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=est-mit-payment) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=est-mit-payment\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=est-mit-payment) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=est-mit-payment\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=est-mit-payment) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=est-mit-payment\u0026metric=ncloc)](https://sonarcloud.io/summary/new_code?id=est-mit-payment)\r\n\r\n## Requirements\r\n\r\nAmend as needed for your distribution, this assumes you are using windows with WSL. \r\n\r\n- \u003cdetails\u003e\r\n    \u003csummary\u003e .NET 8 SDK \u003c/summary\u003e\r\n    \r\n    #### Basic instructions for installing the .NET 8 SDK on a debian based system.\r\n  \r\n    Amend as needed for your distribution.\r\n\r\n    ```bash\r\n    wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb\r\n    sudo dpkg -i packages-microsoft-prod.deb\r\n    sudo apt-get update \u0026\u0026 sudo apt-get install -y dotnet-sdk-8.0\r\n    ```\r\n\u003c/details\u003e\r\n\r\n- \u003cdetails\u003e\r\n    \u003csummary\u003e Azure Functions Core Tools \u003c/summary\u003e\r\n    \r\n    ```bash\r\n    sudo apt-get install azure-functions-core-tools-4\r\n    ```\r\n\u003c/details\u003e\r\n\r\n- [Docker](https://docs.docker.com/desktop/install/linux-install/)\r\n- Service Bus Queue\r\n\r\n---\r\n\r\n## Local Setup\r\n\r\nTo run this service locally complete the following steps.\r\n### Create Local Settings\r\n\r\nCreate a local.setttings.json file with the following content.\r\n\r\n```json\r\n{\r\n    \"IsEncrypted\": false,\r\n    \"Values\": {\r\n        \"AzureWebJobsStorage\": \"UseDevelopmentStorage=true\",\r\n        \"FUNCTIONS_WORKER_RUNTIME\": \"dotnet-isolated\"\r\n    }\r\n}\r\n```\r\n\r\n### Set up user secrets\r\n\r\nUse the secrets-template to create a \"secrets.json\" in the same folder location.\r\n\r\nThe schemes key should be a comma separated list\r\n\r\n```json\r\n{\r\n\t\"Schemes\": \"Scheme1,Scheme2\"\r\n}\r\n```\r\n\r\nOnce this is done run the following command to add the projects user secrets\r\n\r\n```bash\r\ncat secrets.json | dotnet user-secrets set\r\n```\r\n\r\nThese values can also be added to the local settings file, but the preferred method is via user secrets.\r\n### Startup\r\n\r\nTo start the function locally.\r\n\r\n```bash\r\nfunc start\r\n```\r\n\r\nIf running multiple function apps locally you might encounter a port conflict error as they all try to run on port 7071. If this happens use a command such as this entering a port that is free.\r\n\r\n```bash\r\nfunc start --port 7072\r\n```\r\n\r\n---\r\n## Usage / Endpoints\r\n\r\n### Payment Creation\r\n\u003e Function Trigger: ServiceBusTrigger\r\n\u003e #### Endpoint\r\n\u003e Uses the Service Bus queue trigger named from the environment variable `%PaymentQueueName%`\r\n\u003e #### Action\r\n\u003e Receives payment requests and processes them. If the request is valid, it sends it forward using the service bus after performing some validations. Errors during processing are logged, and messages are sent to an event queue service indicating the status of the payment processing.\r\n\u003e \r\n\u003e Below is an **encoded** example message that can be added to the service bus queue to test functionality. Json messages format must be encoded as base64 to be accepted.\r\n\u003e \r\n\u003e ```base64\r\n\u003eeyAic2NoZW1lVHlwZSI6ICJBRCIsICJwYXltZW50UmVxdWVzdHNCYXRjaGVzIjogWyB7ICJpZCI6ICIxIiwgImFjY291bnRUeXBlIjogIkFEIiwgIm9yZ2FuaXNhdGlvbiI6ICJGR0giLCAic2NoZW1lVHlwZSI6ICJBRCIsICJwYXltZW50VHlwZSI6ICJBUCIsICJwYXltZW50UmVxdWVzdHMiOiBbIHsgInBheW1lbnRSZXF1ZXN0SWQiOiAiMiIsICJmcm4iOiA1Njc4OTA0MywgInNiaSI6IDQ1NjcsICJ2ZW5kb3IiOiAiQSIsICJzb3VyY2VTeXN0ZW0iOiAic291cmNlU3lzdGVtIiwgIm1hcmtldGluZ1llYXIiOiAyMDIzLCAiY3VycmVuY3kiOiAiR0JQIiwgImRlc2NyaXB0aW9uIjogIkRlc2NyaXB0aW9uIiwgIm9yaWdpbmFsSW52b2ljZU51bWJlciI6ICIyM0VSNTYiLCAib3JpZ2luYWxTZXR0bGVtZW50RGF0ZSI6ICIyMDIzLTEwLTE5VDEzOjExOjE3LjU4NDg4KzAxOjAwIiwgInJlY292ZXJ5RGF0ZSI6ICIyMDIzLTEwLTE5VDEzOjExOjE3LjU4NDg5NiswMTowMCIsICJpbnZvaWNlQ29ycmVjdGlvblJlZmVyZW5jZSI6ICJFUlE1NjciLCAicGF5bWVudFJlcXVlc3ROdW1iZXIiOiAzNDU2NywgImFncmVlbWVudE51bWJlciI6ICIxMjM0NSIsICJ2YWx1ZSI6IDIsICJkdWVEYXRlIjogInN0cmluZyIsICJpbnZvaWNlTGluZXMiOiBbIHsgInZhbHVlIjogMywgInNjaGVtZUNvZGUiOiAiRDRFUlQiLCAiZGVzY3JpcHRpb24iOiAiVGhpcyBpcyBhIGRlc2NyaXB0aW9uIiwgImZ1bmRDb2RlIjogIjJBREMiLCAibWFpbkFjY291bnQiOiAiQWNjb3VudEEiLCAibWFya2V0aW5nWWVhciI6IDIwMjIsICJkZWxpdmVyeUJvZHkiOiAiRGVsaXZlcnlCb2R5IiB9IF0gfSBdLCAic3RhdHVzIjogIkEiLCAicmVmZXJlbmNlIjogIjEyMyIsICJjcmVhdGVkIjogIjIwMjItMTEtMDVUMDA6MDA6MDAiLCAidXBkYXRlZCI6ICIyMDIzLTEwLTE5VDEzOjExOjE3LjU4NDk3OCswMTowMCIsICJjcmVhdGVkQnkiOiAidXNlcm5hbWUxIiwgInVwZGF0ZWRCeSI6ICJ1c2VybmFtZTEiIH0gXSB9\r\n\u003e ```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Frpa-mit-payment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Frpa-mit-payment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Frpa-mit-payment/lists"}