-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update migrations * use deno.json properly * update script to get database types and have it update edge function types as well * update backend deno with stripe webhook and stripe functions * update logic for get_stripe_url * stripe test webhooks & make sure edge functions are working locally * make nextjs work with new stripe sync backend * change auth redirect to a rewrite to make it load faster * refresh page to update account when signed out * remove redundant import * add current subscription tier to nextjs * make flutter compatible with stripe sync * add See Pricing button * add pricing to readme * update env examples to point to supabase * remove unnecessary variable in .env.example * fix env vars and update pleasereply to hi for email
- Loading branch information
1 parent
969b666
commit 0ff615f
Showing
40 changed files
with
1,876 additions
and
395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"SUPABASE_URL": "https://crnytzptlghehxsarjxm.supabase.co", | ||
"SUPABASE_ANON_KEY": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNybnl0enB0bGdoZWh4c2FyanhtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDkyMjQxNjgsImV4cCI6MjAyNDgwMDE2OH0.UW1dHRt4hGF6uCdPXimxv0Ggwq5uJ1WoQuCZ1_ixmCU" | ||
"SUPABASE_URL": "https://ibyxomczmyaptsjgzvzi.supabase.co", | ||
"SUPABASE_ANON_KEY": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlieXhvbWN6bXlhcHRzamd6dnppIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjEzMDk0OTUsImV4cCI6MjAzNjg4NTQ5NX0.DOhoJJ3V7KJFjglNftgDDQwMNrB3oiWtf21BfRcB2Cc" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
class SubscriptionWithPrice { | ||
final String? cancelAt; | ||
final bool? cancelAtPeriodEnd; | ||
final String? canceledAt; | ||
final String created; | ||
final String currentPeriodEnd; | ||
final String currentPeriodStart; | ||
final String? endedAt; | ||
final String id; | ||
final Map<String, dynamic>? metadata; | ||
final String? priceId; | ||
final int? quantity; | ||
final String? status; | ||
final String? trialEnd; | ||
final String? trialStart; | ||
final String userId; | ||
final PriceWithProduct? prices; | ||
|
||
SubscriptionWithPrice({ | ||
this.cancelAt, | ||
this.cancelAtPeriodEnd, | ||
this.canceledAt, | ||
required this.created, | ||
required this.currentPeriodEnd, | ||
required this.currentPeriodStart, | ||
this.endedAt, | ||
required this.id, | ||
this.metadata, | ||
this.priceId, | ||
this.quantity, | ||
this.status, | ||
this.trialEnd, | ||
this.trialStart, | ||
required this.userId, | ||
this.prices, | ||
}); | ||
|
||
factory SubscriptionWithPrice.fromJson(Map<String, dynamic> json) { | ||
return SubscriptionWithPrice( | ||
cancelAt: json['cancel_at'], | ||
cancelAtPeriodEnd: json['cancel_at_period_end'], | ||
canceledAt: json['canceled_at'], | ||
created: json['created'], | ||
currentPeriodEnd: json['current_period_end'], | ||
currentPeriodStart: json['current_period_start'], | ||
endedAt: json['ended_at'], | ||
id: json['id'], | ||
metadata: json['metadata'], | ||
priceId: json['price_id'], | ||
quantity: json['quantity'], | ||
status: json['status'], | ||
trialEnd: json['trial_end'], | ||
trialStart: json['trial_start'], | ||
userId: json['user_id'], | ||
prices: json['prices'] != null | ||
? PriceWithProduct.fromJson(json['prices']) | ||
: null, | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'cancel_at': cancelAt, | ||
'cancel_at_period_end': cancelAtPeriodEnd, | ||
'canceled_at': canceledAt, | ||
'created': created, | ||
'current_period_end': currentPeriodEnd, | ||
'current_period_start': currentPeriodStart, | ||
'ended_at': endedAt, | ||
'id': id, | ||
'metadata': metadata, | ||
'price_id': priceId, | ||
'quantity': quantity, | ||
'status': status, | ||
'trial_end': trialEnd, | ||
'trial_start': trialStart, | ||
'user_id': userId, | ||
'prices': prices?.toJson(), | ||
}; | ||
} | ||
} | ||
|
||
class PriceWithProduct { | ||
final bool? active; | ||
final String? currency; | ||
final String? description; | ||
final String id; | ||
final String? interval; | ||
final int? intervalCount; | ||
final Map<String, dynamic>? metadata; | ||
final String? productId; | ||
final int? trialPeriodDays; | ||
final String? type; | ||
final int? unitAmount; | ||
final Product? products; | ||
|
||
PriceWithProduct({ | ||
this.active, | ||
this.currency, | ||
this.description, | ||
required this.id, | ||
this.interval, | ||
this.intervalCount, | ||
this.metadata, | ||
this.productId, | ||
this.trialPeriodDays, | ||
this.type, | ||
this.unitAmount, | ||
this.products, | ||
}); | ||
|
||
factory PriceWithProduct.fromJson(Map<String, dynamic> json) { | ||
return PriceWithProduct( | ||
active: json['active'], | ||
currency: json['currency'], | ||
description: json['description'], | ||
id: json['id'], | ||
interval: json['interval'], | ||
intervalCount: json['interval_count'], | ||
metadata: json['metadata'], | ||
productId: json['product_id'], | ||
trialPeriodDays: json['trial_period_days'], | ||
type: json['type'], | ||
unitAmount: json['unit_amount'], | ||
products: | ||
json['products'] != null ? Product.fromJson(json['products']) : null, | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'active': active, | ||
'currency': currency, | ||
'description': description, | ||
'id': id, | ||
'interval': interval, | ||
'interval_count': intervalCount, | ||
'metadata': metadata, | ||
'product_id': productId, | ||
'trial_period_days': trialPeriodDays, | ||
'type': type, | ||
'unit_amount': unitAmount, | ||
'products': products?.toJson(), | ||
}; | ||
} | ||
} | ||
|
||
class Product { | ||
final bool? active; | ||
final String? description; | ||
final String id; | ||
final String? image; | ||
final Map<String, dynamic>? metadata; | ||
final String? name; | ||
|
||
Product({ | ||
this.active, | ||
this.description, | ||
required this.id, | ||
this.image, | ||
this.metadata, | ||
this.name, | ||
}); | ||
|
||
factory Product.fromJson(Map<String, dynamic> json) { | ||
return Product( | ||
active: json['active'], | ||
description: json['description'], | ||
id: json['id'], | ||
image: json['image'], | ||
metadata: json['metadata'], | ||
name: json['name'], | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'active': active, | ||
'description': description, | ||
'id': id, | ||
'image': image, | ||
'metadata': metadata, | ||
'name': name, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:devtodollars/models/stripe.dart'; | ||
|
||
class UserMetadata { | ||
final String? avatarUrl; | ||
final Map<String, dynamic>? billingAddress; | ||
final String? fullName; | ||
final String id; | ||
final Map<String, dynamic>? paymentMethod; | ||
SubscriptionWithPrice? subscription; | ||
|
||
UserMetadata({ | ||
this.avatarUrl, | ||
this.billingAddress, | ||
this.fullName, | ||
required this.id, | ||
this.paymentMethod, | ||
this.subscription, | ||
}); | ||
|
||
factory UserMetadata.fromJson(Map<String, dynamic> json) { | ||
return UserMetadata( | ||
avatarUrl: json['avatar_url'], | ||
billingAddress: json['billing_address'], | ||
fullName: json['full_name'], | ||
id: json['id'], | ||
paymentMethod: json['payment_method'], | ||
subscription: json['subscription'] != null | ||
? SubscriptionWithPrice.fromJson(json['subscription']) | ||
: null, | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'avatar_url': avatarUrl, | ||
'billing_address': billingAddress, | ||
'full_name': fullName, | ||
'id': id, | ||
'payment_method': paymentMethod, | ||
'subscription': subscription?.toJson(), | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.