3

I am integrating PayUMoney app in my mean stack application.Now after payment is successfully done payumoney calls my success api. Now i need to render the response of this api call to my angularjs view page.

How can i achieve this?

Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
Atul Agrawal
  • 1,474
  • 5
  • 22
  • 41

1 Answers1

4

Consider the response returned from the PayUMoney are a few parameters like success=true&transactionId=2342418083&ref=18.

So when you receive these parameters in your server side code, redirect the user to the Angular page with those as query parameter like:

// TODO this is a Grails way of redirect, do according to your app
redirect(uri: "/#/payment/success?success=true&transactionId=2342418083&ref=18")

Now, in the Angular controller of payment/success page, you can use $location service to get those parameters:

fooApp.controller("PaymentSuccessController", function($scope, $location) {
    var params = $location.search();
    // Now use these paramters
    console.log(params.transactionId == "2342418083");
});
Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121