{"id":15838094,"url":"https://github.com/aldy505/midtrans-express-node-sample","last_synced_at":"2025-04-01T16:42:23.229Z","repository":{"id":128670303,"uuid":"329951726","full_name":"aldy505/midtrans-express-node-sample","owner":"aldy505","description":"Sample Express App for Midtrans Snap API","archived":false,"fork":false,"pushed_at":"2021-01-15T15:35:18.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T10:49:21.635Z","etag":null,"topics":["express-sample","midtrans","midtrans-nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/aldy505.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":"2021-01-15T15:35:10.000Z","updated_at":"2023-04-14T07:59:49.000Z","dependencies_parsed_at":"2023-04-17T12:29:18.354Z","dependency_job_id":null,"html_url":"https://github.com/aldy505/midtrans-express-node-sample","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/aldy505%2Fmidtrans-express-node-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldy505%2Fmidtrans-express-node-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldy505%2Fmidtrans-express-node-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aldy505%2Fmidtrans-express-node-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aldy505","download_url":"https://codeload.github.com/aldy505/midtrans-express-node-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246672614,"owners_count":20815428,"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":["express-sample","midtrans","midtrans-nodejs"],"created_at":"2024-10-05T16:00:35.928Z","updated_at":"2025-04-01T16:42:23.204Z","avatar_url":"https://github.com/aldy505.png","language":"JavaScript","readme":"# Midtrans Express Node Sample\n\n![GitHub branch checks state](https://img.shields.io/github/checks-status/aldy505/midtrans-express-node-sample/master?style=flat-square) ![GitHub issues](https://img.shields.io/github/issues-raw/aldy505/midtrans-express-node-sample?style=flat-square) ![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/aldy505/midtrans-express-node-sample?style=flat-square) ![GitHub](https://img.shields.io/github/license/aldy505/midtrans-express-node-sample?style=flat-square)\n\nThis is just a simple example of using Snap Midtrans payment without Midtrans Package for Node JS. Feel free to give a Pull Request or issues. Scroll down for [Indonesian version](#memulai) of this README.\n\n## Getting Started\n\n* Clone this repository\n* `npm install` to install all required dependencies.\n* Install MySQL Community Edition on your local machine\n* Change `.env.example` file to `.env`, and fill up the rest.\n* `npm run dev` to start the local server. Or `npm run dev:ts` to start Typescript server.\n\n## Code Overview\n\n### Dependencies\n\n* [Express](https://github.com/expressjs/express) - Server handling\n* [Cors](https://github.com/expressjs/cors) - CORS middleware for Express\n* [Dotenv](https://github.com/motdotla/dotenv) - Injecting `process.env` with contents from `.env` file\n* [Knex](https://github.com/knex/knex) - SQL Query builder\n* [Mysql](https://github.com/mysqljs/mysql) - Node JS driver for MySQL\n* [UUID](https://github.com/uuidjs/uuid) - Creation of UUID\n* [Axios](https://github.com/axios/axios) - HTTP Request library\n* [ISO-3166-1](https://github.com/ecrmnn/iso-3166-1) - For converting country name to ISO-3166-1 acceptable country code\n\n### Application Structure\n\n* `src/` - Application code in Javascript, with `index.js` being the entry point.\n* `typescript/` - Application code in Typescript, with `index.ts` being the entry point.\n* `test/` -  This folder contains test file for fetching data to the server.\n\n### NPM Commands\n\n* `npm run dev` - Starts local server with Javascript code (from `src/` folder)\n* `npm run dev:ts` - Starts local server with Typescript code (from `typescript/` folder)\n* `npm run lint` - Lint all files with ESLint\n* `npm run lint:fix` - Fixes all fixable errors with ESLint\n* `npm run build` - Compiles typescript files from `typescript/` into `dist/`\n\n### Response Schema\n\nThere is no response schema for success attemps as we refer directly from [Midtrans' Snap Response](https://snap-docs.midtrans.com/#response).\n\nFor failed attemps or 400 and 500 status code, the response schema should be:\n```json\n{\n  \"message\": \"Error message\"\n}\n```\n\n## Memulai\n\n* Clone repository ini\n* `npm install` untuk menginstall dependency yang diperlukan.\n* Install MySQL Community Edition pada komputer Anda\n* Ubah `.env.example` menjadi `.env`, dan isi file tersebut.\n* `npm run dev` untuk menjalankan local server. Atau `npm run dev:ts` untuk menjalankan Typescript server.\n\n## Gambaran Kode\n\n### Dependencies\n\n* [Express](https://github.com/expressjs/express) - Server utama\n* [Cors](https://github.com/expressjs/cors) - CORS middleware untuk Express\n* [Dotenv](https://github.com/motdotla/dotenv) - Memasukan `process.env` dengan konten dari file `.env`\n* [Knex](https://github.com/knex/knex) - SQL Query builder\n* [Mysql](https://github.com/mysqljs/mysql) - Node JS driver untuk MySQL\n* [UUID](https://github.com/uuidjs/uuid) - Menciptakan data UUID\n* [Axios](https://github.com/axios/axios) - HTTP Request\n* [ISO-3166-1](https://github.com/ecrmnn/iso-3166-1) - Untuk mengubah nama negara menjadi format ISO-3166-1\n\n### Application Structure\n\n* `src/` - Kode aplikasi dengan bahasa Javascript, dengan `index.js` menjadi entry point.\n* `typescript/` - Kode aplikasi dengan bahasa Typescript, dengan `index.ts` menjadi entry point.\n* `test/` -  Folder ini berisi file tes untuk mendapatkan data dari server.\n\n### NPM Commands\n\n* `npm run dev` - Menjalankan local server dalam bahasa Javascript (dari folder `src/`)\n* `npm run dev:ts` - Menjalankan local server dalam bahasa Typescript (dari folder `typescript/`)\n* `npm run lint` - Mencari kesalahan dengan ESLint\n* `npm run lint:fix` - Mengoreksi error yang bisa diselesaikan dengan ESLint\n* `npm run build` - Menghimpun file typescript dari `typescript/` ke `dist/`\n\n### Response Schema\n\nTidak ada skema response untuk percobaan yang sukses sebagaimana kami mengambil skema langsung dari [Midtrans Snap Response](https://snap-docs.midtrans.com/#response).\n\nUntuk percobaan yang gagal atau dengan status code 400 dan 500, skema response seharusnya menjadi:\n```json\n{\n  \"message\": \"Error message\"\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldy505%2Fmidtrans-express-node-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faldy505%2Fmidtrans-express-node-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faldy505%2Fmidtrans-express-node-sample/lists"}