https://github.com/hansputera/midtrans-node
UnOfficial Midtrans Payment API Client for NodeJS | https://midtrans.com
https://github.com/hansputera/midtrans-node
midtrans midtrans-nodejs nodejs payment-gateway
Last synced: 6 months ago
JSON representation
UnOfficial Midtrans Payment API Client for NodeJS | https://midtrans.com
- Host: GitHub
- URL: https://github.com/hansputera/midtrans-node
- Owner: hansputera
- Created: 2021-04-20T14:51:54.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-10T02:57:49.000Z (about 3 years ago)
- Last Synced: 2025-03-28T12:38:31.885Z (12 months ago)
- Topics: midtrans, midtrans-nodejs, nodejs, payment-gateway
- Language: TypeScript
- Homepage: https://midtrans.com
- Size: 729 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🛒 Midtrans-Node
**Unofficial** Midtrans API wrapper for NodeJS. 💡 I created this to make it easier for me to integrate some of 🛠my projects using 🛒 Midtrans, the methods I created here are available from Rest API, Snap, and Iris API 😎.
# Quick Start
## 🤔 Installation
You need to install the package first!
> npm install hanif-midtrans-node
> yarn add hanif-midtrans-node
> pnpm install hanif-midtrans-node
## Usage 🤟
You just need a midtrans server key from https://dashboard.midtrans.com.
And, you're ready to code!
```ts
import { MidtransNode } from 'hanif-midtrans-node';
// new MidtransNode(isProduction, midtransServerKey);
const midtrans = new MidtransNode(false, 'YOUR MIDTRANS SERVER KEY'); // sandbox mode
midtrans.createTransaction({
transaction_details: {
gross_amount: 20000, // IDR 20.000
order_id: 'midtrans-node',
},
}).then(console.log).catch(console.error);
```
And, that's it! Also, docs is availabe on https://hansputera.github.io/midtrans-node
# License
MIT