Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğecko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Ğecko
Commits
5504cb0b
Commit
5504cb0b
authored
4 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
Add pop to inform if payment is ok or not
parent
c68e1520
No related branches found
No related tags found
1 merge request
!12
Implement transactions
Pipeline
#11584
failed
4 years ago
Stage: format
Stage: build_and_test
Stage: quality
Stage: package
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/models/history.dart
+9
-12
9 additions, 12 deletions
lib/models/history.dart
lib/screens/myWallets/unlockingWallet.dart
+30
-1
30 additions, 1 deletion
lib/screens/myWallets/unlockingWallet.dart
with
39 additions
and
13 deletions
lib/models/history.dart
+
9
−
12
View file @
5504cb0b
...
...
@@ -50,20 +50,14 @@ class HistoryProvider with ChangeNotifier {
return
barcode
;
}
void
pay
(
BuildContext
context
,
String
pinCode
)
{
Future
<
String
>
pay
(
BuildContext
context
,
String
pinCode
)
async
{
// MyWalletsProvider _myWalletProvider = MyWalletsProvider();
String
dewif
=
File
(
walletsDirectory
.
path
+
'/
${defaultWallet.chest}
/wallet.dewif'
)
.
readAsLinesSync
()[
0
];
List
dewifList
=
await
File
(
walletsDirectory
.
path
+
'/
${defaultWallet.chest}
/wallet.dewif'
)
.
readAsLines
();
String
dewif
=
dewifList
[
0
];
try
{
print
(
defaultWallet
.
derivation
);
print
(
payAmount
.
text
);
print
(
payComment
.
text
);
print
(
dewif
);
print
(
endPointGVA
);
print
(
pinCode
);
print
(
pubkey
);
DubpRust
.
simplePaymentFromTransparentAccount
(
await
DubpRust
.
simplePaymentFromTransparentAccount
(
accountIndex:
defaultWallet
.
derivation
,
amount:
double
.
parse
(
payAmount
.
text
),
txComment:
payComment
.
text
,
...
...
@@ -71,9 +65,11 @@ class HistoryProvider with ChangeNotifier {
gvaEndpoint:
endPointGVA
,
secretCode:
pinCode
,
recipient:
pubkey
);
return
"Success"
;
}
catch
(
e
)
{
log
.
e
(
"ERROR DUBP PAYMENTS"
);
log
.
e
(
e
);
return
"Payments errors:
$e
"
;
}
}
...
...
@@ -137,6 +133,7 @@ class HistoryProvider with ChangeNotifier {
return
pubkeyShort
;
}
// poka: Do99s6wQR2JLfhirPdpAERSjNbmjjECzGxHNJMiNKT3P
// Pi: D2meevcAHFTS2gQMvmRW5Hzi25jDdikk4nC4u1FkwRaU // For debug
// Boris: JE6mkuzSpT3ePciCPRTpuMT9fqPUVVLJz2618d33p7tn
// Matograine portefeuille: 9p5nHsES6xujFR7pw2yGy4PLKKHgWsMvsDHaHF64Uj25.
...
...
This diff is collapsed.
Click to expand it.
lib/screens/myWallets/unlockingWallet.dart
+
30
−
1
View file @
5504cb0b
...
...
@@ -24,6 +24,7 @@ class UnlockingWallet extends StatelessWidget {
bool
hasError
=
false
;
var
pinColor
=
Color
(
0xffF9F9F1
);
var
walletPin
=
''
;
String
resultPay
;
Future
<
NewWallet
>
get
badWallet
=
>
null
;
...
...
@@ -148,7 +149,9 @@ class UnlockingWallet extends StatelessWidget {
Navigator
.
pushNamed
(
formKey
.
currentContext
,
'/mywallets'
);
}
else
if
(
action
==
"pay"
)
{
print
(
"Go payments"
);
_historyProvider
.
pay
(
context
,
_pin
.
toUpperCase
());
resultPay
=
await
_historyProvider
.
pay
(
context
,
_pin
.
toUpperCase
());
await
_paymentsResult
(
context
);
}
}
},
...
...
@@ -160,4 +163,30 @@ class UnlockingWallet extends StatelessWidget {
)),
);
}
Future
<
bool
>
_paymentsResult
(
context
)
{
return
showDialog
<
bool
>(
context:
context
,
barrierDismissible:
true
,
// user must tap button!
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
title:
Text
(
resultPay
==
"Success"
?
'Paiement effecuté avec succès !'
:
"Une erreur s'est produite lors du paiement"
),
content:
SingleChildScrollView
(
child:
Text
(
''
)),
actions:
<
Widget
>[
TextButton
(
child:
Text
(
"OK"
),
onPressed:
()
{
Navigator
.
popUntil
(
context
,
ModalRoute
.
withName
(
'/'
),
);
},
),
],
);
},
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment