3

I am new to Angular, please consider

I have an angular 6 library where user have to set up the settings and it will redirect the user to third party URL in a new tab. After performing, actions in new URL user will be redirected to the Return URL user has specified with POST response, I can see the posted data in Network Tab in Chrome Console.

But in the controller, I am getting cannot POST error.

Return URL http://localhost:4200/response

I have no idea how can I access the post response and show in the controller HTML file.

app.component.ts

constructor () {
    const _atom = new ProcessPaymentComponent();
    _atom.setURL('https://paynetzuat.atomtech.in/paynetz/epi/fts');
    _atom.setLoginid('197');
    _atom.setPassword('Test@123');
    _atom.setClientCode('NAVIN');
    _atom.setCurrency('INR');
    _atom.setAmount('50.00');
    _atom.setCustomerAddress('Address');
    _atom.setCustomerEmail('ankit@gmail.com');
    _atom.setCustomerMobile('1234567890');
    _atom.setCustomerName('Ankit');
    _atom.setProdId('NSE');
    _atom.setCustAcc('000000');
    _atom.setRequestHaskKey('KEY123657234');
    _atom.setResponseHashKey('KEYRESP123657234');
    _atom.setReturnUrl('http://localhost:4200/response');
    _atom.setTxnId('234');
    _atom.setTxnType('NBFundTransfer');
    _atom.setTxnsCamt('0');
    const url = _atom.payNow();
    // location.href = url;
    console.log(url);
} 

I want to see Posted data from third-party URL in http://localhost:4200/response

How can I do it in Angular?

Martin
  • 2,411
  • 11
  • 28
  • 30
Ankit S.
  • 387
  • 1
  • 5
  • 13
  • https://stackoverflow.com/a/31104952/3926717 the answer is for AngularJS but the same logic still applies – Martin Jul 30 '19 at 11:01
  • I am creating a library for Payment Gateway, Just like CCAvenues, We take the payment settings redirect to a URL created by library and post back to return_url, I think I have to use Node.Js for that but How can I implement it with library configurations that I have some doubt? – Ankit S. Jul 31 '19 at 06:59
  • Can Anyone guide me how can I do it with Node.JS ? – Ankit S. Jul 31 '19 at 07:28

1 Answers1

0

I think angular is not able to handle third-party responses.

You can use any API endpoint to handle third-party ``responses and then after processing your data, redirect to the angular app.

Suppose your API endpoint is https://your-domain/payment-return-url

Process your endpoint and redirect to the angular app.

Not A Bot
  • 2,474
  • 2
  • 16
  • 33
kishor
  • 1