diff --git a/vidaia/assets/data/rewards.json b/vidaia/assets/data/rewards.json index 90db181..f562a1c 100644 --- a/vidaia/assets/data/rewards.json +++ b/vidaia/assets/data/rewards.json @@ -19,7 +19,7 @@ "name": "5% discount", "image": "https://magitex.com.ua/image/catalog/goods/Emily/sertifikat-na-skidku-5-na-sleduyushchuyu-pokupku-1612282002.jpg", "url": "https://cumulus.migros.ch/de.html", - "cost": 25, + "cost": 1, "description": "Get a voucher for 5% off your next purchase with one of our partner organisations.", "seller_address": "this is the seller address" }, diff --git a/vidaia/lib/pages/home/redeem/redeem_info_page.dart b/vidaia/lib/pages/home/redeem/redeem_info_page.dart index e2dac56..b6380b6 100644 --- a/vidaia/lib/pages/home/redeem/redeem_info_page.dart +++ b/vidaia/lib/pages/home/redeem/redeem_info_page.dart @@ -187,10 +187,12 @@ class _RedeemInfoPageState extends State { widget.reward.cost.toString() + ' VID', style: TextStyle(fontSize: 16, color: PRIMARY), ), - onTap: () => transferVidar( + onTap: () { transferVidar( widget.reward.cost, '0x00bab3d8de4ebbefb07d53b1ff8c0f2434bd616d', - 'https://testnet.veblocks.net'), + 'https://testnet.veblocks.net'); + confirmPurchase(context); + } ), ), ) diff --git a/vidaia/lib/utils/wallet.dart b/vidaia/lib/utils/wallet.dart index 7f3b949..41eb042 100644 --- a/vidaia/lib/utils/wallet.dart +++ b/vidaia/lib/utils/wallet.dart @@ -189,3 +189,32 @@ showMnemonicWordsAlert(BuildContext context) async { }, ); } + +confirmPurchase(BuildContext context) { + // set up the buttons + Widget cancelButton = TextButton( + child: Text("OK"), + onPressed: () { + Navigator.pop(context); + Navigator.pop(context); + Navigator.pop(context); + }, + ); + + // set up the AlertDialog + AlertDialog alert = AlertDialog( + title: Text("Purchase Confirmed"), + content: Text("Thank you for your purchase. Your Reward will be sent to you by Email."), + actions: [ + cancelButton, + ], + ); + // show the dialog + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return alert; + }, + ); +}