woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
62 stars 47 forks source link

Disable vaulting settings when feature is not available to merchant #151

Closed jorgeatorres closed 3 years ago

jorgeatorres commented 3 years ago

Moved from #147

Given the vaulting features can only be added to a merchant's account via onboarding, all vaulting-related options in the plugin should remain turned off (and disabled) until the merchant has the relevant scopes in their access token (https://uri.paypal.com/services/vault/payment-tokens/readwrite for instance). Until that happens, we should point merchants to the onboarding via a note around the settings or something.

Example:

{ "scope": "https://uri.paypal.com/services/invoicing https://uri.paypal.com/services/vault/payment-tokens/read https://uri.paypal.com/services/disputes/read-buyer https://uri.paypal.com/services/payments/realtimepayment https://uri.paypal.com/services/disputes/update-seller https://uri.paypal.com/services/payments/payment/authcapture openid https://uri.paypal.com/services/disputes/read-seller Braintree:Vault https://uri.paypal.com/services/payments/refund https://api.paypal.com/v1/vault/credit-card https://api.paypal.com/v1/payments/. https://uri.paypal.com/services/reporting/search/read https://uri.paypal.com/services/payments/initiatepayment https://uri.paypal.com/payments/payouts https://uri.paypal.com/services/vault/payment-tokens/readwrite https://api.paypal.com/v1/vault/credit-card/. https://uri.paypal.com/services/subscriptions https://uri.paypal.com/services/applications/webhooks", "access_token": "...", "token_type": "Bearer", ... }

Acceptance Criteria

Scenario Vault setting available Given Vault is enabled in Sandbox / App feature options / Accept payments / Advanced options. vault-enabled When I visit Settings page. Then I should see the setting able to be activated.

Scenario Vault setting unavailable Given Vault is NOT enabled in Sandbox / App feature options / Accept payments / Advanced options. When I visit Settings page. Then I should see the setting completely disabled.

jorgeatorres commented 3 years ago

Fixed in #150.