Skip to content

A payment micro-service for Paynow, PayPal and Stripe

Notifications You must be signed in to change notification settings

takumade/papapi

Repository files navigation

Papapi

Papapi is a simple, fast, and powerful microservice for Paynow, PayPal and Stripe payments.

Think of it a box that is just responsible for handling payments. You can query the transactions, create new ones, and so on. You can get webhooks for PayPal, Stripe, and Paynow status updates.

Table of contents

Supported payment methods

  1. Paynow ✅
  2. PayPal ✅
  3. Stripe ✅

Tech Stack

  1. Hono
  2. Kysely - ORM
  3. Postgres - Database
  4. Axios - Webhooks

Architecture

Papapi uses a layered architecture

Papapi Architecture

Installation

  1. Clone it
$ git clone https://github.com/takumade/papapi
  1. Install dependencies
$ cd papapi
$ npm i
  1. Config your environment variables in config/default.json and config/production.json

  2. Run the server

$ npm run dev
  1. To Start a dev database
$ wasp db start

If you installed docker as root type this before running wasp db start

$ su - takunda

Add a user

Send a POST request to /users with the following data:

{
  "name": "John Doe",
  "email": "johndoe@email.com",
  "password": "password"
}

Get a token

Send a POST request to /authentication with the following data:

{
    "strategy": "password",
    "email": "johndoe@email.com",
    "password": "password"
}

Making authenticated requests

Set the Authorization header to the token (accessToken) you got from /authentication

{
    "Authorization": "Bearer <token>"
}

Contributing

My plan is to add the 3 gateways and document them well. Other gateways will be added in future versions. Or If you are stubborn and want to add a new gateway now, please contact me but make sure it doesnt do the same thing as the other gateways.

The last thing I want is end up with a very huge repo with a lot of gateways that does the same thing.

Papapi should be simple and stupid. It should be very good at what it does.

Please see CONTRIBUTING for details.

Special Thanks To

  1. iamngoni - Papapi uses his version of paynow sdk

Sponsorship

If you love Papapi, you can really help us by sponsoring us.

Todo

Features

  • Remove nodemon and uneeded code
  • Clean paynow
  • Add paynow mobile
  • Add paypal standard
  • Add stripe
  • Add stripe webhooks
  • Dockerize app
  • Standardize payment status

Testing

  • Test stripe
  • Test paynow mobile
  • Test paypal standard
  • Test stripe webhooks

Documentation

  • Add paypal example docs
  • Add paypal standard example docs
  • Add stripe example docs
  • Add paypal config docs
  • Add paynow config docs
  • Add stripe config docs

Quality Assurance

  • Write tests for paypal standard
  • Write tests for stripe
  • Write tests for paynow mobile
  • Add tests for stripe standard

To be continued...