Skip to content

Unrealrojo234/PayApp

Repository files navigation

Intasend API


Getting started:

  • Clone this repo
  • And install the dependencies using npm
  • Have a server ready
  • Create an .env file

Installing dependencies:

    npm install

Setting up your .env file:

    VITE_REACT_API_PAY="<API to your server>"

    VITE_REACT_API_WEB_URL="<Current website domain e.g localhost:5173 or https://domainName for this website>"

How It works under the hood:

This App accepts an input number from a user and when the form is submited, the phone number is sent to the server and initialises an M-PESA stk push to the target phone number.

Why do we use the current website domain as part of .env?

This is a security feature from Intasend API, it will only allow requests from a this domain and not any other, hence protecting the app from attacks.


Feel free to moding the code to suit your current needs. HAPPY CODING!