{"id":18634854,"url":"https://github.com/umran/bmlgo","last_synced_at":"2025-07-24T13:41:36.261Z","repository":{"id":57556091,"uuid":"260990651","full_name":"umran/bmlgo","owner":"umran","description":"A Go wrapper around the BML internet banking API","archived":false,"fork":false,"pushed_at":"2021-05-10T01:33:19.000Z","size":31,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T08:28:32.931Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umran.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":"2020-05-03T18:06:16.000Z","updated_at":"2022-04-20T22:02:16.000Z","dependencies_parsed_at":"2022-09-02T11:01:17.812Z","dependency_job_id":null,"html_url":"https://github.com/umran/bmlgo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umran%2Fbmlgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umran%2Fbmlgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umran%2Fbmlgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umran%2Fbmlgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umran","download_url":"https://codeload.github.com/umran/bmlgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239433013,"owners_count":19637799,"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-07T05:22:11.725Z","updated_at":"2025-02-18T07:45:42.024Z","avatar_url":"https://github.com/umran.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BMLGo\nGo bindings for the BML internet banking API\n\n## Getting Started\nInstall the package using the following command\n```\ngo get -u github.com/umran/bmlgo\n```\n\n## Usage\n### Instantiating a Client\nBefore interacting with the API a Client must be instantiated\n```go\nimport \"github.com/umran/bmlgo\"\n\nfunc main() {\n    client, err := bmlgo.NewClient(\"username\", \"password\")\n    if err != nil {\n        panic(\"failed to create client\", err)\n    }\n}\n```\n\n### Getting New Statement Items\nNew items posted to an account's statement can be retrieved by calling the client's `GetNewStatementItems` method.\nThis method returns either all items posted to the account within the past year (up to the current date) or all items posted after a specified item. This method also returns a cursor, which is the ID of the most recently posted item. The final argument is an optional filter over statement items and ensures that only items that pass the filter are returned.\n\nTo get all items posted after a specified item, we must provide the item's ID as the cursor\n```go\nitems, nextCursor, err := client.GetNewStatementItems(\"accountID\", \"cursor\", nil)\nif err != nil {\n    panic(\"failed to get new statement items\", err)\n}\n\nfor _, item := range items {\n    fmt.Println(item.Amount)\n}\n```\n\nTo get all items posted within the past year (up to the current date), we must leave the cursor blank\n```go\nallItems, nextCursor := client.GetNewStatementItems(\"accountID\", \"\", nil)\n```\n\nTo get all non-negative entries (inflows) that were posted after a specified item\n```go\nnonNegativeEntries, nextCursor := client.GetNewStatementItems(\"accountID\", \"cursor\", func(item *bmlgo.HistoryItem) bool {\n    return !item.Minus\n})\n```\n\n### Making Money Transfers\nMoney transfers can be initiated by calling the client's `InitiateTransfer` method. The amount of the transfer must be provided in Laari as an integer. The debit account and credit accounts must also be provided.\n\nTo complete a transfer we must call the client's `CompleteTransfer` method with the transfer form returned by `InitiateTransfer` and the OTP received via email or SMS.\n\nHere's an example where we transfer 1 Rufiyaa (100 Laari) from \"AccountA\" to \"AccountB\"\n```go\ntransferForm, err := client.InitiateTransfer(100, \"AccountA\", \"AccountB\")\nif err != nil {\n    panic(\"couldn't initiate transfer\", err)\n}\n\n// then when the OTP is available\ntransferRecord, err := client.CompleteTransfer(transferForm, \"OTP\")\nif err != nil {\n    panic(\"couldn't complete transfer\", err)\n}\n\nfmt.Println(transferRecord.Reference)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumran%2Fbmlgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumran%2Fbmlgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumran%2Fbmlgo/lists"}