Patch few Stripe related issues (#1156)

This commit is contained in:
Vishnu Mohandas 2024-03-20 14:07:26 +05:30 committed by GitHub
commit 8101fe1495
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View file

@ -16,7 +16,11 @@ import 'package:photos/services/user_service.dart';
import 'package:photos/ui/common/web_page.dart'; import 'package:photos/ui/common/web_page.dart';
import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/dialog_util.dart';
const kWebPaymentRedirectUrl = "https://payments.ente.io/frameRedirect"; const kWebPaymentRedirectUrl = String.fromEnvironment(
"web-payment-redirect",
defaultValue: "https://payments.ente.io/frameRedirect",
);
const kWebPaymentBaseEndpoint = String.fromEnvironment( const kWebPaymentBaseEndpoint = String.fromEnvironment(
"web-payment", "web-payment",
defaultValue: "https://payments.ente.io", defaultValue: "https://payments.ente.io",

View file

@ -331,6 +331,7 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
await _dialog.show(); await _dialog.show();
try { try {
final String url = await _billingService.getStripeCustomerPortalUrl(); final String url = await _billingService.getStripeCustomerPortalUrl();
await _dialog.hide();
await Navigator.of(context).push( await Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) { builder: (BuildContext context) {
@ -342,7 +343,6 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
await _dialog.hide(); await _dialog.hide();
await showGenericErrorDialog(context: context, error: e); await showGenericErrorDialog(context: context, error: e);
} }
await _dialog.hide();
} }
Widget _stripeRenewOrCancelButton() { Widget _stripeRenewOrCancelButton() {

View file

@ -296,6 +296,11 @@ func (c *StripeController) handleCustomerSubscriptionDeleted(event stripe.Event)
return ente.StripeEventLog{}, stacktrace.Propagate(err, "") return ente.StripeEventLog{}, stacktrace.Propagate(err, "")
} }
err = c.BillingRepo.UpdateSubscriptionCancellationStatus(userID, true)
if err != nil {
return ente.StripeEventLog{}, stacktrace.Propagate(err, "")
}
skipMail := stripeSubscription.Metadata[SkipMailKey] skipMail := stripeSubscription.Metadata[SkipMailKey]
// Send a cancellation notification email for folks who are either on // Send a cancellation notification email for folks who are either on
// individual plan or admin of a family plan. // individual plan or admin of a family plan.