1.1.1 • Published 2 years ago

node-shoket v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

node-shoket

A simple node wrapper for the shoket payment API, for more information on the API visit Shoket Official website.

Getting Started

Prerequisites

Installation

Installing with npm:

npm install node-shoket

Usage

const {makePayment, verifyPayment} = require('node-shoket');

//function used to make payment
makePayment(API_KEY,'5000','Sam Smith','user@mail.com','255612345678','Halotel');

//function used to verify payment
verifyPayment(API_KEY, '3j8zL7Tu7LhTMuR1S540f');

Testing

npm test

Documentation

  • The makePayment function is used to accept payments, the function has 6 parameters which are API_KEY, amount, customer_name, email, number_used and channel. The parameters are as follows in the function:
makePayment(API_KEY, amount, customer_name, email, number_used, channel);
ParameterRequiredDescription
API_KEYYesThis is the secret API key given on registering at the Shoket Official site
AmountYesThis is an amount in Tanzania shilling.
Customer NumberYesThis is a customer phone number which will be used to charge a customer.
EmailYesThis is a customer Email
ChannelYesMobile-provider name which is used by the customer phone number.
Customer namesYesThis is a customer full name
  • The verifyPayment is used to verify the transaction conducted, the function has 2 parameters which are the API_KEY and the transaction reference. The parameters are arranged as follows:
verifyPayment(API_KEY, transaction_reference);
ParameterRequiredDescription
API_KEYYesThis is the secret API key given on registering at the Shoket Official site
Transaction ReferenceYesThis is the reference of the transaction performed already.

Contributing

Please see CONTRIBUTING for details.

Credits

License

This project is licensed under the MIT License.

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago