Skip to content

feat: Add UI for managing payment methods#770

Merged
Anif7 merged 2 commits intomainfrom
payment_methods-streams
Feb 27, 2026
Merged

feat: Add UI for managing payment methods#770
Anif7 merged 2 commits intomainfrom
payment_methods-streams

Conversation

@Anif7
Copy link
Contributor

@Anif7 Anif7 commented Feb 24, 2026

Adds UI for managing payment methods.

  • Add new cards
  • Remove existing cards
  • Set a default payment method

@gemini-code-assist
Copy link

Summary of Changes

Hello @Anif7, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a significant enhancement to the billing section by integrating a comprehensive UI for payment method management. Users can now seamlessly interact with their payment information, improving the overall user experience for handling billing details. The changes focus on providing a clear and intuitive interface for common payment-related actions.

Highlights

  • New Payment Methods UI: Introduced a dedicated user interface for managing payment methods, allowing users to view, add, remove, and set default payment cards.
  • Navigation Updates: Updated the desktop sidebar and billing tabs to link directly to the new 'Payment Methods' page, streamlining access to billing management.
  • Card Management Features: Implemented functionality for adding new payment cards, removing existing ones, and designating a default card for transactions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/_includes/partials/tpstreams/sidebar_desktop.html
    • Updated the 'Billing' link to navigate to the new payment methods page.
  • src/tpstreams/billing/includes/desktop_tabs.html
    • Replaced existing billing navigation tabs with a single 'Payment Methods' tab.
  • src/tpstreams/billing/includes/tablet_tabs.html
    • Modified the mobile/tablet dropdown navigation to point to the 'Payment Methods' page.
  • src/tpstreams/billing/payment_methods/includes/payment_methods.html
    • Added the core UI component for displaying and managing payment cards, including options to set as default and remove.
  • src/tpstreams/billing/payment_methods/includes/remove_card_modal.html
    • Added a modal dialog for confirming the removal of a payment card.
  • src/tpstreams/billing/payment_methods/index.html
    • Created the main page for payment methods, integrating the payment methods UI and the remove card modal.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Anif7 Anif7 changed the title feat: add UI for managing payment methods feat: Add UI for managing payment methods Feb 24, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new UI for managing payment methods. The changes include updates to the sidebar and tab navigation to link to the new page, and new HTML partials for displaying payment methods and handling card removal via a modal. My review focuses on potential regressions from removed navigation, non-functional UI elements, and improvements to code quality and maintainability. Several key issues were identified: the 'Add new card' and 'Remove Card' buttons are not fully functional, navigation tabs for other billing sections have been removed which may be an unintended regression, and some minor issues with code style and accessibility were also found. The new UI components are a good start, but the identified issues should be addressed to ensure a complete and correct user experience.

Comment on lines +4 to -14
<a href="{{ '/tpstreams/billing/payment_methods/'|url }}"
class="px-1 py-4 text-sm font-medium border-b-2
{% if page.url == '/tpstreams/billing/overview/' %}text-blue-700 border-blue-600 {% else %} border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 {% endif %} whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium">Overview</a>

<a href="{{ '/tpstreams/billing/plans/'|url }}"
class="px-1 py-4 text-sm font-medium border-b-2
{% if page.url == '/tpstreams/billing/plans/' %}text-blue-700 border-blue-600 {% else %} border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 {% endif %} whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium">Plans</a>

<a href="{{ '/tpstreams/billing/billing_history/'|url }}"
class="px-1 py-4 text-sm font-medium border-b-2
{% if page.url == '/tpstreams/billing/billing_history/' %}text-blue-700 border-blue-600 {% else %} border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 {% endif %} whitespace-nowrap border-b-2 py-4 px-1 text-sm font-medium">Billing History</a>

Choose a reason for hiding this comment

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

high

This change removes the 'Overview', 'Plans', and 'Billing History' tabs, leaving only 'Payment Methods'. While the PR is focused on adding payment method management, removing existing navigation items might be an unintended side effect. If these sections are meant to be kept, they should be restored. If their removal is intentional, it would be good to document this in the PR description.


<!-- Footer -->
<div class="flex border-t border-gray-200 divide-x divide-gray-200">
<button type="button" class="py-3 px-4 w-full inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-b-xl bg-white text-gray-800 shadow-sm hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-hidden focus:bg-gray-50" data-hs-overlay="#hs-pro-dmacm">

Choose a reason for hiding this comment

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

high

The 'Add new card' button points to a modal with data-hs-overlay="#hs-pro-dmacm". However, there is no corresponding modal with this ID defined in the pull request. This will result in a non-functional button. Please ensure the correct modal is implemented and referenced here to support adding new cards, as mentioned in the PR description.

Comment on lines +36 to +38
<button type="button" class="py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none" data-hs-overlay="#hs-remove-card-modal">
Remove Card
</button>

Choose a reason for hiding this comment

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

high

The 'Remove Card' button currently only closes the modal because of data-hs-overlay="#hs-remove-card-modal". It does not perform the actual removal action. To implement the removal functionality, this button should trigger a form submission or a JavaScript function that sends a request to the server to delete the card. Simply closing the modal without removing the card will lead to a confusing user experience.

Comment on lines +46 to +47
class="group flex items-center border-l-4 py-2 px-3 text-sm font-medium {% if page.url == '/tpstreams/billing/payment_methods/' %} bg-blue-50 border-blue-700 text-blue-700 {% else %} border-transparent text-gray-600 hover:bg-gray-50 hover:text-gray-900 {% endif %}">
<svg class="mr-3 h-6 w-6 flex-shrink-0 {% if page.url == '/tpstreams/billing/payment_methods/' %} text-blue-600 {% else %} text-gray-400 group-hover:text-gray-500 {% endif %}" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">

Choose a reason for hiding this comment

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

medium

For consistency with other sidebar links like 'Assets' and 'Live Stream', and to make this more robust for future additions to the billing section, it would be better to check if the URL includes the billing path prefix rather than checking for an exact match. This will ensure the 'Billing' item remains highlighted for all pages within the billing section.

          class="group flex items-center border-l-4 py-2 px-3 text-sm font-medium {% if page.url.includes('/tpstreams/billing/') %} bg-blue-50 border-blue-700 text-blue-700 {% else %} border-transparent text-gray-600 hover:bg-gray-50 hover:text-gray-900 {% endif %}">
          <svg class="mr-3 h-6 w-6 flex-shrink-0 {% if page.url.includes('/tpstreams/billing/') %} text-blue-600 {% else %} text-gray-400 group-hover:text-gray-500 {% endif %}" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">

Comment on lines +7 to +8
<option value="/tpstreams/billing/payment_methods/" {% if page.url=='/tpstreams/billing/payment_methods/' %} selected {% endif %}>
Payment Methods</option>

Choose a reason for hiding this comment

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

medium

Similar to the desktop tabs, this change removes other potential billing sections for the tablet view, leaving a <select> with only one <option>, which is not ideal from a UI perspective. If other billing sections like 'Overview', 'Plans', and 'Billing History' are intended to exist, they should be added as options here for a consistent user experience across devices.

<!-- Logo -->
<div>
<div class="py-1.5 px-2.5 sm:py-2.5 sm:px-3 bg-gray-50 border border-gray-200 rounded-lg">
<svg class="shrink-0 w-6 sm:w-8 h-auto" width="35" height="22" viewBox="0 0 35 22" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="mask0_666_270977asdasd" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="5" width="35" height="12"><path d="M34.5 5.4751H0.5V16.5081H34.5V5.4751Z" fill="white"/></mask><g mask="url(#mask0_666_270977asdasd)"><path d="M15.239 16.3211H12.468L14.202 5.6621H16.973L15.239 16.3211ZM10.139 5.6621L7.487 12.9891L7.181 11.4081L6.246 6.6311C6.246 6.6311 6.127 5.6791 4.937 5.6791H0.551L0.5 5.8491C0.5 5.8491 1.843 6.1211 3.407 7.0731L5.821 16.3381H8.711L13.131 5.6791L10.139 5.6621ZM31.95 16.3211H34.5L32.273 5.6621H30.046C29.009 5.6621 28.771 6.4611 28.771 6.4611L24.64 16.3211H27.53L28.108 14.7401H31.627L31.95 16.3211ZM28.907 12.5471L30.369 8.5521L31.185 12.5471H28.907ZM24.844 8.2291L25.235 5.9341C25.235 5.9341 24.011 5.4751 22.736 5.4751C21.359 5.4751 18.095 6.0701 18.095 9.0111C18.095 11.7651 21.937 11.7991 21.937 13.2441C21.937 14.6891 18.503 14.4341 17.364 13.5161L16.956 15.9131C16.956 15.9131 18.197 16.5081 20.084 16.5081C21.971 16.5081 24.827 15.5221 24.827 12.8531C24.827 10.0821 20.951 9.8271 20.951 8.6201C20.951 7.4131 23.654 7.5661 24.844 8.2291Z" fill="#2566AF"/><path d="M7.181 11.4252L6.246 6.6312C6.246 6.6312 6.127 5.6792 4.937 5.6792H0.551L0.5 5.8492C0.5 5.8492 2.608 6.2912 4.614 7.9232C6.552 9.4702 7.181 11.4252 7.181 11.4252Z" fill="#E6A540"/></g></svg>

Choose a reason for hiding this comment

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

medium

The id for the mask mask0_666_270977asdasd seems to be an auto-generated or placeholder value. For better maintainability and accessibility, it's recommended to use a more descriptive and meaningful ID, for example, visa-card-logo-mask.

</button>
</div>

<div>

Choose a reason for hiding this comment

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

medium

The indentation for this div seems incorrect. It should be aligned with the preceding div element for better code readability and consistency.

Suggested change
<div>
<div>

<!-- Logo -->
<div>
<div class="py-1.5 px-2.5 sm:py-2.5 sm:px-3 bg-gray-50 border border-gray-200 rounded-lg">
<svg class="shrink-0 w-6 sm:w-8 h-auto" width="35" height="22" viewBox="0 0 35 22" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="asfasfa1123f33123" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="35" height="22"><path d="M34.5 0.375H0.5V21.387H34.5V0.375Z" fill="white"/></mask><g mask="url(#asfasfa1123f33123)"><path d="M22.0899 19.1431H12.9099V2.61914H22.0899V19.1431Z" fill="#FF5F00"/><path d="M13.488 10.881C13.488 7.532 15.052 4.54 17.5 2.619C15.647 1.157 13.369 0.375 11.006 0.375C5.209 0.375 0.5 5.084 0.5 10.881C0.5 16.678 5.209 21.387 11.006 21.387C13.369 21.387 15.647 20.605 17.5 19.143C15.052 17.222 13.488 14.23 13.488 10.881Z" fill="#EB001B"/><path d="M34.5 10.881C34.5 16.678 29.791 21.387 23.994 21.387C21.631 21.387 19.353 20.605 17.5 19.143C19.948 17.222 21.512 14.23 21.512 10.881C21.512 7.532 19.948 4.54 17.5 2.619C19.353 1.157 21.631 0.375 23.994 0.375C29.791 0.375 34.5 5.084 34.5 10.881Z" fill="#F79E1B"/></g></svg>

Choose a reason for hiding this comment

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

medium

The id for the mask asfasfa1123f33123 seems to be an auto-generated or placeholder value. For better maintainability and accessibility, it's recommended to use a more descriptive and meaningful ID, for example, mastercard-logo-mask.

</button>
</div>

<div>

Choose a reason for hiding this comment

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

medium

The indentation for this div seems incorrect. It should be aligned with the preceding div element for better code readability and consistency.

Suggested change
<div>
<div>

<div class="relative flex flex-col bg-white border border-gray-200 shadow-2xs rounded-xl overflow-hidden">
<div class="absolute top-2 end-2">
<button type="button" class="size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none" aria-label="Close" data-hs-overlay="#hs-remove-card-modal">
<span class="sr-only" data-hs-overlay="#hs-remove-card-modal">Close</span>

Choose a reason for hiding this comment

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

medium

The aria-label="Close" on the parent button already provides an accessible name. This <span> with sr-only is redundant and can be removed. The data-hs-overlay attribute on the span is also unnecessary as it's on the parent button.

@github-actions
Copy link

github-actions bot commented Feb 24, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-27 04:59 UTC

@Anif7 Anif7 merged commit f4d0741 into main Feb 27, 2026
6 checks passed
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.

1 participant