Skip to content

Checkout: Add existing PayPal PPCP payment method#108571

Open
sirbrillig wants to merge 3 commits intotrunkfrom
add/existing-paypal-billing-agreement-checkout
Open

Checkout: Add existing PayPal PPCP payment method#108571
sirbrillig wants to merge 3 commits intotrunkfrom
add/existing-paypal-billing-agreement-checkout

Conversation

@sirbrillig
Copy link
Member

@sirbrillig sirbrillig commented Feb 6, 2026

Fixes https://linear.app/a8c/issue/SHILL-1609/allow-assigning-saved-paypal-agreement-to-an-existing-subscription-in

Proposed Changes

This PR adds a new "PayPal" payment method for existing saved billing agreements to checkout. This will allow selecting an existing billing agreement when making a checkout purchase rather than creating a new one.

Screenshot 2026-02-06 at 6 06 21 PM Screenshot 2026-02-06 at 6 29 50 PM

Note

This only adds the new payment method to checkout, not to purchase management.

Why are these changes being made?

In checkout when you are buying a free product (eg: a domain when you have a domain credit), you can assign an existing saved credit card to be attached to that purchase for future renewals. However, that is not an option for PayPal payment agreements. We need to make that an option. Required in order to make the "Assign a payment method later" not assign a payment method to bundled domains (see https://linear.app/a8c/issue/SHILL-29/assign-a-payment-method-later-option-for-free-purchases-in-checkout) because in order to remove that behavior, PayPal users will need a way to manually do what is currently happening automatically: selecting the same billing agreement for a new subscription.

Testing Instructions

  • Either make a purchase with PayPal or use an account with an existing purchase made using PayPal (the new PPCP version).
  • Add a product to your cart (it can be a renewal of the same product if you like) and visit checkout.
  • Verify that you see the saved PayPal billing agreement in the list of payment methods. Select it and complete checkout.
  • Verify the purchase was successful and that PayPal is assigned to that subscription.

@matticbot
Copy link
Contributor

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

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

  • agents-manager
  • help-center
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/existing-paypal-billing-agreement-checkout on your sandbox.

@sirbrillig sirbrillig force-pushed the add/existing-paypal-billing-agreement-checkout branch from 2f4b7b7 to 0d372ee Compare February 6, 2026 23:29
@sirbrillig sirbrillig marked this pull request as ready for review February 6, 2026 23:31
@sirbrillig sirbrillig requested review from a team as code owners February 6, 2026 23:31
@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 Feb 6, 2026
@sirbrillig sirbrillig self-assigned this Feb 6, 2026
Copy link
Contributor

@martian77 martian77 left a comment

Choose a reason for hiding this comment

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

I tried with my account, which has two different PayPal vault tokens in my payment methods. I didn't see an option to assign an existing one when I went to checkout a renewal.

I'm not sure if I got something wrong in the testing? I tried to checkout a renewal for a personal plan.

Image

(We don't actually use billing agreements any more, just vaulted payment methods or vault tokens, so your comment about that made me think we were using the old integration. It's a pretty minor nitpick!)

} ): PaymentMethod[] {
const onlyStoredPayPalPPCP = storedPaymentMethods.filter( isPaymentMethodPayPalPPCP );

// Memoize the PayPal agreements by comparing their stored_details_id values, in case the
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can we change this language? We use vaulted tokens rather than billing agreements now. This might confuse.

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.

3 participants