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: Replace PaymentMethodForm #48966

Closed
sirbrillig opened this issue Jan 15, 2021 · 3 comments · Fixed by #50491
Closed

Billing: Replace PaymentMethodForm #48966

sirbrillig opened this issue Jan 15, 2021 · 3 comments · Fixed by #50491
Assignees
Labels
[Feature Group] WPCOM Store & Purchases All things billing on WordPress.com. This includes the backend store, plans, and billing management. [Type] Task

Comments

@sirbrillig
Copy link
Member

sirbrillig commented Jan 15, 2021

Recently we've modified ChangePaymentMethod to replace PaymentMethodForm (which just displays a set of credit card fields) with ChangePaymentMethodList that uses the composite-checkout package to allow choosing between multiple payment methods (existing cards, new cards, or PayPal).

The AddPaymentMethod component and both AddNewPaymentMethod components (one for site-level and one for account-level), as well as the WooCommerce AddCardDialog (which may not be used...), all used to add a payment method without an attached subscription, still use PaymentMethodForm. We could modify these to use ChangePaymentMethodList as well, configured to hide existing cards and PayPal (since we do not support unattached PayPal billing agreements at the moment and you cannot "add" an existing card).

The advantage of using a single component is that we will be more easily able to update it with future improvements. Notably, we'd like to add the ability to choose if a payment method should be assigned to one or multiple subscriptions (currently the components mentioned above assign the new payment method to all subscriptions).

@sirbrillig
Copy link
Member Author

#49059 Will convert the account-level AddNewPaymentMethod component.

After that is merged, I'd like to see if it's possible to convert the site-level AddNewPaymentMethod to use the same component, in the same way that we share ChangePaymentMethod between account and site-level.

Finally three more things will need to be done:

We'll need to convert AddPaymentMethod (I can't remember how to get there) or, better still, also change it to use the same AddNewPaymentMethod component mentioned above.

We'll need to convert the AddCardDialog to use the new component.

Finally we'll be able to remove PaymentMethodForm.

@sirbrillig
Copy link
Member Author

#49897 converts the "add payment method" site-level form. That leaves the WooCommerce shipping labels system as the only place still using PaymentMethodForm.

@sirbrillig
Copy link
Member Author

When #48421 is closed, we can removed PaymentMethodForm and CreditCardFormFields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] WPCOM Store & Purchases All things billing on WordPress.com. This includes the backend store, plans, and billing management. [Type] Task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants