Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/stripe-customer-sync #3153

Merged
merged 3 commits into from
Jul 7, 2022
Merged

fix/stripe-customer-sync #3153

merged 3 commits into from
Jul 7, 2022

Conversation

alannnc
Copy link
Contributor

@alannnc alannnc commented Jun 24, 2022

What does this PR do?

Takes care of keeping in sync user data with stripe customer data

Fixes # (issue)
Environment: Staging(main branch) / Production

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Change email or username on settings page then look up on stripe for customer's metadata and they should be the same as our DB.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

@vercel
Copy link

vercel bot commented Jun 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Jul 7, 2022 at 9:27PM (UTC)
3 Ignored Deployments
Name Status Preview Updated
docs ⬜️ Ignored (Inspect) Jul 7, 2022 at 9:27PM (UTC)
swagger ⬜️ Ignored (Inspect) Jul 7, 2022 at 9:27PM (UTC)
ui ⬜️ Ignored (Inspect) Jul 7, 2022 at 9:27PM (UTC)

@alannnc alannnc marked this pull request as ready for review July 4, 2022 19:08
});

// Notify stripe about the change
if (updatedUser && updatedUser.metadata && hasKeyInMetadata(updatedUser, "stripeCustomerId")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zomars Should I add the same flag to know if we are on self hosted? And don't execute any stripe code.

Copy link
Member

Choose a reason for hiding this comment

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

Some self-hosted users will use Stripe Connect, If this is only for premium usernames then we can skip it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me get this right, connect can be for self hosted users, but this it's only involves our user plan handling so I should add flag here for IS_SELF_HOSTED.

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind seems like is good to go 👍🏽

@zomars zomars merged commit 2c30976 into main Jul 7, 2022
@zomars zomars deleted the fix/stripe-customer-sync branch July 7, 2022 21:24
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants