Skip to content

Render A4A payment notice CTAs#111851

Open
cleacos wants to merge 1 commit into
trunkfrom
a4a/payment-notice-context-messages-calypso
Open

Render A4A payment notice CTAs#111851
cleacos wants to merge 1 commit into
trunkfrom
a4a/payment-notice-context-messages-calypso

Conversation

@cleacos

@cleacos cleacos commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Part of A4A-2583

Proposed Changes

This PR updates the A4A payment-risk banner to render CTA labels and URLs from the backend payment_notice payload.

  • Add primary and secondary CTA fields to the A4A payment notice type.
  • Use backend-provided CTA labels and links in the banner.
  • Render a secondary CTA only when the backend provides one.
  • Keep legacy action_label and action_url as primary CTA fallbacks.
  • Avoid showing the old update-payment-method fallback for notices where the current user cannot manage the payment method.
  • Keep the existing feature flag and title/content fallback behavior.

Why are these changes being made?

The WPCOM agency endpoint now returns contextual payment-risk notices for agency-owned purchases and referred client purchases. Calypso needs to display the matching CTA copy and destination so agencies know whether to update their own payment method or send instructions to a client.

Testing Instructions

  • Check the code changes.
  • Open the A4A overview page with the a4a-payment-risk-notice-banner flag enabled and a payment notice payload.
  • Verify agency-owned notices show the update-payment-method CTA and billing FAQ CTA.
  • Verify referral-agency notices show only the client-instructions CTA.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

Use backend-provided primary and secondary action labels and URLs in the A4A payment-risk banner while preserving legacy action fields as primary CTA fallbacks. Avoid rendering the update-payment-method fallback for notices where the current user cannot manage the payment method.

Validation: focused payment-risk banner Jest test, targeted ESLint, git diff --check, typecheck-client, and Playwright smoke check with mocked referral notice data.
@cleacos cleacos self-assigned this Jun 19, 2026
@cleacos cleacos requested a review from a team June 19, 2026 18:45
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 19, 2026
@matticbot

Copy link
Copy Markdown
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug a4a/payment-notice-context-messages-calypso on your sandbox.

@cleacos cleacos marked this pull request as ready for review June 19, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants