Fully tested API integration of https://paps.sn with typescript
Gain some extra time by using this library if you're looking forward to integrate delivery system on your website.
cp sample.env .env
// modify .env to match your credentials at developers.paps.sn
// lint
yarn lint
// build before pushing to make sure everything is working
yarn build
// run the tests
yarn test
const Paps = require('node-paps')
const dotenv = require('dotenv')
dotenv.config()
const { NODE_ENV, PAPS_API_KEY, PAPS_API_URL } = process.env
const IN_PRODUCTION = NODE_ENV === 'production'
const paps = new Paps({
apiKey: PAPS_API_KEY,
test: !IN_PRODUCTION,
url: PAPS_API_URL
})
// use as you want
// paps.createPickup({...})
// paps.createPickupAndDelivery({...})
// paps.createDelivery({...})
// paps.viewTask({...})
// paps.viewTasks({...})
import Paps from 'node-paps'
import dotenv from 'dotenv'
dotenv.config()
const { NODE_ENV, PAPS_API_KEY, PAPS_API_URL } = process.env
const IN_PRODUCTION = NODE_ENV === 'production'
const paps = new Paps({
apiKey: PAPS_API_KEY,
test: !IN_PRODUCTION,
url: PAPS_API_URL
})
// use as you want
// paps.createPickup({...})
// paps.createPickupAndDelivery({...})
// paps.createDelivery({...})
// paps.viewTask({...})
// paps.viewTasks({...})
You want some doc ? Read the tests
- tests: cover all use cases
- get the support team at paps.sn to clarify some API response
- use mock instead of hitting real endpoint