是否有任何工作示例可以使用 Android Deep Link 集成 UPI 支付网关。我通过了 NPCI 规范并没有成功实施它。交易未完成。
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
Console.WriteLine("Request Code:" + requestCode);
}
private void RunUPI(string MobileNo)
{
var UPIUri = Android.Net.Uri.Parse("upi://pay?pa=xxx@xxxx&pn=xxxxxx&mc=null&tid=null&tr=test101&tn=This%20is%20test%20payment&am=10&mam=null&cu=INR&url=null");
Intent intent = new Intent();
intent.SetAction(Intent.ActionView);
intent.SetData(UPIUri);
var activities = PackageManager.QueryIntentActivities(intent, PackageInfoFlags.MatchDefaultOnly);
var isIntentSafe = activities.Count > 0;
if (true == isIntentSafe)
{
var chooser = Intent.CreateChooser(intent, "Pay With");
chooser.SetFlags(ActivityFlags.NewTask);
// Verify the intent will resolve to at least one activity
if (chooser.ResolveActivity(PackageManager) != null)
{
txnUPIRequestCode = 0;
StartActivityForResult(chooser, txnUPIRequestCode);
}
}
}