1

I have an angular 2 application & I want to add payment in my app when user send new payment to my server, I return some data to user and user will send this data with RedirectUrl.

For example: localhost:4200/result to another url for example : x.com

and from there after payment x.com will redirect user to RedirectUrl Parameter sent before with POST method (the result of payment to one of my angualr 2 pages for verifiyng payment).when x.com redirect user but I get this message on a page

Cannot POST /result

what's the matter please help me.

John Conde
  • 217,595
  • 99
  • 455
  • 496
  • could you be a bit more clearer ? Do you want to redirect from an external website to your angular website ? – Nibin Apr 09 '18 at 09:17
  • yes exactly let me send you some link:https://stackoverflow.com/questions/44353067/read-post-form-in-angular-submitted-by-external-websites. if you understand tell me how can create a little server for my angular 2 application to handle this.notice i have another server that handle my service calls. – Ebrahim Gharejelu Apr 09 '18 at 10:45

1 Answers1

1

As @RomanPuchkovskiy pointed out,you may be out of choices to post the data to your angular application from an external website. You will have to catch your request on the server if you have one or create a server to handle this scenario. One option would be creating a nodejs server that helps you capture the request.Point the redirect URL to the nodejs server that you have created and let it process the data.Once you have performed all the needed operations in the nodejs server, make it to redirect to your specific route of your angular application.

This is a excellent article from scotch.io and malcoded.com. This would help you get some insight into your problem and help you crack the job.

Nibin
  • 3,922
  • 2
  • 20
  • 38