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 #1001 NPR 3,250.00PendingPaid
  1. Order placed with eSewa / Khalti / Fonepay (Paymentsnp)
  2. Pay link: your-app.example/pay/1001?sig=…
  3. Customer paid on the Paymentsnp checkout
  4. Marked paid. Provider transaction ID 0001ABC…

How it works. Order first, payment right after.

  1. Order placed

    The customer picks the manual method, named something like eSewa / Khalti / Fonepay (Paymentsnp).

  2. Pay link

    The app creates a Paymentsnp checkout. A Pay now button goes in the confirmation email and the link in the order note.

  3. Paymentsnp checkout

    The customer pays with eSewa, Khalti or Fonepay. Paymentsnp verifies it with the provider.

  4. Marked paid

    The app calls orderMarkAsPaid in the Admin GraphQL API and writes the provider transaction ID to the note.

  5. 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.

HostAny 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 appScopes read_orders and write_orders, from an existing custom app or a new app in the Shopify Dev Dashboard
Staff permissionThe staff account that installs the app must be allowed to mark orders as paid
Store currencyNPR
Paymentsnp keyScopes checkout:create, checkout:read and payments:read. An np_test_ key means test mode, np_live_ means live
DependenciesNone 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.

  1. Host the app

    Copy .env.example to .env, fill it in and start the server.

  2. Create the Shopify app

    Give it read_orders and write_orders, install it, and set its credentials and SHOPIFY_SHOP_DOMAIN.

  3. Add the manual payment method

    Under Settings > Payments > Manual payment methods. Set SHOPIFY_PAYMENT_METHOD_NAME to exactly the same name.

  4. Set up Paymentsnp

    Enable a gateway, create the API key, add the webhook endpoint /webhooks/paymentnp and your storefront origin to allowed return origins.

  5. Register the Shopify webhook

    Run register-webhooks to subscribe orders/create to the app.

  6. 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.

  7. 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.

Run the app
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-webhooks
docker build -t paymentsnp-shopify .
docker run -d --env-file .env -v pnp-data:/data -p 8080:8080 paymentsnp-shopify
On Render or Railway, set the variables in their dashboard, use npm start and mount a disk at DATA_FILE. GET /health returns ok.

Troubleshooting. Symptoms and checks.

Common Shopify app issues
SymptomCheck
No pay link in the order noteThe 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 validPAY_LINK_SECRET in the email snippet differs from the app's, or the link was altered
No enabled, ready payment methodsEnable a ready gateway in Paymentsnp for the key's mode
Paid in Paymentsnp but not in ShopifyCheck 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 ShopifyAdd 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.