Checkout: Add existing PayPal PPCP payment method#108571
Checkout: Add existing PayPal PPCP payment method#108571sirbrillig wants to merge 3 commits intotrunkfrom
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
2f4b7b7 to
0d372ee
Compare
martian77
left a comment
There was a problem hiding this comment.
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.
(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 |
There was a problem hiding this comment.
Nit: Can we change this language? We use vaulted tokens rather than billing agreements now. This might confuse.
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.
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