Giter Club home page Giter Club logo

chpternpmsdk's Introduction

chpter node

chpter Node Js

npm GitHub Scrutinizer code quality (GitHub/Bitbucket)

Seamlessly accept payments from anywhere in the world.

Install

npm install @kipling/chpter

NOTE

Add the following files to your .env (Ensure it is named as the examples below)

CHPTER_CLIENT_DOMAIN=
CHPTER_TOKEN=

eg.

CHPTER_CLIENT_DOMAIN=chpter.co
CHPTER_TOKEN=chpter_pk_2b4037c1c8

Usage

Payments

Mpesa Payment with STK Push

const chpter = require("@kipling/chpter");

customer = {
        "payment_method": "MPesa",
        "full_name": "Albert Chela",
        "location": "Nairobi",
        "phone_number": "254700000000",
        "email": "[email protected]"  };

products = [{
        "product_id": "08",
        "product_name": "HoodEez",
        "quantity": "1",
        "unit_price": "1" }];

amount = {
        "delivery_fee": "0",
        "discount_fee": "0",
        "total" : "1",
        "currency" : "kes"};

callback_details = {
        "transaction_reference":  "123456789123",
        "callback_url":  "https://eoeqwmbxsqqxo59.m.pipedream.net" };

var response = await chpter.mpesaPayment(customer,products,amount,callback_details);

Card Payment

const chpter = require("@kipling/chpter");

customer = {
        "payment_method": "MPesa",
        "full_name": "Albert Chela",
        "location": "Nairobi",
        "phone_number": "254700000000",
        "email": "[email protected]"    };

products = [{
        "product_id": "08",
        "product_name": "HoodEez",
        "quantity": "1",
        "unit_price": "1" }];

amount = {
        "card_number": "4242424242424242",
        "expiry_month": "08",
        "expiry_year": "2030",
        "cvc": "123"};

card_details = {
        "delivery_fee": "0",
        "discount_fee": "0",
        "total" : "1",
        "currency" : "kes"};

callback_details = {
        "transaction_reference":  "123456789123",
        "callback_url":  "https://eoeqwmbxsqqxo59.m.pipedream.net" };

var response = await chpter.cardPayment(customer,products,amount, card_details, callback_details);

Resources

Author

@kiplingkelvin

chpternpmsdk's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.