# Online fee payments with your own Razorpay or PhonePe account

> Connect Razorpay or PhonePe so parents pay fee bills online, with the payment and receipt recorded automatically in Pathshala.

Source: https://pathshala.mjxtechnologies.com/docs/fees/online-payments/

Online payments let parents pay a fee bill from their phone by card, net banking or UPI, through **your own** payment gateway account. In Pathshala you connect Razorpay or PhonePe once; after that, every online payment is recorded against the bill and the receipt goes out by itself.

Money goes directly to your gateway account and from there to your bank. Pathshala never holds it.

## Before you start

- [ ] You are on **MJX Fees Management Pro** (the plan that includes "online payment with your own gateway"). See [Pricing](~/pricing).
- [ ] You are the **Owner** or an **Admin**. Nobody else can change gateway settings.
- [ ] You have a merchant account with Razorpay or PhonePe, and its keys:
  - **Razorpay:** Key ID and Key Secret, from your Razorpay dashboard under **Settings → API Keys**. Use test keys first — they do not charge real money.
  - **PhonePe:** Client ID and Client Secret, from your PhonePe Business dashboard under **Developer Settings → API Keys**.

> [!NOTE]
> Parents can already pay you by UPI on every plan: add a UPI method with your UPI ID or QR on [Payment methods](fees/payment-methods). Those payments are reported by the parent and confirmed by you on [Payment claims](fees/payment-claims). A gateway removes that manual check.

## How to connect your payment gateway

> [!PATH] Apps › Fees › Fees settings › Payment Methods › Online payments

![Online payments card on Payment Methods with the Connect account button marked](media/fees/online-payments-1.jpg "Apps › Fees › Fees settings › Payment Methods › Online payments")

1. Open **Apps › Fees › Fees settings › Payment Methods** and find the **Online payments** panel. Its badge says **Not connected**.
2. In **Which gateway?** choose **Razorpay** or **PhonePe**.
3. Paste the **Key ID** (PhonePe: **Client ID**). A Razorpay Key ID starts with `rzp_test_` or `rzp_live_`.
4. Paste the **Key Secret** (PhonePe: **Client Secret**).
5. Press [[Connect account]]. The button shows "Checking with Razorpay…" (or PhonePe) while Pathshala tests the keys with the gateway.

> [!SUCCESS]
> You see "Live keys connected. Parents can now pay fees online." (or the test-mode message), and the panel shows **Gateway**, a masked **Key ID**, **Updated**, and a badge: **Live** or **Test mode**.

Pathshala checks the keys against the gateway before saving, so a typing mistake is caught here and not by a parent trying to pay. The secret is encrypted before it is stored and is never shown again.

### Replace or disconnect

| Button | What it does |
|---|---|
| [[Replace keys]] | Opens the form again. Paste the new keys and press [[Save new keys]]. Use this to move from test keys to live keys. |
| [[Disconnect]] | Turns online payment off. Parents no longer see the online pay option until you connect again. |

Connecting a gateway replaces any gateway already connected — you can have one at a time.

## Instant payment confirmation (Razorpay webhook)

This box appears under a connected **Razorpay** account. It is optional and takes about two minutes. PhonePe has no webhook here, so the box is not shown for it.

It speeds up **payment links** — for example the registration-fee link your admissions flow sends on WhatsApp. Without the webhook, Pathshala still checks with Razorpay every few minutes, so nothing is missed; it is just slower. Fee bills paid from the parent page are confirmed the moment the parent finishes paying, webhook or not.

### Steps to set up the webhook

1. Under **Instant payment confirmation**, press [[Copy]] next to the address. It looks like `https://<your Pathshala address>/webhook/pay/<your-institute-code>`.
2. In your Razorpay dashboard, add a webhook with that address.
3. Tick **one** event only: `payment_link.paid`.
4. Type a webhook secret of your choice in the Razorpay form.
5. Back in Pathshala, paste the same secret into **Paste the secret you typed there** and press [[Save secret]].

> [!IMPORTANT]
> The webhook secret is the one **you** typed in the Razorpay webhook form. It is **not** your Key Secret.

To change it, press [[Replace secret]]. To stop using it, press [[Remove]] — payments are then confirmed within a few minutes instead of instantly.

## What the parent sees

### On the parent web page

Parents open their bill on your institute's parent page (the "view and pay" link in fee reminders opens it).

1. They press **Pay ₹…** on a bill. A **Pay fees** sheet opens.
2. With a gateway connected, they see **Pay ₹… now** with the line **Card, netbanking or UPI** (plus "test mode, no real money" on test keys).
3. **Razorpay** opens its checkout over the page. **PhonePe** takes the parent to PhonePe and back to a result page with **Back to fees**.
4. Below that, **OR PAY BY UPI** shows your UPI QR and **Open my UPI app**, if you have a UPI method.
5. **Already paid?** lets the parent report a payment made another way (see [Payment claims](fees/payment-claims)).

### In the MJX Parent app

- Each open bill has a [[Pay]] button. The parent can change the **Amount** to pay part of the bill; it can never be more than the balance.
- **PhonePe:** a **Pay with PhonePe** button opens the payment page.
- **Razorpay:** the app says card and net-banking payments are taken on the school's parent web page; **Pay by UPI** works in the app.
- **I have paid — tell the school** sends a payment claim.

### Messages the parent may see after paying

| Message | Meaning |
|---|---|
| Payment received. Your receipt is on its way to WhatsApp. | Recorded against the bill. |
| Payment is still processing | The bank has not confirmed yet; the fees page updates on its own. |
| Payment did not go through | Nothing was charged; the parent can try again. |
| Your payment may have gone through but we could not record it… | Rare. Check your gateway dashboard and record it by hand if the money arrived. |

## What happens after an online payment

- A payment is recorded against the bill with the method named **Online Payment** (type Online Gateway), the gateway's transaction ID, and the note "Paid online by parent".
- The bill's paid amount and status update straight away (Paid, or Partial if only part was paid).
- The receipt is sent to the family on WhatsApp, and the payment shows on [Payments](fees/collect-a-fee), the day-book and the fee dashboard like any other.
- The same gateway payment is never recorded twice, even if the parent refreshes.

> [!WARNING]
> With **PhonePe**, Pathshala records the payment when the parent returns to the result page. An attempt also appears on **Parent Payments** as a pending claim marked "Started on PhonePe — awaiting confirmation". If a parent closes the browser before returning, check the order in your PhonePe dashboard before you confirm that claim.

## Settlement and gateway charges

| Question | Answer |
|---|---|
| Where does the money go? | Into your own Razorpay or PhonePe account, then to your bank on the gateway's settlement schedule. |
| Does Pathshala add a charge on a fee bill? | No. The parent pays the bill amount. |
| Who pays the gateway's fee? | It is between you and your gateway, under your own agreement with it. |
| Refunds | A refund recorded in Pathshala does **not** send money back through the gateway. Return the money from your gateway dashboard too. See [Refunds](fees/refunds). |

## When MJX collects for you

Some accounts — usually institutes selling courses through MJX LMS — are set up so that **MJX collects** the money and passes the institute's share to its verified bank account. You cannot pick this yourself; MJX sets it.

On such an account:

- The **Online payments** panel says **MJX collects for this account, so there is no payment gateway of your own to connect here.**
- Open **Sidebar › Settings › Getting paid & KYC** (Owner and Admins). Bank account is its step 3.
- The page ("Getting paid & KYC") shows **Your steps**, **Your sales and your money**, **What you have sent**, and the form **Add your bank account**: who is being paid (legal name, email, mobile), where you are (address, PIN code, city, state) and your bank account (name on the account, account number, IFSC). Tick the confirmation and press [[Send my details]].
- Steps 1, 2 and 4 on the same page verify your identity and PAN through DigiLocker, or **Upload KYC document** (PAN and other papers), which MJX reviews.
- Pathshala keeps only the last four digits of the account number; you type it again if you change it.

> [!NOTE]
> On an account that uses its own gateway, **Getting paid & KYC** still has your KYC (steps 1, 2 and 4); step 3, the bank account, says **Not needed**, because your own payment method takes your money.

## Who can use online payments?

| Task | Who | Plan |
|---|---|---|
| Connect, replace or disconnect a gateway; set the webhook secret | Owner, Admin | MJX Fees Management Pro |
| Getting paid & KYC — bank account (step 3) | Owner, Admin, on accounts MJX collects for | — |
| Getting paid & KYC — identity, PAN, documents | Owner, Admin, every account | — |
| Pay a bill online | Parent (or the learner, at an institute without parents) | Your gateway must be connected |

## Tips

- Connect **test keys** first, pay one small bill yourself from the parent page, check the receipt, then press [[Replace keys]] and paste live keys.
- Keep a UPI method active as well. Parents who prefer their own UPI app still have a way to pay.
- Match your gateway's settlement report against the **Online Payment** lines in the day-book each week.

## Questions people ask

### Which payment gateways can my school connect?

Razorpay and PhonePe. You connect your own merchant account with its keys, and the money goes straight to your account.

### Does Pathshala keep any of the fee money?

No. With your own gateway, parents pay into your gateway account and the gateway settles to your bank. Pathshala adds no charge on top of a fee bill.

### Who pays the gateway's charges?

That is between you and your gateway. The parent pays the bill amount, and your gateway deducts its own fee under your agreement with it.

### Do I have to record online payments by hand?

No. When a parent finishes paying, Pathshala records the payment against the bill and sends the receipt on WhatsApp.

### Which plan has online payments?

Connecting your own gateway is part of MJX Fees Management Pro. UPI with your QR works on every plan.

### Can I test before taking real money?

Yes. Connect Razorpay test keys first. The panel shows Test mode and parents see that no real money is taken.
