Skip to content

Conversation

@AxelGes
Copy link
Contributor

@AxelGes AxelGes commented Jan 15, 2026

Explanation

The ramps controller was using the legacy /regions/countries endpoint. The backend has introduced a new v2 endpoint at /v2/regions/countries that returns additional fields for better UX around amount selection.

This PR:

  • Updates the getCountries endpoint path from /regions/countries to /v2/regions/countries
  • Adds defaultAmount and quickAmounts fields to the Country type to match the new backend response shape (RegionV2 interface)
  • Updates all test mocks to use the new v2 endpoint path

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Moves countries fetch to the v2 cache API and aligns types for improved amount-selection UX.

  • Update RampsService#getCountries to request v2/regions/countries via getApiPath() (v2 default)
  • Extend Country with defaultAmount and quickAmounts
  • Adjust tests to expect /v2/regions/countries and updated error strings
  • Document changes in CHANGELOG.md

Written by Cursor Bugbot for commit 2f4bc53. This will update automatically on new commits. Configure here.

@AxelGes AxelGes requested a review from a team as a code owner January 15, 2026 20:16
…t fields

- Add getApiPath helper function for versioned API paths (defaults to v2)
- Update getCountries endpoint to use v2/regions/countries
- Keep getGeolocation, getEligibility, and getTokens on v1 (no version prefix)
- Add defaultAmount and quickAmounts fields to Country type
- Update test mocks to use new v2 endpoint path
@AxelGes AxelGes force-pushed the feat/ramps-controller-v2-countries-endpoint-v2 branch from 2d1566e to 8a54c2f Compare January 15, 2026 21:42
@AxelGes AxelGes requested a review from a team as a code owner January 16, 2026 15:22
const textResponse = await this.#request<string>(
RampsApiService.Orders,
'geolocation',
getApiPath('geolocation', ''),
Copy link
Member

Choose a reason for hiding this comment

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

if version is optional then don't pass an empty string

Suggested change
getApiPath('geolocation', ''),
getApiPath('geolocation'),

@georgeweiler georgeweiler added this pull request to the merge queue Jan 16, 2026
Merged via the queue into main with commit 2c40f86 Jan 16, 2026
294 checks passed
@georgeweiler georgeweiler deleted the feat/ramps-controller-v2-countries-endpoint-v2 branch January 16, 2026 16:58
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.

4 participants