mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix: paymentUrls is null (#1786)
* fix: paymentUrls is null * feat: potential secure storage error
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
class CakePayOrder {
|
||||
final String orderId;
|
||||
final List<OrderCard> cards;
|
||||
|
||||
@@ -82,10 +82,12 @@ class CakePayService {
|
||||
}
|
||||
|
||||
/// Logout
|
||||
Future<void> logout(String email) async {
|
||||
Future<void> logout([String? email]) async {
|
||||
await secureStorage.delete(key: cakePayUsernameStorageKey);
|
||||
await secureStorage.delete(key: cakePayUserTokenKey);
|
||||
await cakePayApi.logoutUser(email: email, apiKey: cakePayApiKey);
|
||||
if (email != null) {
|
||||
await cakePayApi.logoutUser(email: email, apiKey: cakePayApiKey);
|
||||
}
|
||||
}
|
||||
|
||||
/// Purchase Gift Card
|
||||
|
||||
@@ -258,7 +258,11 @@ class CakePayBuyCardDetailPage extends BasePage {
|
||||
if (!isLogged) {
|
||||
Navigator.of(context).pushNamed(Routes.cakePayWelcomePage);
|
||||
} else {
|
||||
await cakePayPurchaseViewModel.createOrder();
|
||||
try {
|
||||
await cakePayPurchaseViewModel.createOrder();
|
||||
} catch (_) {
|
||||
await cakePayPurchaseViewModel.cakePayService.logout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user