Ionic framework 如何将PayUMoney Gate方式集成到Ionic 3中?

Ionic framework 如何将PayUMoney Gate方式集成到Ionic 3中?,ionic-framework,ionic3,Ionic Framework,Ionic3,事实上,我需要用Ionic 3实现PayUMoney。我知道,我没有合适的插件。但我需要将PayUMoney处理与我的服务器集成,并将确认信息发送给ionic 3。请指导我解决此问题。我不确定您是否已经找到解决方案,但这可能有助于其他人寻找答案 因此,让我们假设您拥有所有必需的post参数(您可以在本地以某种方式获得它,也可以从服务器获得它) 下一步是在AppBrowser中打开base64String并侦听事务的完成情况 const browser = this.iab.create(payS

事实上,我需要用Ionic 3实现PayUMoney。我知道,我没有合适的插件。但我需要将PayUMoney处理与我的服务器集成,并将确认信息发送给ionic 3。请指导我解决此问题。

我不确定您是否已经找到解决方案,但这可能有助于其他人寻找答案

因此,让我们假设您拥有所有必需的post参数(您可以在本地以某种方式获得它,也可以从服务器获得它)

下一步是在AppBrowser中打开base64String并侦听事务的完成情况

const browser = this.iab.create(payString, "_self", {
  location: 'no',
  clearcache: 'yes',
  hardwareback: 'no',
});
browser.on('loadstart').subscribe((event: InAppBrowserEvent) => {
  if (event.url === this.surl) {
    this.paymentSuccess();
  } else if (event.url === this.furl) {
    this.paymentFailure();
  }
});
你在函数paymentSuccess和paymentFailure中做什么取决于你自己

就是这样,应该可以根据需要工作。


如果要在“productinfo”中发送json数据,请进一步阅读

您需要将其转换为htmlsafe字符

所以,换掉这条线

<input type="hidden" name="productinfo" value="${this.productinfo}"/>


并具有将json数据转换为html安全字符的功能

private htmlEntities(str) {
    return String(str)
        .replace(/&/g, '&amp;')
        .replace(/</g, '&lt;')
        .replace(/>/g, '&gt;')
        .replace(/"/g, '&quot;');
}
private-htmlEntities(str){
返回字符串(str)
.更换(/&/g,“&;”)
.replace(//g',)
.替换(/“/g,”);
}

你有什么解决办法吗?什么都没有。?因为我正在搜索,所以没有将payUmoney集成到ionic 3框架的解决方案。
<input type="hidden" name="productinfo" value="${this.productinfo}"/>
<input type="hidden" name="productinfo" value="${this.htmlEntities(this.productinfo)}"/>
private htmlEntities(str) {
    return String(str)
        .replace(/&/g, '&amp;')
        .replace(/</g, '&lt;')
        .replace(/>/g, '&gt;')
        .replace(/"/g, '&quot;');
}