簡體   English   中英

如何檢查 UPI ID 在 flutter 中是否實時工作?

[英]How to check that UPI ID is working in real time or not in flutter?

我已設置驗證以檢查 UPI 的有效格式。

String validateUpiID(String value) {
  String pattern = '[a-zA-Z0-9.\-_]{2,256}@[a-zA-Z]{2,64}';
  RegExp regExp = RegExp(pattern);
  if (value.isEmpty) {
    return 'Please Enter UPI ID';
  } else if (!regExp.hasMatch(value)) {
    return 'Please Enter valid UPI ID';
  }
  return "";
}

但是現在我被困在那里,如何檢查輸入的 UPI 是否存在或處於工作模式?

使用 package upi_payhttps://pub.dev/packages/upi_pay

調用initialTransaction方法后,可以得到交易的狀態

Future doUpiTransation(ApplicationMeta appMeta) {
  final UpiTransactionResponse response = await UpiPay.initiateTransaction(
    amount: '100.00',
    app: appMeta.application,
    receiverName: 'John Doe',
    receiverUpiAddress: 'john@doe',
    transactionRef: 'UPITXREF0001',
    transactionNote: 'A UPI Transaction',
  );
  print(response.status);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM