getCustomerCartTotals method
Get customer cart totals
Implementation
Future<CartTotals> getCustomerCartTotals() async {
try {
final response = await _client.authenticatedRequest<Map<String, dynamic>>(
'/rest/V1/carts/mine/totals',
);
if (response.statusCode == 200) {
return CartTotals.fromJson(response.data!);
} else {
throw Exception(
'Failed to get customer cart totals: ${response.statusMessage}',
);
}
} on DioException catch (e) {
throw Exception('Failed to get customer cart totals: ${e.message}');
} catch (e) {
throw Exception('Failed to get customer cart totals: $e');
}
}