Skip to content

Feat/stripe#4622

Open
jproberson wants to merge 21 commits intomasterfrom
feat/stripe
Open

Feat/stripe#4622
jproberson wants to merge 21 commits intomasterfrom
feat/stripe

Conversation

@jproberson
Copy link
Copy Markdown
Contributor

PR Checklist

  • - Unit and/or e2e tests for the changes that have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring (no functional changes)
  • Documentation
  • Other:

What is the new behavior?

Describe the new behaviour
If useful, provide screenshot or capture to highlight main changes

Does this PR introduce a DB Schema Change or Migration?

  • Yes
  • No

Git Issues

Closes #

What happens next?

Thank you for the contribution! We will review it ASAP.

If you need more immediate feedback you can reach out to us on Discord in the Community Platform development channel.

@cypress
Copy link
Copy Markdown

cypress Bot commented Feb 23, 2026

onearmy-community-platform    Run #9356

Run Properties:  status check passed Passed #9356  •  git commit 31ace4e421: nav updates
Project onearmy-community-platform
Branch Review feat/stripe
Run status status check passed Passed #9356
Run duration 09m 12s
Commit git commit 31ace4e421: nav updates
Committer Jacob Roberson
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 91
View all changes introduced in this branch ↗︎

@jproberson jproberson added the Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview label Apr 20, 2026
Comment thread src/pages/Supporter/SupporterPage.tsx Outdated
import { ThankYouAccountForm } from './ThankYouAccountForm';
import { ThankYouLoginForm } from './ThankYouLoginForm';

export const CURRENCY_SYMBOLS: Record<string, string> = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can avoid this, by using browser native currency api.
new Intl.NumberFormat(navigator.language, { style: 'currency', currency: 'eur', currencyDisplay: 'narrowSymbol' }).format(99)
returns: '€99.00'

note that navigator is not available server-side, if we need it server-side, we need to obtain it via the 'accept-language' header or have a fallback. (we should try to use it because some currencies differ based on the user language).

Comment thread src/pages/Supporter/SupporterPage.tsx Outdated
gbp: '£',
};

export const formatAmount = (cents: number) => (cents / 100).toFixed(0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use the browser native function
new Intl.NumberFormat(locale, { style: 'currency', currency }).format(cents / 100);

Comment thread src/pages/Supporter/SupporterPage.tsx Outdated
Comment thread src/pages/Supporter/SupporterPage.tsx Outdated
if (previewMode) return;

if (isAuthenticated) {
window.location.assign('/settings?subscription=success');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of all of these window.location usage, have you tried useLocation() from react-router?

Comment thread src/pages/Supporter/CheckoutView.tsx Outdated
fontWeight: 'bold',
fontSize: 1,
fontFamily: 'body',
mb: 3,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a few usages of mb and mt. I usually try to avoid them in favor of flex and gap. Sometime it's fair to use margins, but please double check :)

Comment thread src/routes/api.stripe.webhook.ts Outdated

export const action = async ({ request }: ActionFunctionArgs) => {
if (request.method !== 'POST') {
return new Response('Method not allowed', { status: 405 });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check new way to handle errors

Comment thread src/services/stripeService.server.ts Outdated
return data?.stripe_customer_id || null;
}

async getAuthIdByStripeCustomerId(stripeCustomerId: string): Promise<string | null> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

careful that this is using the admin client. shouldn't it filter by tenant_id?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worst case it will find more than one profile and throw an error

Comment thread supabase/migrations/20260220204336_add_stripe_customers.sql Outdated
"tenant_id" text not null,
"created_at" timestamp with time zone not null default (now() AT TIME ZONE 'utc'::text),
constraint "stripe_customers_pkey" primary key ("id"),
constraint "stripe_customers_auth_id_fkey" foreign key ("auth_id") references "auth"."users"("id") on update cascade on delete cascade,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cascade, nice!

Comment thread src/services/stripeService.ts Outdated
@jproberson jproberson added Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview and removed Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview labels Apr 23, 2026
@jproberson jproberson added Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview and removed Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview labels Apr 23, 2026
@jproberson jproberson added Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview and removed Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview labels Apr 23, 2026
@jproberson jproberson marked this pull request as ready for review April 23, 2026 22:53
@jproberson jproberson requested a review from a team as a code owner April 23, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review allow-preview ✅ Has received manual check for malicious code and can be safely built for preview

Projects

Status: No status
Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants