I

have received requests to write article on How to implement PayUMoney Payment Gateway in PHP. PayUMoney payment gateway is one of the well known payment gateways in Indian. Click here to create account on paymoney. Remember you need to submit documents related to your business, bank details and your identity as well in soft and hard copy.



In this tutorial i will show you how to create payment 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 your 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 gopal@sgeek.org.

 

Video Tutorial

 

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

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

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

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

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

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

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

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

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="">