remoived accestoken
This commit is contained in:
parent
e55a7c453d
commit
c600621cac
4 changed files with 10 additions and 16 deletions
|
|
@ -36,14 +36,14 @@ class SubscriptionInfo {
|
|||
Fetch App Ids for each RC app (iOS, Android, and Stripe). Used to determine which app a user
|
||||
with an active subscription purchased that subscription.
|
||||
*/
|
||||
Future<void> setAppIds(String accessToken) async {
|
||||
Future<void> setAppIds() async {
|
||||
if (appIds != null) return;
|
||||
appIds = await SubscriptionRepo.getAppIds(accessToken);
|
||||
appIds = await SubscriptionRepo.getAppIds();
|
||||
}
|
||||
|
||||
Future<void> setAllProducts(String accessToken) async {
|
||||
Future<void> setAllProducts() async {
|
||||
if (allProducts != null) return;
|
||||
allProducts = await SubscriptionRepo.getAllProducts(accessToken);
|
||||
allProducts = await SubscriptionRepo.getAllProducts();
|
||||
}
|
||||
|
||||
bool get isNewUserTrial =>
|
||||
|
|
|
|||
|
|
@ -31,9 +31,8 @@ class MobileSubscriptionInfo extends SubscriptionInfo {
|
|||
);
|
||||
return;
|
||||
}
|
||||
final accessToken = super.pangeaController.userController.accessToken;
|
||||
await setAppIds(accessToken);
|
||||
await setAllProducts(accessToken);
|
||||
await setAppIds();
|
||||
await setAllProducts();
|
||||
await setCustomerInfo();
|
||||
await setMobilePackages();
|
||||
if (allProducts != null && appIds != null) {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ class WebSubscriptionInfo extends SubscriptionInfo {
|
|||
|
||||
@override
|
||||
Future<void> configure() async {
|
||||
final accessToken = super.pangeaController.userController.accessToken;
|
||||
await setAppIds(accessToken);
|
||||
await setAllProducts(accessToken);
|
||||
await setAppIds();
|
||||
await setAllProducts();
|
||||
await setCustomerInfo();
|
||||
|
||||
if (allProducts == null || appIds == null) {
|
||||
|
|
|
|||
|
|
@ -13,11 +13,10 @@ import 'package:http/http.dart' as http;
|
|||
import '../network/urls.dart';
|
||||
|
||||
class SubscriptionRepo {
|
||||
static Future<SubscriptionAppIds?> getAppIds(String accessToken) async {
|
||||
static Future<SubscriptionAppIds?> getAppIds() async {
|
||||
try {
|
||||
final Requests req = Requests(
|
||||
choreoApiKey: Environment.choreoApiKey,
|
||||
matrixAccessToken: accessToken,
|
||||
);
|
||||
final http.Response res = await req.get(
|
||||
url: PApiUrls.rcAppsChoreo,
|
||||
|
|
@ -35,13 +34,10 @@ class SubscriptionRepo {
|
|||
}
|
||||
}
|
||||
|
||||
static Future<List<SubscriptionDetails>?> getAllProducts(
|
||||
String accessToken,
|
||||
) async {
|
||||
static Future<List<SubscriptionDetails>?> getAllProducts() async {
|
||||
try {
|
||||
final Requests req = Requests(
|
||||
choreoApiKey: Environment.choreoApiKey,
|
||||
matrixAccessToken: accessToken,
|
||||
);
|
||||
final http.Response res = await req.get(
|
||||
url: PApiUrls.rcProductsChoreo,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue