Skip to content

OFUZORCHUKWUEMEKE/nest-paystack

Repository files navigation

Nest Logo

Built with Nestjs and Paystack

Introduction

A NestJS API that incorporates Paystack payment processing and includes wallet functionality

This api was developed using

  • NodeJs (LTS version 21.5.0)
  • Nestjs
  • Mongoose
  • MongoDB

The tools listed below are needed to run this application to run effectively:

Node (LTS Version) Nest (LTS Version)

You can check the Node.js and npm versions by running the following commands.

Check node.js version

   node -v

Check npm version

   npm -v

Install Packages

    npm install

Set up env file

   touch .env 
  
  // Create the following
   PORT=
   MONGO_URL=
   PAYSTACK_SECRET_KEY=
   PAYSTACK_LIVE_PUB_KEY=
   JWT_SECRET=   
   JWT_EXPIRATION_TIME=
   TWO_FACTOR_AUTHENTICATION_APP_NAME=
   INITIATE_CHARGE=https://api.paystack.co/charge
   CREATE_CUSTOMER=https://api.paystack.co/customer
   CREATE_DEDICATED_ACCOUNT= https://api.paystack.co/dedicated_account
   TRANSFER_ENDPOINT="https://api.paystack.co/transfer"
   TRANSFER_RECIPIENT_ENDPOINT="https://api.paystack.co/transferrecipient"
   // set up Dedicated Nuban in your Paystack Integration contact support@paystack.com for creation of Virtual Account
      data: {
    status: false,
    message: 'Dedicated NUBAN is not available for your business',
    meta: {
      nextStep: 'You can send us an email at [email protected] to make a request for the service'
    },
    type: 'api_error',
    code: 'feature_unavailable'
  }
   Setup Webhook on your paystack dashboard to point to ${URL}/api/webhooks

Spin up Backend Server

     npm run start:dev 
Method Description Endpoints
POST Signup /api/signup
POST Login /api/login
POST Create Customer /api/customers
POST Create Paystack Customer /api/paystack
GET Fetch Bank List /api/paystack/bank-list
GET Resolve Bank Account /api/paystack/resolve-account-number
POST Create Beneficiary /api/paystack/transfer-recipient
POST Bank Transfer /api/paystack/transfer
POST Wallet Transfer /api/wallets/transfer
GET Get Transactions /api/transactions
POST Webhook Events /api/webhook

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published