Skip to content

[YOLO-3177] feat(react): add notes prop to Checkout for custom label + placeholder#1412

Open
lalcantara-godaddy wants to merge 1 commit into
godaddy:mainfrom
lalcantara-godaddy:yolo-3177
Open

[YOLO-3177] feat(react): add notes prop to Checkout for custom label + placeholder#1412
lalcantara-godaddy wants to merge 1 commit into
godaddy:mainfrom
lalcantara-godaddy:yolo-3177

Conversation

@lalcantara-godaddy

@lalcantara-godaddy lalcantara-godaddy commented Jul 21, 2026

Copy link
Copy Markdown

Summary

The checkout notes-collection field renders a fixed label (t.general.notes → "Notes") and placeholder (t.shipping.notesPlaceholder → "Notes or special instructions"), both sourced from localization with no per-checkout override. Consumers that need a custom notes label/placeholder (e.g. pay links surfacing a merchant-configured notes title) had no clean way to set them — the only knobs were the global localization prop or checkout.form.notes.* target injection, which can't cleanly replace the section header or touch the placeholder.

TLDR: Support existing Notes feature for invoices and paylinks

Changeset

  • Changeset added (docs)

Changes

  • CheckoutProps: new optional notes?: { label?: string; placeholder?: string }.
  • Threaded through CheckoutForm to both <NotesForm /> render sites and the standalone notes section header.
  • NotesForm: accepts optional label / placeholder props.
    • label ?? t.general.notes
    • placeholder ?? t.shipping.notesPlaceholder
    • Uses ?? (not ||) so an explicit empty string renders no placeholder, while undefined keeps the localized default.
  • Standalone notes section header title now resolves to notes?.label ?? t.general.notes.
  • CheckoutSectionHeader is unchanged — it already accepts title.

Backward compatibility

Fully backward compatible. When notes is omitted (or its fields are undefined), label and placeholder fall back to the existing localization strings — identical to current behavior. No other section is affected.

Tests

Added cases to checkout-validation.test.tsx covering:

  • custom label + placeholder render on the standalone notes field/header
  • empty-string placeholder → no placeholder attribute
  • omitted override → localized fallback ("Notes" / "Notes or special instructions")

All notes-UI tests pass (12/12).

Usage

<Checkout
  session={session}
  notes={{ label: "Gift message", placeholder: "" }} // "" => no placeholder
/>

Test Plan

Screenshot 2026-07-21 at 11 10 06 AM

Data:

"payLink": {
        "checkoutUrlId": "6a88eb26-c217-4a68-9b1c-eb192a13052d",
        "urlType": "P",
        "title": "Basic Notes",
        "description": "this is the description area",
        "picture": "//isteam.test-wsimg.com/ip/54229bbe-db9b-4c69-bb2b-331c1916443e/efCo3JY.png",
        "amount": 10000,
        "currency": "USD",
        "isCustomPrice": false,
        "order": {},
        "metadata": {
            "notes": {
                "collectNotes": true,
                "isNotesRequired": false,
                "notesFieldTitle": "Notes"
            }
        }
    }
Screenshot 2026-07-21 at 2 10 14 PM

@lalcantara-godaddy
lalcantara-godaddy requested a review from a team as a code owner July 21, 2026 16:12
@changeset-bot

changeset-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7d456d3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@godaddy/react Patch
nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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