Skip to content

[Stripe Cardholder] Only pass verified phone number to Stripe#13322

Open
manuthecoder wants to merge 9 commits intomainfrom
stripe-cardholder-only-pass-verified-phone-number-to-Stripe
Open

[Stripe Cardholder] Only pass verified phone number to Stripe#13322
manuthecoder wants to merge 9 commits intomainfrom
stripe-cardholder-only-pass-verified-phone-number-to-Stripe

Conversation

@manuthecoder
Copy link
Copy Markdown
Contributor

Closes #13288

This comment was marked as resolved.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
manuthecoder pushed a commit that referenced this pull request Mar 29, 2026
… phone requirement

- Show a warning banner in the card creation form when the user's phone
  number is not verified, linking them to settings to fix it
- Add an explicit pre-flight redirect in StripeCardsController#create
  (mirrors the existing birthday check pattern) so users get a clear
  error before the service layer is invoked
- Add User model specs asserting that (1) changing phone_number while
  unverified does NOT forward the new number to Stripe, and (2)
  transitioning phone_number_verified false→true triggers syncing the
  verified number to the Stripe cardholder

https://claude.ai/code/session_01RoJupKwnSehbj8SKpG5DYi
@manuthecoder manuthecoder marked this pull request as draft March 29, 2026 06:41
@manuthecoder manuthecoder marked this pull request as ready for review March 29, 2026 07:07
claude and others added 5 commits March 29, 2026 20:00
- Add phone_number_verified? guard to Api::V4::StripeCardsController#create,
  returning 400 instead of 500 for unverified users (consistent with web UI)
- Add User model specs covering: unverified phone change does not sync to
  Stripe cardholder, and phone_number_verified false→true triggers sync

https://claude.ai/code/session_01UD6XZs8JxA3CciVgAYTQf1
Comment thread spec/models/user_spec.rb

it "does nothing when stripe cardholder has no stripe_id" do
user = create(:user, phone_number: "+18556254225", phone_number_verified: true, email: "test@example.com")
cardholder = create(:stripe_cardholder, user:, stripe_id: nil, stripe_email: "test@example.com")
Copy link
Copy Markdown
Member

@garyhtou garyhtou left a comment

Choose a reason for hiding this comment

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

Ah, actually, a few more things come to mind:

  1. There are some countries HCB is unable to send SMS codes to. How do we handle this case?
  2. There are a large number of existing users with stripe cards that don't have their phone number verified. Merging this PR will cause their phone number to be removed from stripe the next time their cardholder is updated. Are we okay with that? If so, should we remove their phone numbers in an OTJ now so that the paper trail is more clear?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Stripe Cardholder] Only pass verified phone number to Stripe

4 participants