Skip to content
Docs
Get RestroPress

RestroPress PayUmoney Payment Gateway

Updated 2 min read
On this page

This plugin registers a gateway called PayUmoney in RestroPress and sends the customer to PayUmoney with a signed form. It is a small early-stage plugin (version 1.0.0, about 300 lines of code, placeholder author and website in the plugin header) and should be treated as a starting point, not a finished integration.

It is one of two near-identical plugins. The other one, restropress-payu-payment-gateway (PayU), has the same code with a different name and option keys; the only functional difference is the address the form is posted to. This plugin posts the payment form to a PayUmoney address whose path ends in chkMerchantTxnStatus, which reads like a transaction-status address rather than a payment page.

Requirements#

  • RestroPress (the plugin only starts if the RestroPress class exists).
  • A PayUmoney merchant account with a Merchant Key and Salt.

Installation#

Install the ZIP from Plugins › Add New › Upload Plugin and activate it. Then open RestroPress › Settings › Payment Gateways, tick PayUmoney in the gateway list and save. The settings are in the PayUmoney section of the same screen.

The plugin has no licence field, so there is no licence key to enter and no update checker in its code.

Settings#

PayUmoney settings section
SettingWhat it doesDefault
Merchant KeyYour PayUmoney Merchant Key.empty
SaltYour PayUmoney Salt, used to sign the request and to check the response. It is a plain text field.empty
Test ModeUses the test address instead of the live one.Off

How it works#

  1. The customer chooses PayUmoney at checkout. If the key or salt is empty, checkout shows "PayUmoney configuration is incomplete."
  2. The plugin creates the order with status pending and builds a form with the key, transaction ID (the order ID), amount, product info "RestroPress Order", first name, email, phone, a success URL and a failure URL (both ?rpress-listener=payumoney on your site, with status=success or status=failure) and a SHA-512 hash of those values plus the salt.
  3. The browser auto-submits the form to https://secure.payumoney.com/payment/payment/chkMerchantTxnStatus (or https://test.payumoney.com/payment/payment/chkMerchantTxnStatus in Test Mode).
  4. When PayUmoney posts back, the plugin recalculates the reverse hash from the salt and the posted values and compares it. If it matches and the posted status is success, the order is set to publish, the cart is emptied and the customer is redirected to the success page. Any other status marks the order failed and returns the customer to checkout with "Payment failed."

The plugin does not check the returned amount against the order, does not call PayUmoney to confirm the transaction, does not check the store currency, does not schedule retries and does not support refunds. Errors are written to the PHP error log only when WP_DEBUG is on.

Troubleshooting#

  • "PayUmoney configuration is incomplete." Merchant Key or Salt is empty.
  • "Hash verification failed." The hash PayUmoney sent did not match the one the plugin calculated. Check that the salt matches the environment you are using.
  • "Payment not found" / "Invalid response from PayUmoney". The return request had no usable transaction ID.
Was this page helpful?