Search code examples
magentopayment-gatewaypayu

we are getting order in magento site if customer don't pay in “payment[payumoney india]” site


we are using payu in our "MAGENTO" site :

payu is "payment method" in india as like paypal.

It's really strange that payu official code did't work well

after customer buy the product, than he went to "checkout" page ,

he click on "place order" button , after that it will redirect to "payu site"

he did't paid money but he can close the payu site without paying, but than also we will recieve the "order".

we don't want this to be happen . in magento admin panel, we should get "order" only after customer paid the money in payu.

please help me to find solution.

thanks in advance.


Solution

  • You can see that in default scenario when you click the Place order button in magento, it places the order and it redirects to the payment gateway for example paypal or in your case payu.

    If the customer don't pay or in the case the payment is cancelled the order is placed but you can note that the payment status is pending payment.

    I think the requirement you are talking is quite difficult because as you can see the order is already placed when you click the place order button.

    I'm not sure about this but if you want to change this you can think like this.

    1. You need to remove the code which places the order on Place order button click.
    2. You need to determine that the payment is successfully done(I don't know how is this achieveable) but if you can do this than after you can execute the code that places the order.

    But i don't suggest this method but there may be other hidden complications.

    Another option would be check whether your payment method either provide express checkout method as paypal does. In this process after payment the customer is returned to the site and only places the order. This will simplify your job.

    But if your payment method doesn't provide this facility than i suggest to leave it the default way i.e order is placed but status is pending payment .

    Hope this will help.