mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
fix: paymentUrls is null (#1786)
Some checks are pending
Cache Dependencies / test (push) Waiting to run
Some checks are pending
Cache Dependencies / test (push) Waiting to run
* fix: paymentUrls is null * feat: potential secure storage error
This commit is contained in:
parent
389c334f10
commit
8e12fb1ad9
3 changed files with 9 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue