{"id":15428928,"url":"https://github.com/wojtekwtf/payment-api-sandbox","last_synced_at":"2025-03-28T05:24:17.019Z","repository":{"id":111547889,"uuid":"278144285","full_name":"wojtekwtf/payment-api-sandbox","owner":"wojtekwtf","description":"💶   let's code some Elixir! Phoenix, simple endpoints, no database and some cardboard authentication. For more info scroll down the readme","archived":false,"fork":false,"pushed_at":"2020-07-09T17:24:41.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T06:24:11.857Z","etag":null,"topics":["elixir"],"latest_commit_sha":null,"homepage":"https://payment-sandbox.gigalixirapp.com/accounts/","language":"Elixir","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/wojtekwtf.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":"2020-07-08T16:46:53.000Z","updated_at":"2020-07-13T08:35:51.000Z","dependencies_parsed_at":"2023-03-09T12:00:15.871Z","dependency_job_id":null,"html_url":"https://github.com/wojtekwtf/payment-api-sandbox","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"4658dbbadb0b4b11f519c2c7d7ac2a3619b7a211"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekwtf%2Fpayment-api-sandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekwtf%2Fpayment-api-sandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekwtf%2Fpayment-api-sandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wojtekwtf%2Fpayment-api-sandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wojtekwtf","download_url":"https://codeload.github.com/wojtekwtf/payment-api-sandbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245974961,"owners_count":20703130,"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":["elixir"],"created_at":"2024-10-01T18:07:58.571Z","updated_at":"2025-03-28T05:24:16.997Z","avatar_url":"https://github.com/wojtekwtf.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Payment Sandbox\nA fun \u0026 short Elixir implementation of a CRUD payments API. Features include:\n- Historical transactions should be generated going back a few months for an account, with new transactions appearing over time\n- Repeat requests should return the same account information however the balances should behave like a real bank account and occasionally change\n- The sum of the transactions should match the balance of the account resource they are associated with\n- No databases or data stores — the data is generated in real time on server\n- Token authentication (however it doesn't identify the user – just check for token properties)\n## API structure\n\n### Authorization header\nSandbox requests require a header `Authorization`. Its value should be a 28 characters long string starting with `test_`.\nYou can obtain it with the `GET /token` endpoint.\n\n### Endpoints\n\n- `GET /token`\n  \n  Returns the token needed for the authentication of other requests\n- `GET /accounts`\n  \n  Returns a list of *account* objects.\n\n  🔑 requires *authorization* header.\n- `GET /accounts/:account_id`\n  \n  Returns a single *account* object.\n\n  🔑 requires *authorization* header.\n- `GET /accounts/:accounts_id/transactions`\n  \n  Returns a list of all *transaction* objects that are connected to the chosen\n  *account* object.\n  \n  🔑 requires *authorization* header.\n- `GET /accounts/:accounts_id/transactions/:transaction_id`\n  \n  Although it should return a single *transaction* object, it returns a list.\n  It works like that because the transactions are currently generated on the fly\n  and it's impossible to distinguish them by ids — they change all the time.\n  \n  🔑 requires *authorization* header.\n\n- `GET /dashboard/`\n\n  Opens the telemetry dashboard\n\n## Project setup\n### Local environment\n- Install dependencies with `mix deps.get`\n- Start Phoenix server with `mix phx.server`\n### Tests\n- Run tests `mix test`\n- Run tests with coverage report (91.1%) `mix test --cover`\n### Dialyzer\n- Run dialyzer (static analysis tool) with `mix dialyzer` \n\n## Further development\nThe project is not production ready. If I had more time to work on it, I would add:\n1. Pagination\n2. OpenAPI docs\n3. Real authentication\n4. Database with some dummy data\n5. 100% test coverage 😳\n6. Real /transactions/:id endpoint\n\n\n## Disclaimer\nThis has originally been a recruitment task for a fintech *company*. I didn't get the\njob, so the repo is now open sourced. You can probably tell by the old commits.\nI only anonymized it so search engines don't index it as *company* recruitment task\n\nI am low key satisfied with it and don't want the time devoted to the project to be lost.\nI think that's fair, but if you are from the *company* and think otherwise please let me know.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwojtekwtf%2Fpayment-api-sandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwojtekwtf%2Fpayment-api-sandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwojtekwtf%2Fpayment-api-sandbox/lists"}