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

[PM 237] Test Clock Error in Production when attempting to view Stripe Subscription page #2745

Merged
merged 4 commits into from
Mar 12, 2023

Conversation

cyprain-okeke
Copy link
Contributor

Type of change

- [x] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

The is to fix Test Clock Error in Production when attempting to view Stripe Subscription page

Code changes

  • src/Admin/Controllers/ToolsController.cs: Added an environmental check before calling the stripe TestClock endpoint. The endpoint will only be called for QA and development.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • If making database changes - make sure you also update Entity Framework queries and/or migrations
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

@cyprain-okeke cyprain-okeke requested a review from a team February 27, 2023 13:44
model.Prices = (await _stripeAdapter.PriceListAsync(new Stripe.PriceListOptions() { Limit = 100 })).Data;
model.TestClocks = await _stripeAdapter.TestClockListAsync();
model.TestClocks = isProduction ? new List<Stripe.TestHelpers.TestClock>() : await _stripeAdapter.TestClockListAsync();
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: passing isProduction as a TestClockListAsync method parameter, bullet proofing it in case it gets used elsewhere.

@cyprain-okeke cyprain-okeke merged commit 24d227d into master Mar 12, 2023
@cyprain-okeke cyprain-okeke deleted the PM-237/Test-clock-error-in-stripe branch March 12, 2023 16:10
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.

3 participants