woocommerce / woocommerce-gateway-stripe

The official Stripe Payment Gateway for WooCommerce
https://wordpress.org/plugins/woocommerce-gateway-stripe/
229 stars 197 forks source link

[settings - payment methods management] Automatically refresh the list #1879

Open frosso opened 2 years ago

frosso commented 2 years ago

Description

Try to find a mechanism to automatically refresh the list of payment methods once a merchant updates it in Stripe. Ideally, the merchant wouldn't need to click the "update" button, but the list would update automatically if the settings page is open.

Please confirm feasibilty/full requirements with UX.

Screen Shot 2021-09-16 at 1 00 04 PM
ricardo commented 2 years ago

An update on this:

There might be a webhook event for when the capabilities change. Or we can check for when the account changed and clear the cache. This might be kinda hard to test, so we can perhaps use event triggering from the Stripe CLI.

Another point to consider is that this might not be necessary if the "refresh" action is embedded on the "pending capability" status pill, which is the idea here.

ricardo commented 2 years ago

Another update:

The "refresh" action was removed in https://github.com/woocommerce/woocommerce-gateway-stripe/pull/2143/commits/3f38a52ff890a124d20fbd01b09445375dfa5a41 and was replaced by an instruction to "check back soon".

The _transient_wcstripe_account_data_test transient which serves as the capabilities cache is set to expire in just 2 hours, so it's not a big deal to instruct the merchants to wait for the pending activation notice to disappear.