Paymentsnp for Shopify
A self-hosted app, version 1.0.0. Customers place a Shopify order with a manual payment method, get a Pay now link, and pay on Paymentsnp checkout with eSewa, Khalti or Fonepay. Once Paymentsnp verifies the payment, the order is marked paid automatically.
- Self-hosted on Node.js 20.6+
- Zero dependencies
- Re-checks open orders for 7 days
- Order placed with eSewa / Khalti / Fonepay (Paymentsnp)
- Pay link:
your-app.example/pay/1001?sig=… - Customer paid on the Paymentsnp checkout
- Marked paid. Provider transaction ID
0001ABC…
How it works. Order first, payment right after.
Order placed
The customer picks the manual method, named something like eSewa / Khalti / Fonepay (Paymentsnp).
Pay link
The app creates a Paymentsnp checkout. A Pay now button goes in the confirmation email and the link in the order note.
Paymentsnp checkout
The customer pays with eSewa, Khalti or Fonepay. Paymentsnp verifies it with the provider.
Marked paid
The app calls
orderMarkAsPaidin the Admin GraphQL API and writes the provider transaction ID to the note.Re-checks
Missed a webhook? Open orders are re-checked every 5 minutes for 7 days.
What it can and cannot do. Read both lists.
It can
- Create a Paymentsnp checkout for every NPR order placed with your Paymentsnp manual payment method
- Put a Pay now button in the order confirmation email, and the pay link in the order note so staff can resend it by SMS or WhatsApp
- Mark the order paid only after verification, with the exact amount, currency and test or live mode, all checked server-side
- Recover from missed webhooks by re-checking open orders every 5 minutes for 7 days
It cannot
- Show eSewa, Khalti or Fonepay as an option inside Shopify checkout
- Add a dynamic button to the thank-you or order status page. Use the payment instructions text and the email button instead
- Refund, capture partial payments, or handle non-NPR or multi-currency orders
- Support edited orders. If the total changes after the checkout was created, the customer sees "contact the store" and you collect the payment manually
Requirements. You host the app.
| Host | Any Node.js 20.6+ host with a public HTTPS URL and a persistent disk for one small JSON file: a VPS, Render, Railway, Fly.io or a Docker host. Run one instance |
|---|---|
| Shopify app | Scopes read_orders and write_orders, from an existing custom app or a new app in the Shopify Dev Dashboard |
| Staff permission | The staff account that installs the app must be allowed to mark orders as paid |
| Store currency | NPR |
| Paymentsnp key | Scopes checkout:create, checkout:read and payments:read. An np_test_ key means test mode, np_live_ means live |
| Dependencies | None beyond Node.js |
Setup. Seven steps from the guide.
Download the app from Dashboard > Downloads in Paymentsnp. Downloads are open to verified owner, administrator and developer users. The full guide in the package has every variable.
Host the app
Copy .env.example to .env, fill it in and start the server.
Create the Shopify app
Give it
read_ordersandwrite_orders, install it, and set its credentials andSHOPIFY_SHOP_DOMAIN.Add the manual payment method
Under Settings > Payments > Manual payment methods. Set
SHOPIFY_PAYMENT_METHOD_NAMEto exactly the same name.Set up Paymentsnp
Enable a gateway, create the API key, add the webhook endpoint
/webhooks/paymentnpand your storefront origin to allowed return origins.Register the Shopify webhook
Run
register-webhooksto subscribeorders/createto the app.Add Pay now to the confirmation email
Paste the Liquid snippet from the guide. It signs each link, so nobody can build links for other orders.
Test, then go live
Pay a test order with the Sandbox. For live, switch to an
np_live_key and a live webhook endpoint, enable live gateways and restart.
cd paymentsnp-shopify-app
cp .env.example .env # fill it in
node --env-file=.env server.js
# Subscribe orders/create to the app
node --env-file=.env server.js register-webhooksdocker build -t paymentsnp-shopify .
docker run -d --env-file .env -v pnp-data:/data -p 8080:8080 paymentsnp-shopifyTroubleshooting. Symptoms and checks.
| Symptom | Check |
|---|---|
| No pay link in the order note | The payment method name must match SHOPIFY_PAYMENT_METHOD_NAME exactly and the currency must be NPR. Run register-webhooks. The pay link still works without the webhook |
| This payment link is not valid | PAY_LINK_SECRET in the email snippet differs from the app's, or the link was altered |
| No enabled, ready payment methods | Enable a ready gateway in Paymentsnp for the key's mode |
| Paid in Paymentsnp but not in Shopify | Check the webhook endpoint and secret, and that the server clock is within 5 minutes. A needs-review note means the amount, mode or order state did not match |
| Customer not returned to Shopify | Add the store origin to Paymentsnp allowed return origins |
Questions about the Shopify app.
Why can't eSewa appear inside Shopify checkout?
Shopify allows that only for approved Payments Partners through its Payments Apps API. The app works around it with a manual payment method and a Pay now link sent right after the order.
Do you host the app for me?
No. It is self-hosted. Any Node.js 20.6+ host with a public HTTPS URL and a persistent disk works. Run a single instance.
What happens if a webhook is missed?
The app re-checks open orders every 5 minutes for 7 days and marks them paid once Paymentsnp has verified the payment.
Can it refund an order?
No. Refunds are made in the provider's own panel. The app does not refund, capture partial payments or handle non-NPR orders.