{"id":29019438,"url":"https://github.com/xct007/midtrans-client","last_synced_at":"2025-06-26T00:30:28.515Z","repository":{"id":260801346,"uuid":"878085285","full_name":"xct007/midtrans-client","owner":"xct007","description":"Unofficial Midtrans Payment API Client | https://midtrans.com","archived":false,"fork":false,"pushed_at":"2025-06-09T13:33:43.000Z","size":475,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T10:07:39.237Z","etag":null,"topics":["midtrans","midtrans-nodejs","payment-gateway","payment-integration","payments"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/xct007.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":"2024-10-24T18:52:07.000Z","updated_at":"2025-05-14T22:40:54.000Z","dependencies_parsed_at":"2025-01-27T04:22:38.427Z","dependency_job_id":"c22a1b7b-984b-43b2-963b-44c9c8c85eec","html_url":"https://github.com/xct007/midtrans-client","commit_stats":null,"previous_names":["xct007/midtrans-client"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xct007/midtrans-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xct007%2Fmidtrans-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xct007%2Fmidtrans-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xct007%2Fmidtrans-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xct007%2Fmidtrans-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xct007","download_url":"https://codeload.github.com/xct007/midtrans-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xct007%2Fmidtrans-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261976504,"owners_count":23239140,"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":["midtrans","midtrans-nodejs","payment-gateway","payment-integration","payments"],"created_at":"2025-06-26T00:30:23.329Z","updated_at":"2025-06-26T00:30:28.376Z","avatar_url":"https://github.com/xct007.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unofficial Midtrans Client Library\n\nAn unofficial Midtrans Payment API Client Library for Node.js.\n\n[![npm version](https://img.shields.io/npm/v/@xct007/midtrans-client.svg)](https://www.npmjs.com/package/@xct007/midtrans-client)\n[![license](https://img.shields.io/npm/l/@xct007/midtrans-client.svg)](https://github.com/xct007/midtrans-client/blob/master/LICENSE)\n[![CI Status](https://github.com/xct007/midtrans-client/actions/workflows/nodejs-ci.yml/badge.svg)](https://github.com/xct007/midtrans-client/actions/workflows/nodejs-ci.yml)\n\n## Installation\n\n```bash\nnpm install @xct007/midtrans-client\n```\n\n## Usage\n\n### **import the library**\n\n```javascript\n// CommonJS\nconst MidtransClient = require(\"@xct007/midtrans-client\").default;\n\n// ES Modules\nimport MidtransClient from \"@xct007/midtrans-client\";\n```\n\n### **Initialize the client**\n\n```javascript\nconst { Core, Snap, Iris } = new MidtransClient({\n sandbox: true, // Set to false for production\n clientKey: \"YOUR_CLIENT_KEY\",\n serverKey: \"YOUR_SERVER_KEY\",\n throwHttpErrors: true,\n});\n```\n\n### **Core API Example**\n\n```javascript\nCore.charge({\n payment_type: \"bank_transfer\",\n transaction_details: {\n  order_id: \"order-id-\" + new Date().getTime(),\n  gross_amount: 10000,\n },\n bank_transfer: {\n  bank: \"bca\",\n },\n})\n .then((response) =\u003e {\n  console.log(\"Charge Response:\", response);\n })\n .catch((error) =\u003e {\n  console.error(\"Charge Error:\", error);\n });\n```\n\nExplore more Core API methods on [examples/core](examples/core).\n\n### **Snap API Example**\n\n```javascript\nSnap.create({\n transaction_details: {\n  order_id: \"order-id-\" + new Date().getTime(),\n  gross_amount: 10000,\n },\n})\n .then((response) =\u003e {\n  console.log(\"Snap Token:\", response.token);\n  console.log(\"Redirect URL:\", response.redirect_url);\n })\n .catch((error) =\u003e {\n  console.error(\"Snap Error:\", error);\n });\n```\n\nExplore more Snap API methods on [examples/snap](examples/snap).\n\n### **Iris API Example**\n\n```javascript\nIris.ping()\n .then((response) =\u003e {\n  console.log(\"Ping Response:\", response);\n })\n .catch((error) =\u003e {\n  console.error(\"Ping Error:\", error);\n });\n\n```\n\nExplore more Iris API methods on [examples/iris](examples/iris).\n\n## Documentation\n\nFor hands-on examples, please refer to the [examples](examples) directory.\n\nFor detailed API documentation, please refer to the [Midtrans API Documentation](https://docs.midtrans.com/reference).\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/xct007/midtrans-client).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- This library is unofficial and maintained by [xct007](https://github.com/xct007).\n- This library is inspired by the official [Midtrans Node.js Client](https://github.com/midtrans/midtrans-nodejs-client?tab=readme-ov-file#midtrans-client---node-js)\n- Special thanks to [Midtrans](https://midtrans.com) team.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxct007%2Fmidtrans-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxct007%2Fmidtrans-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxct007%2Fmidtrans-client/lists"}