# telebirrjs

> hustle free telebirr integration package for node

Latest version **1.2.0** (published 2022-08-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install telebirrjs
pnpm add telebirrjs
yarn add telebirrjs
bun add telebirrjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-08-06 |
| First published | 2022-05-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 30 |
| Author | @vernu |
| Maintainers | vernu |
| Keywords | telebirr, payment, fintech, ethiopia |

## Links

- npm: https://www.npmjs.com/package/telebirrjs
- Repository: https://github.com/vernu/telebirrjs
- Homepage: https://github.com/vernu/telebirrjs#readme
- Issues: https://github.com/vernu/telebirrjs/issues
- npm.io page: https://npm.io/package/telebirrjs

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.27.2
- [node-rsa](https://npm.io/package/node-rsa.md) ^1.1.1

## Recent versions

- 1.2.0 (latest) — 2022-08-06
- 1.0.1 — 2022-05-04
- 1.0.0 — 2022-05-04

## README

# telebirrjs

hustle free telebirr integration package for node

## Usage

install the package `npm i telebirrjs`

```javascript
const Telebirr = require('telebirrjs')

const telebirr = new Telebirr({
  appId: 'YOUR TELEBIRR APP ID',
  appKey: 'YOUR TELEBIRR APP KEY',
  shortCode: 'TELEBIRR SHORT CODE',
  publicKey: 'YOUR TELEBIRR PUBLIC KEY',
})
const { success, response } = await telebirr.makePayment({
  paymentMethod: 'web | app',
  nonce: 'a unique random string ( should be unique for each request )',
  notifyUrl: 'callback url for payment confirmation',
  totalAmount: 4.5, // amount to charge
  outTradeNo: 'unique identifier (order no)',
  receiveName: 'company name',
  returnApp: 'com.example.app', // your application package name
  returnUrl: 'https://yourwebsite.com', // redirect url after payment completion'
  subject: 'payment for',
  timeoutExpress: '120', // valid for 2 hours
})
```

## Handling callback notifications

- once user completes the payment, you'll receive an encrypted plaintext on the `notifyUrl` you provided.

- Make sure the endpoint accepts `plaintext` request body

- you need to decrypt the text to get the transaction details

```javascript
const {
  msisdn, // the phone number from which the payment was done
  outTradeNo, // unique identifier provided when creating the payment
  totalAmount,
  tradeDate,
  tradeNo,
  tradeStatus,
  transactionNo,
} = telebirr.getDecryptedCallbackNotification(encryptedTextFromTelebirr)
```

---
_Source: https://npm.io/package/telebirrjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
