Skip to content

feat: support tokenize-only flow in dynamic checkout#271

Open
jakubjasinsky wants to merge 2 commits into
masterfrom
jakub-dc-tokenize-only-flow
Open

feat: support tokenize-only flow in dynamic checkout#271
jakubjasinsky wants to merge 2 commits into
masterfrom
jakub-dc-tokenize-only-flow

Conversation

@jakubjasinsky

@jakubjasinsky jakubjasinsky commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds client-side support for the tokenize-only verification flow (POROK-574). When a verification invoice's workflow has invoice_verification_enable_tokenize_only_flow enabled, the payment-methods response contains a single card marked tokenize_only: true — Dynamic Checkout now adapts the card UI and payment options accordingly.

Changes

  • Add optional tokenize_only field to the Card API type (absent on the wire means false — bare proto3 bool)
  • When tokenize_only is set on the card:
    • Pay button shows localized "Tokenize payment" instead of "Pay {amount} {currency}" (merchant payButtonText override still takes precedence)
    • "Save for future payments" checkbox is hidden (saving is implicit)
    • save_source: true is forced on the capture call
    • Saved payment methods (card_customer_token / apm_customer_token) are filtered out client-side, which also hides the manage-methods button
  • Add tokenize-payment-button-text locale key to all 14 DC locales

Impact

  • No behavior change for existing invoices: every change is gated behind a field absent from all current API responses
  • Payment flow is unchanged (tokenizePOST /invoices/{id}/capture incl. 3DS) — only the request options and UI differ

Additional Context

  • Backend contract: router plan porok-574-dynamiccheckout-tokenize-only-flow-plan.md; the API repo already serializes the field, router CRUD + modifier work is still pending
  • Saved-methods filtering is defensive — the backend already strips them for verification invoices
  • Related: dashboard toggle PR (jakub-dc-tokenize-only-flow-toggle in dashboard-next), @processout/types-api v5.35.0

Copilot AI review requested due to automatic review settings July 22, 2026 09:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for a “tokenize-only” card flow in Dynamic Checkout by introducing a tokenize_only flag on card payment methods and adapting the UI/behavior accordingly.

Changes:

  • Adds a tokenize_only flag to the Card API type and uses it to drive tokenize-only behavior.
  • Updates the card payment method UI to hide “save for future” and change the pay button label when tokenize-only is enabled.
  • Hides saved payment methods in the payment-method list when a tokenize-only card method is present, and adds translations for the new button label key.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/dynamic-checkout/views/payment-methods.ts Hides saved payment methods when a tokenize-only card payment method is available.
src/dynamic-checkout/types/api.ts Extends the Card type with an optional tokenize_only flag.
src/dynamic-checkout/payment-methods/card.ts Adjusts card flow to force saving, hide save UI, and use a tokenize-specific button label.
src/dynamic-checkout/locales/en.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/fr.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/de.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/es.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/it.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/pt.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/pl.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/nb.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/fi.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/ja.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/ko.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/ta.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/vi.ts Adds translation for tokenize-payment-button-text.
src/dynamic-checkout/locales/ar.ts Adds translation for tokenize-payment-button-text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants