I

have received requests from some visitors to write article on How to implement PayUMoney Payment Gateway in PHP. PayUMoney payment gateway is one of the well known payment gateways in India. Click here to create account on paymoney. You need to submit your documents related to your business, bank details and your identity verification documents as well to PayUMoney.

In this tutorial i will show you how to create payment gateway system with payumoney in PHP. PayUmoney developer support also provides ready made tutorials in PHP, paython, JAVA, JSP, RAILS, ASP.NET and VB.NET. Its easy and simple to integrate it in project.

 Demo Download

Step-1

Create the PayUmoney account at www.payumoney.com and follow the steps showing in Dashboard to get approval for your PayUMoney account. Once your account get approved, you can start real payments using PayUMoney.

Step-2

Contains PHP code and payment login. Replace below values with your own.
<Merchant Key> – with your PayUMoney merchant key
<Salt> – with your PayUMoney salt key

When you have tested completely, change development URL to live URL to make original payments.

$PAYU_BASE_URL = "https://test.payu.in";
to
$PAYU_BASE_URL = "https://payu.in";



success.php

Success surl (Success URL) file. In case payment succeeded, page will redirect on success.php page with $_POST method and success parameters. You can do further process of success payment here.

failure.php

Failure furl (Failure URL) file. In case of payment failure, page will redirect on failure.php page with post method and failure parameters. You can do further process of failed payment here.

For further queries in integration you can comment here or email me on .

 

Read More
Stripe Payment Integration in PHP
How To Setup PayPal Account
Introduction To PayPal Adaptive Payments
Introduction To Adyen Payment Platform
sfiletypechecker-JQuery Plugin Validate Input File

  1. Hi Gopal , I have implemented same kind in my application. i’m using codeigniter, when i click payment button its reloading the page and then redirecting to the payumoney gayeway page. can we do this without reloading the page???

  2. Hi Gopal, This is a very good tutorial though I am not able to get the source code. The downloaded folder is empty. Please fix it asap.

  3. Thank you Gopal for your immediate response… I have one more query regarding this. In this tutorial you have created the $hash but not used in $action. As I am also doing the same, the redirection page (https://test.payu.in/_payment) is showing error. Dont we have to send $hash or $posted in some way. On the other hand the demo you provided has redirected utl like this: https://test.payu.in/_payment_options?mihpayid=5694e7b6b4b913aef2450b018d14c22dd7abbb137dc500c5baa75c59d9c98d4d

  4. SORRY!
    We were unable to process your payment

    Error Reason
    Invalid amount

    Corrective Action
    Please ensure that you send all mandatory parameters in the transaction request to PayU.

    Mandatory parameters which must be sent in the transaction are:
    key, txnid, amount, productinfo, firstname, email, phone, surl, furl, hash
    .
    The parameters which you have actually sent in the transaction are:
    .

    Mandatory parameter missing from your transaction request are:
    key, txnid, amount, productinfo, surl, hash, firstname, email, phone.

    Please re-initiate the transaction with all the mandatory parameters.

  5. Okay I got it what I was doing wrong is the form which i had created was sent in body of the api request, but we need to send them into params of the request.
    Now one last query, what we need to send in “key” params. Because when I am sending merchantKey in “key” params it shows following error “Merchant key missing in Request”

    • You only need to send the merchant Key in ‘key’ parameter. You are going in right direction, just verify merchant key you are passing in ‘key’ parameter. Also verify that PayUMoney has either activated your account or not. If they have not activated your test account yet than go to payumoney.com and complete required steps from dashboard.

  6. Hello Sir,
    i want to integrate payment gateway in php core, but i never try this functionality… i also check on internet but i can’t understand anything… so can help me out???

    • Hello Pratibha,

      Payumoney payment gateway integration is quite easy. First of all read the article carefully and download source code by clicking on “Download” button. After downloading codebase, study tutorial by running in local system. You can study video tutorial on YouTube as well posted on sgeekorg channel. You may also comment your queries or errors if occurs here. I will glad to help you.

      Thank You

  7. Hello admin,
    Can we use pay u money without form. I don’t want to show value in hidden field anyone can change this.

  8. Hello Gopal,
    The tutorial is working for me but the only problem i m getting is, after the payment the page is not getting redirected to success.php or failure.php. Instead it is showing ‘page url cannot be found Error 404’ and the link in address bar is ‘https://test.payu.in/failure.php’ though all the files are in same folder. What can be the issue?

  9. Error Reason
    One or more mandatory parameters are missing in the transaction request.

    Corrective Action
    Please ensure that you send all mandatory parameters in the transaction request to PayU.

    Mandatory parameters which must be sent in the transaction are:
    key, txnid, amount, productinfo, firstname, email, phone, surl, furl, hash
    .
    The parameters which you have actually sent in the transaction are:
    key, txnid, amount, productinfo, surl, firstname, email, phone.

    Mandatory parameter missing from your transaction request are:
    hash.

    Please re-initiate the transaction with all the mandatory parameters.

  10. hello Gopal,
    I have a queastion that i have to upload data and a file on mysql server from an html page but the condition is file and data should be upload when the payment is success, so please help me for the same because am unable to do this things.

    Regards,
    Rahul Aggarwal

  11. Hi gopal thanks for code …
    I want to pass select tag option value to payumoney instead of udf1 so kindly suggest code for that.

    Thanks

    • Manoj,

      utf” stands for User Defined Field itself.

      Kindly, Render select option in the form and replace “udf1” string in $hashSequence variable with select option’s name that you have added in form. Now, The value you have selected will be pass to payumoney.

  12. how to get transaction details like transaction ID and it’s status after success page or in failure page.please help me

  13. Hai Sir,

    I am having a small of issue can you help me in even though i tried changing salt and merchant id
    SORRY!
    We were unable to process your payment

    Error Reason
    You seem to be using an incorrect key or salt value.

    Corrective Action
    Please note that this is PayU’s Test Environment – https://test.payu.in/_payment , but the key (T2ELVHi4) you are using is not a Test Environment key.

    Please ensure that you are using correct key and salt in the transaction request. Please note that key and salt are alphanumeric string values which are provided by PayU.

    Value of a sample key – gtKFFx
    Value of a sample salt – eCwWELxi

    In case you haven’t received the key/salt yet, please contact your Account Manager at PayU.

  14. I have form in which amount is calculated through a javascript. so i am facing issue to send total calculated amount to payumoney . So Kindly suggest what am i write in amount value

  15. i have got this while going to payment
    “Merchant has to use his own email to make the payment” could you please any one to help me.

    • A reason behind it is that your payUMonay account is not activated to receive live payments yet. Kindly contact to Support Team. Generally It takes 8-10 day to activate.

  16. Hello Gopal, just became alert to your blog through Google, and found that it is truly informative.

    I will appreciate if you continue this in future.

    Lots of people will be benefited from your writing. Cheers!

  17. Hi my friend! I want to say that this post is amazing, great written and include almost all significant infos. I’d like to see more posts like this.

  18. Hi Gopal,
    Based on radio button selection page should redirect to payumoney for payment can you please help me out

    • Hi Nikhil,

      You may insert payment details into database before payment having Payment Status field and update payment details and status on Payment Success or Fail (on success.php) .

  19. hi gopal joshi,
    thanx for your support
    I integrate payumoney to my website but in production environment it showing as

    SORRY!
    We were unable to process your payment
    Error Reason
    You seem to be using an incorrect key or salt value.
    Corrective Action

    Please note that this is PayU’s Live (Production) Environment – https://secure.payu.in/_payment, but the key (gBLFfgZM) you are using in the transaction is not a Live (Production) Environment key.

    Please ensure that if you are hitting PayU’s Production Environment, you must use only the Production (Live) key and salt in the transaction request – which have been shared with you by the PayU Account Manager.

    How to get the correct Live key/alias and salt?
    Your PayU Account Manager would have shared the Live key/alias and salt values with you on your registered email-ID. The mail would be in the below format:

    Dear Merchant,
    Your login details.
    Thank you for choosing PayUbiz.
    User Name:
    Login Alias:
    Password Link:

    I entered key and salt correctly and my payumoney account is activated for payments please help

    • Hi Nikhil,

      First of all please ensure that you have activated your payumoney account completely by login in payumoney website. If your account is activated properly than verify salt and key that you are using in app is for production (You should have two salt and key. One for production and another for development environment).

  20. $MERCHANT_KEY = “rjQUPktU”;
    $SALT = “e5iIg1jwi8”;
    $PAYU_BASE_URL = “https://test.payu.in”;

    IN FORM use one more parameter:-

  21. Dear Gopal,
    I have seen all the details as well as the video you have uploaded here. I am still stuck in this. Actually you have given sample pages but how to link them and where to add all the field. And what if i want to do custom install for one or more website with single page payment gateway. Which is some another domain, subdomain for all of my E commerce websites.
    Please give proper instructions and steps for the same.

  22. Sumit Ringane

    Hello sir,
    If U have any idea to implement payU money gateway code in asp.net MVC . Please forward me.

  23. Error Reason
    One or more mandatory parameters are missing in the transaction request.

    Corrective Action
    Please ensure that you send all mandatory parameters in the transaction request to PayU.

    Mandatory parameters which must be sent in the transaction are:
    key, txnid, amount, productinfo, firstname, email, phone, surl, furl, hash
    .
    The parameters which you have actually sent in the transaction are:
    key, txnid, amount, productinfo, surl, hash, firstname, email, phone.

    Mandatory parameter missing from your transaction request are:
    .

    Please re-initiate the transaction with all the mandatory parameters.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">