![](/img/trans.png)
[英]How to check if a specific key exists in a specific node in Firebase real-time database with 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_pay : https://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.