我已将我的 ionic App 与 UPI 集成。一切都发生得很完美,就像所有 UPI 应用程序在付款时都被打开以供选择,但是当我输入我的 upi 密码时。我总是遇到错误,付款没有发生。尝试使用不同的 UPi 应用程序,但问题相同。请帮帮我
我的代码如下:-
import { Component, OnInit } from "@angular/core";
import { WebIntent } from "@ionic-native/web-intent/ngx";
import { Router } from "@angular/router";
@Component(
{
selector: "app-cart",
templateUrl: "./cart.page.html",
styleUrls: ["./cart.page.scss"],
})
export class CartPage implements OnInit {
totalPrice:number;
UPI_ID:string;
UPI_TXN_NOTE:string;
UPI_NAME:string;
TXN_Ref:string;
constructor(private webIntent: WebIntent,
private router : Router) {}
ngOnInit() {}
weekly() {
this.totalPrice = 10.00;
this.UPI_ID = '1234567890@upi';
this.UPI_NAME = 'test_KUMAR';
this.UPI_TXN_NOTE = 'Weekly%20Package';
this.TXN_Ref = '#Week001'
const options = {
action: this.webIntent.ACTION_VIEW,
url:'upi://pay?pa=' + this.UPI_ID + '&pn=' + this.UPI_NAME + '&am=' + this.totalPrice + '&tn=' + this.UPI_TXN_NOTE + '&tr=' + this.TXN_Ref
};
this.webIntent.startActivityForResult(options).then(
(success)=>{
console.log("Payment Succesfull",success);
},
err => {
alert('error block' + err);
}
);
}
我也在 appmodule.ts 中导入了 webintent .. 一切都完成了,但仍然会出现错误。请检查 。
应用程序错误:-