Skip to content

fix: remove secret keys from reducer, display new input to replace key - #1146

Open
tomrndom wants to merge 2 commits into
masterfrom
fix/payment-profile-secret-keys
Open

tomrndom wants to merge 2 commits into
masterfrom
fix/payment-profile-secret-keys

Conversation

@tomrndom

@tomrndom tomrndom commented Nov 3, 2026 •

Copy link
Copy Markdown

ref: https://app.clickup.com/t/9014802374/86bcwfkn5

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

  • New Features

    • Payment profile settings show whether live and test secret keys are set without displaying their values. Select Replace to enter a new key; canceling keeps the existing key unchanged.
    • The payment profile form uses a responsive layout on smaller screens.
  • Bug Fixes

    • Saving a profile without entering a replacement key no longer sends an empty value that could overwrite an existing key.
    • Payment profile updates handle empty fields consistently and do not retain secret-key values in displayed profile data.

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@tomrndom tomrndom self-assigned this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Payment profiles now track whether live and test secret keys are set without storing their values in reducer state. The dialog supports replacing keys, and create and update requests normalize key fields before sending profile data.

Changes: Payment profile secret-key handling

Layer / File(s) Summary
Reducer state and response normalization
src/reducers/payment_profiles/payment-profile-reducer.js, src/reducers/payment_profiles/__tests__/payment-profile-reducer.test.js
Reducer defaults now use key-presence flags. Added, received, and updated profiles share normalization that removes key values, converts null values to empty strings, and merges defaults.
Dialog key editing and layout
src/pages/tickets/payment-profile/components/payment-profile-dialog.js, src/pages/tickets/payment-profile/components/__tests__/payment-profile-dialog.test.js, src/i18n/en.json
The dialog uses blank secret-key fields and displays whether each key is set. Users can request replacement; canceling clears the form value. Fields use responsive grid sizes, and tests cover key replacement behavior.
Save request normalization
src/actions/ticket-actions.js, src/actions/__tests__/payment-profile-actions.test.js
Create and update requests use normalized profile data. Empty key values and presence flags are omitted. The update test checks that the newly entered key is sent and does not appear in dispatched actions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: smarcet, santipalenque

Merge Risk: Minimal · up to bf4ea

Payment profile secret keys are now write-only in the dialog, reducer state and save requests, with replacement support. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names two changes that appear in the changeset: removing secret keys from the payment profile reducer, and showing a new input to replace a set key (the SecretKeyField component with replace…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names two changes that appear in the changeset: removing secret keys from the payment profile reducer, and showing a new input to replace a set key (the SecretKeyField component with replace/cancel). The title covers the main points of the PR, though it lists two items in one line and the reducer change is only one part of the broader secret-key handling in the action, dialog, and tests.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0c3e96dc-4be0-466f-a05e-ae5953a2012d
Commits

Reviewing files that changed from the base of the PR and between 6466465 and bf4ea80.

Files selected for processing: 3

  • src/pages/tickets/payment-profile/components/info-tooltip.js
  • src/pages/tickets/payment-profile/components/payment-profile-dialog.js
  • src/pages/tickets/payment-profile/components/secret-key-field.js

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • Fix comments: Fix CodeRabbit comments on this PR

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
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.

2 participants