我是Angular新手,请考虑
我有一个 Angular 6 库,用户必须在其中设置设置,它会将用户重定向到新选项卡中的第三方 URL。执行后,新 URL 用户中的操作将被重定向到用户通过 POST 响应指定的返回 URL,我可以在 Chrome 控制台的“网络”选项卡中看到发布的数据。
但是在 Controller 中,我遇到了 cannot POST 错误。
返回网址http://localhost:4200/response
我不知道如何访问帖子响应并在 Controller HTML 文件中显示。
应用程序组件.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);
}
我想在 http://localhost:4200/response 中看到来自第三方 URL 的 Posted 数据
我怎样才能在 Angular 中做到这一点?
最佳答案
我认为 Angular 无法处理第三方 responses
。
您可以使用任何 API 端点来处理第三方``响应,然后在处理您的数据后,重定向到 Angular 应用。
假设您的 API 端点是 https://your-domain/payment-return-url
处理您的端点
并重定向到angular app。
https://stackoverflow.com/questions/57266380/
相关文章:
javascript - 如何在 Google TimeLine 图表中仅在一行中设置一个条形图(带
spring - 让 Spring RestTemplate 使用内存中的 pem 证书(不在磁盘上
python - 如何使用分类变量和数值变量绘制相关矩阵/热图
python-3.x - 属性错误 : 'NoneType' object has no attri
typescript - VS代码/w。在 TypeScript Monorepo 中更漂亮
svelte - 将选定的 Svelte 组件编译为 CustomElements
google-cloud-storage - 与 Google Cloud Storage 的连接池