Search code examples
angularpaymentpayu

Integrate PayU Payment Gateway in Angular2+ - How API will communicate Angular Client that Payment is complete?


I am trying to integrate PayU payment gateway with my angular 2 application. Below is a flow,

1) Angular application takes all necessary data related to payment as input Send POST request to PayU with the data.

2) User makes payment on PayU portal (Credit/Debit Cards, Net Banking, UPI etc...).

3) PayU sends POST request back to success url. Now since Angular is a client side framework, the POST request can not be handled at Angular side and the control has to go to API in this case. the success url is basically API endpoint to handle post payment response from PayU.

Question --> Once the API saves post payment response from PayU in database, how API will communicate to Angular client that payment is complete?


Solution

  • The issue has been resolved. Its required to handle the request at API side in a seperate popup window. Once the payment is done and status is returned back from Payment Gateway to website, the popup can be closed by user and then popup close event is to be captured. This will display transaction status page to the user once popup is closed.