Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Billing: Update ChangePaymentMethod to use PaymentMethodSelector #49058

Merged

Conversation

sirbrillig
Copy link
Member

@sirbrillig sirbrillig commented Jan 20, 2021

Changes proposed in this Pull Request

This abstracts the payment method list and assignment code from ChangePaymentMethod into its own component called PaymentMethodSelector. The primary purpose of this is to enable reusing that component in other payment method forms like AddNewPaymentMethod.

Part of #48966

Depends on #49057

Screen Shot 2021-01-19 at 7 54 56 PM

Screen Shot 2021-01-19 at 7 55 26 PM

Testing instructions

  • Visit the subscription page for a purchase that already has a payment method assigned.
  • Click on the "Change payment method" button.
  • Verify that the list of payment methods appears.
  • Select the "new" credit card payment method, fill it in, and submit the form.
  • Verify that you are redirected to the subscription page with a success message.
  • Verify that the new payment method is created and assigned to the subscription.
  • Repeat the above steps but select an existing card and verify that everything works as before.

@sirbrillig sirbrillig requested a review from a team as a code owner January 20, 2021 00:33
@matticbot
Copy link
Contributor

@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 Jan 20, 2021
@sirbrillig sirbrillig added [Feature Group] WPCOM Store & Purchases All things billing on WordPress.com. This includes the backend store, plans, and billing management. Payment Methods [Estimate] 2 and removed [Feature Group] WPCOM Store & Purchases All things billing on WordPress.com. This includes the backend store, plans, and billing management. labels Jan 20, 2021
@sirbrillig sirbrillig self-assigned this Jan 20, 2021
@matticbot
Copy link
Contributor

matticbot commented Jan 20, 2021

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~30 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-main                   -38 B  (-0.0%)      -30 B  (-0.0%)
entry-login                  -38 B  (-0.0%)      -30 B  (-0.0%)
entry-gutenboarding          -38 B  (-0.0%)      -30 B  (-0.0%)
entry-domains-landing        -38 B  (-0.0%)      -30 B  (-0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~49 bytes removed 📉 [gzipped])

name            parsed_size           gzip_size
site-purchases       +946 B  (+0.1%)     +149 B  (+0.0%)
purchases            +946 B  (+0.1%)     +149 B  (+0.0%)
woocommerce          -413 B  (-0.0%)     -194 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@nbloomf
Copy link
Contributor

nbloomf commented Feb 1, 2021

Works as described in both the site level and account level contexts.

@nbloomf nbloomf added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 1, 2021
@sirbrillig sirbrillig force-pushed the update/change-payment-method-to-use-payment-method-selector branch from 06d0cbd to c0b66ed Compare February 1, 2021 21:50
@sirbrillig
Copy link
Member Author

sirbrillig commented Feb 1, 2021

Rebased after some changes to notifications landed. Testing it still works as far as I can tell.

@sirbrillig sirbrillig merged commit 5241c2e into trunk Feb 1, 2021
@sirbrillig sirbrillig deleted the update/change-payment-method-to-use-payment-method-selector branch February 1, 2021 23:27
@a8ci18n
Copy link

a8ci18n commented Feb 2, 2021

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/5487305

Thank you @sirbrillig for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Feb 11, 2021

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants