mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-12 09:32:33 +00:00
fix for scanning QR codes
This commit is contained in:
parent
f8a2e4dd7c
commit
ca3bf2f3f5
1 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,5 @@
|
|||
import 'package:cw_nano/nano_util.dart';
|
||||
|
||||
class PaymentRequest {
|
||||
PaymentRequest(this.address, this.amount, this.note, this.scheme);
|
||||
|
||||
|
@ -10,11 +12,16 @@ class PaymentRequest {
|
|||
if (uri != null) {
|
||||
address = uri.path;
|
||||
amount = uri.queryParameters['tx_amount'] ?? uri.queryParameters['amount'] ?? "";
|
||||
note = uri.queryParameters['tx_description']
|
||||
?? uri.queryParameters['message'] ?? "";
|
||||
note = uri.queryParameters['tx_description'] ?? uri.queryParameters['message'] ?? "";
|
||||
scheme = uri.scheme;
|
||||
}
|
||||
|
||||
if (address.contains("nano")) {
|
||||
amount = NanoUtil.getRawAsUsableString(amount, NanoUtil.rawPerNano);
|
||||
} else if (address.contains("ban")) {
|
||||
amount = NanoUtil.getRawAsUsableString(amount, NanoUtil.rawPerBanano);
|
||||
}
|
||||
|
||||
return PaymentRequest(address, amount, note, scheme);
|
||||
}
|
||||
|
||||
|
@ -22,4 +29,4 @@ class PaymentRequest {
|
|||
final String amount;
|
||||
final String note;
|
||||
final String scheme;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue