Seamlessly accept payments from anywhere in the world.
npm install @kipling/chpter
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
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);
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);