PayPal Payments abilities: register button reads via Registrar#48766
PayPal Payments abilities: register button reads via Registrar#48766enejb wants to merge 1 commit into
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so: 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage Summary1 file is newly checked for coverage.
|
Summary
jetpack-paypal-payments/list-buttonsability to thepackages/paypal-paymentspackage, exposing PayPal Simple Payments buttons (jp_pay_productposts) through the WordPress Abilities API.list-buttonsacceptsstatus(publish/draft/all),search,page,per_page(1-100), andbutton_id(single-button short-circuit so a separateget-buttonreader isn't needed). Output:{ id, title, price, currency, recipient_email, button_image_url, edit_url, status, created_at }.create-button/update-button/delete-buttonare deliberately deferred.packages/paypal-payments/actions.phpand gated behindRegistrar::init()'sjetpack_wp_abilities_enabledfilter (default false), so the abilities surface in both the standalone PayPal Payment Buttons plugin and Jetpack core consumers, but rollout stays opt-in per site.current_user_can( 'edit_posts' ), matching thejp_pay_productCPT's capability map.packages/paypal-payments; plugin is a thin wrapper) and §2.10 (gated registrar pattern).Test plan
composer phpunit -- --filter PayPal_Payments_Abilities_Test— 19 tests, 43 assertions, all green.jetpack_wp_abilities_enabledflipped totrue) thatGET /wp-json/wp-abilities/v1/abilities/jetpack-paypal-payments/list-buttonsreturns the expected entries for an editor user.