Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionia #437

Merged
merged 64 commits into from
Jul 28, 2022
Merged

Ionia #437

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5314d49
Initial ionia service
mkyq May 30, 2022
de0ca1d
Ionia manage card UI (#374)
godilite Jun 15, 2022
3753b16
Add ionia merchant sevic
mkyq Jun 16, 2022
716c082
Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia
mkyq Jun 16, 2022
6c947cd
Add anypay. Add purschase gift card.
mkyq Jun 20, 2022
44efd56
display virtual card (#385)
godilite Jun 21, 2022
aab6d89
Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia
mkyq Jun 21, 2022
06a6d8d
Remove IoniaMerchantService from IoniaViewModel
mkyq Jun 21, 2022
76fe14c
Add hex and txKey for monero pending transaction.
mkyq Jun 22, 2022
1447ea3
Changed monero version and monero repo to cake tech.
mkyq Jun 22, 2022
657265a
Add anypay payment. Add filter by search for ionia, add get purchased…
mkyq Jun 28, 2022
1d1bffa
Fix for get transactions for hidden addresses for electrum wallet
mkyq Jun 28, 2022
e9b27f9
Add ionia categories.
mkyq Jun 29, 2022
0a7f8bf
Add anypay commited info for payments.
mkyq Jun 29, 2022
03800e0
Update UI with new fixes (#400)
godilite Jun 29, 2022
def28ba
Change ionia base url. Add exception throwing for error messaging for…
mkyq Jun 30, 2022
828d14b
Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia
mkyq Jun 30, 2022
73cbdc4
CW-102 fix logic for ionia issues (#403)
godilite Jul 6, 2022
f320e74
refactor tips (#406)
godilite Jul 7, 2022
28ff890
Cw 115 implement gift cards list for ionia (#405)
godilite Jul 7, 2022
d85cc72
Fixes for getting of purchased gift cards.
mkyq Jul 7, 2022
2a0206c
Implement gift card details screen (#408)
godilite Jul 11, 2022
abb6ff4
Add redeem for ionia gift cards
mkyq Jul 14, 2022
b9cc776
Fix navigation after ionia opt redirection.
mkyq Jul 14, 2022
ce47984
Fix update gift cards list.
mkyq Jul 14, 2022
3b61edc
Add payment status update for ionia.
mkyq Jul 18, 2022
d47887e
Add usage instruction to gift card.
mkyq Jul 18, 2022
8ad3a40
Add copy for ionia gift card info.
mkyq Jul 18, 2022
effe163
Change version for Cake Wallet ios.
mkyq Jul 18, 2022
c8b18ad
Add localisation (#414)
godilite Jul 19, 2022
9d3e265
Fixes for fiat amounts for ionia.
mkyq Jul 19, 2022
6e79b3a
Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia
mkyq Jul 19, 2022
622914f
CW-128 marketplace screen text changes (#416)
godilite Jul 19, 2022
61bf2f1
UI fixes for ionia.
mkyq Jul 20, 2022
4eedc72
UI fixes for ionia. (#421)
mkyq Jul 20, 2022
c1fbd74
CW-129 ionia welcome screen text changes (#418)
godilite Jul 20, 2022
8b4fa5a
Cw 133 (#422)
mkyq Jul 20, 2022
ddedba6
Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia
mkyq Jul 20, 2022
c23c648
Fix signup page (#419)
godilite Jul 20, 2022
100bb0f
Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia
mkyq Jul 20, 2022
f849e96
Changed tips for ionia.
mkyq Jul 20, 2022
32f5a79
Cw 132 (#425)
mkyq Jul 20, 2022
24d6a30
Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia
mkyq Jul 20, 2022
1d4a9f9
Cw 131 (#426)
mkyq Jul 20, 2022
720caa6
Merge branch 'ionia' of github.com:cake-tech/cake_wallet into ionia
mkyq Jul 20, 2022
69577e1
Merge branch 'main' of github.com:cake-tech/cake_wallet into ionia
mkyq Jul 21, 2022
bfa904f
Change ionia heading font style (#427)
godilite Jul 21, 2022
83245b2
Fix for AddressResolver in di
mkyq Jul 21, 2022
41064b4
Changed build number for Cake Wallet ios.
mkyq Jul 21, 2022
58d135e
fix currency format for card details and routing for mark as redeemed…
godilite Jul 22, 2022
83d5c17
fix terms and condition overflow in ionia (#430)
godilite Jul 22, 2022
0b60a03
Remove IoniaTokenService
mkyq Jul 26, 2022
02ac690
Change api for ionia to staging
mkyq Jul 26, 2022
232ed89
Update versions for Cake Wallet for android and ios.
mkyq Jul 26, 2022
1cfd1df
Fixes for instructions. Remove diplay error on payment status screen.
mkyq Jul 26, 2022
2bc5b70
Change build versions for Cake Wallet
mkyq Jul 26, 2022
0c8caf8
Add ionia sign in.
mkyq Jul 27, 2022
8bd66b6
Update for discounts and statuses for ionia merch.
mkyq Jul 27, 2022
cb1ca8c
Fixes for qr/barcode on ionia gift card screen.
mkyq Jul 27, 2022
3a9210c
Fixed formatting for display ionia discounts.
mkyq Jul 27, 2022
5148272
Fix merchant.discount.toStringAsFixed issue
mkyq Jul 27, 2022
7e32ba4
Add savingsPercentage to ionia merch discount.
mkyq Jul 28, 2022
eeaecae
Change build number for Cake Wallet ios and android.
mkyq Jul 28, 2022
2cf0532
Disable ionia for haven (#440)
godilite Jul 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes for getting of purchased gift cards.
  • Loading branch information
mkyq committed Jul 7, 2022
commit d85cc72c4269fa8215c3786e8e757e75796108a8
8 changes: 5 additions & 3 deletions lib/ionia/ionia_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:http/http.dart';
import 'package:cake_wallet/ionia/ionia_user_credentials.dart';
import 'package:cake_wallet/ionia/ionia_virtual_card.dart';
import 'package:cake_wallet/ionia/ionia_category.dart';
import 'package:cake_wallet/ionia/ionia_gift_card.dart';

class IoniaApi {
static const baseUri = 'apidev.ionia.io';
Expand All @@ -17,6 +18,7 @@ class IoniaApi {
static final getMerchantsUrl = Uri.https(baseUri, '/$pathPrefix/GetMerchants');
static final getMerchantsByFilterUrl = Uri.https(baseUri, '/$pathPrefix/GetMerchantsByFilter');
static final getPurchaseMerchantsUrl = Uri.https(baseUri, '/$pathPrefix/PurchaseGiftCard');
static final getCurrentUserGiftCardSummariesUrl = Uri.https(baseUri, '/$pathPrefix/GetCurrentUserGiftCardSummaries');

// Create user

Expand Down Expand Up @@ -245,15 +247,15 @@ class IoniaApi {

// Get Current User Gift Card Summaries

Future<List<IoniaMerchant>> getCurrentUserGiftCardSummaries({
Future<List<IoniaGiftCard>> getCurrentUserGiftCardSummaries({
@required String username,
@required String password,
@required String clientId}) async {
final headers = <String, String>{
'clientId': clientId,
'username': username,
'password': password};
final response = await post(getMerchantsUrl, headers: headers);
final response = await post(getCurrentUserGiftCardSummariesUrl, headers: headers);

if (response.statusCode != 200) {
return [];
Expand All @@ -269,7 +271,7 @@ class IoniaApi {
final data = decodedBody['Data'] as List<dynamic>;
return data.map((dynamic e) {
final element = e as Map<String, dynamic>;
return IoniaMerchant.fromJsonMap(element);
return IoniaGiftCard.fromJsonMap(element);
}).toList();
}
}
71 changes: 71 additions & 0 deletions lib/ionia/ionia_gift_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import 'package:flutter/foundation.dart';

class IoniaGiftCard {
IoniaGiftCard({
@required this.id,
@required this.merchantId,
@required this.legalName,
@required this.systemName,
@required this.barcodeUrl,
@required this.cardNumber,
@required this.cardPin,
@required this.usageInstructions,
@required this.balanceInstructions,
@required this.paymentInstructions,
@required this.cardImageUrl,
@required this.tip,
@required this.purchaseAmount,
@required this.actualAmount,
@required this.totalTransactionAmount,
@required this.totalDashTransactionAmount,
@required this.remainingAmount,
@required this.createdDateFormatted,
@required this.lastTransactionDateFormatted,
@required this.isActive,
@required this.isEmpty,
@required this.logoUrl});

factory IoniaGiftCard.fromJsonMap(Map<String, dynamic> element) {
return IoniaGiftCard(
id: element['Id'] as int,
merchantId: element['MerchantId'] as int,
legalName: element['LegalName'] as String,
systemName: element['SystemName'] as String,
barcodeUrl: element['BarcodeUrl'] as String,
cardNumber: element['CardNumber'] as String,
tip: element['Tip'] as double,
purchaseAmount: element['PurchaseAmount'] as double,
actualAmount: element['ActualAmount'] as double,
totalTransactionAmount: element['TotalTransactionAmount'] as double,
totalDashTransactionAmount: element['TotalDashTransactionAmount'] as double,
remainingAmount: element['RemainingAmount'] as double,
isActive: element['IsActive'] as bool,
isEmpty: element['IsEmpty'] as bool,
logoUrl: element['LogoUrl'] as String,
createdDateFormatted: element['CreatedDate'] as String,
lastTransactionDateFormatted: element['LastTransactionDate'] as String);
}

final int id;
final int merchantId;
final String legalName;
final String systemName;
final String barcodeUrl;
final String cardNumber;
final String cardPin;
final Map<String, dynamic> usageInstructions;
final Map<String, dynamic> balanceInstructions;
final Map<String, dynamic> paymentInstructions;
final String cardImageUrl;
final double tip;
final double purchaseAmount;
final double actualAmount;
final double totalTransactionAmount;
final double totalDashTransactionAmount;
final double remainingAmount;
final String createdDateFormatted;
final String lastTransactionDateFormatted;
final bool isActive;
final bool isEmpty;
final String logoUrl;
}
3 changes: 2 additions & 1 deletion lib/ionia/ionia_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:cake_wallet/.secrets.g.dart' as secrets;
import 'package:cake_wallet/ionia/ionia_api.dart';
import 'package:cake_wallet/ionia/ionia_gift_card.dart';
import 'package:cake_wallet/ionia/ionia_category.dart';

class IoniaService {
Expand Down Expand Up @@ -114,7 +115,7 @@ class IoniaService {

// Get Current User Gift Card Summaries

Future<List<IoniaMerchant>> getCurrentUserGiftCardSummaries() async {
Future<List<IoniaGiftCard>> getCurrentUserGiftCardSummaries() async {
final username = await secureStorage.read(key: ioniaUsernameStorageKey);
final password = await secureStorage.read(key: ioniaPasswordStorageKey);
return ioniaApi.getCurrentUserGiftCardSummaries(username: username, password: password, clientId: clientId);
Expand Down
8 changes: 4 additions & 4 deletions lib/src/screens/ionia/cards/ionia_account_cards_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:cake_wallet/ionia/ionia_gift_card.dart';
import 'package:cake_wallet/ionia/ionia_merchant.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/ionia/widgets/card_item.dart';
Expand Down Expand Up @@ -125,7 +126,7 @@ class _IoniaCardListView extends StatelessWidget {
}) : super(key: key);

final String emptyText;
final List<IoniaMerchant> merchList;
final List<IoniaGiftCard> merchList;

@override
Widget build(BuildContext context) {
Expand All @@ -148,12 +149,11 @@ class _IoniaCardListView extends StatelessWidget {
child: CardItem(
title: merchant.legalName,
backgroundColor: Theme.of(context).accentTextTheme.display4.backgroundColor.withOpacity(0.1),
discount: merchant.minimumDiscount,
discount: 0,
discountBackground: AssetImage('assets/images/red_badge_discount.png'),
titleColor: Theme.of(context).accentTextTheme.display4.backgroundColor,
subtitleColor: Theme.of(context).hintColor,
subTitle:
'${merchant.isOnline ? '${S.of(context).online}' ' && ${S.current.in_store}' : S.of(context).offline}',
subTitle: '',
logoUrl: merchant.logoUrl,
),
);
Expand Down
7 changes: 4 additions & 3 deletions lib/view_model/ionia/ionia_account_view_model.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:cake_wallet/ionia/ionia_merchant.dart';
import 'package:cake_wallet/ionia/ionia_service.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/ionia/ionia_gift_card.dart';

part 'ionia_account_view_model.g.dart';

Expand All @@ -20,16 +21,16 @@ abstract class IoniaAccountViewModelBase with Store {
String email;

@observable
List<IoniaMerchant> merchs;
List<IoniaGiftCard> merchs;

@computed
int get countOfMerch => merchs.where((merch) => merch.isActive).length;

@computed
List<IoniaMerchant> get activeMechs => merchs.where((merch) => merch.isActive).toList();
List<IoniaGiftCard> get activeMechs => merchs.where((merch) => merch.isActive).toList();

@computed
List<IoniaMerchant> get redeemedMerchs => merchs.where((merch) => !merch.isActive).toList();
List<IoniaGiftCard> get redeemedMerchs => merchs.where((merch) => !merch.isActive).toList();

@action
void logout() {
Expand Down