项目作者: austinewuncler

项目描述 :
A NodeJS library to interact with Safaricom's Daraja M-Pesa API
高级语言: JavaScript
项目地址: git://github.com/austinewuncler/daraja.git
创建时间: 2018-11-13T05:11:18Z
项目社区:https://github.com/austinewuncler/daraja

开源协议:MIT License

下载


Daraja

Daraja

A type-safe NodeJS library for Safaricom’s Daraja API.

Documentation

Daraja Client’s full documentation is online at Daraja Client Documentation.

Installation

  1. npm install @daraja/client

or

  1. yarn add @daraja/client

Quick Start

A full set of examples can be found in the online documentation.

To get started, install @daraja/client and create an app on https://developer.safaricom.co.ke/MyApps to get your CONSUMER_KEY and CONSUMER_SECRET

Authorization

  1. import { DarajaCredentials } from '@daraja/client';
  2. const credentials = new DarajaCredentials({
  3. consumerKey: '{YOUR_CONSUMER_KEY}',
  4. consumerSecret: '{YOUR_CONSUMER_SECRET}',
  5. environment: 'sandbox',
  6. });