0.1.8 • Published 1 year ago

@kipling/chpter v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

chpter node

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": "albertchela@mail.com"  };

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": "albertchela@mail.com"    };

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

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago