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

Allow cards to be saved via My Account #5237

Merged
merged 1 commit into from
Dec 6, 2022

Conversation

mdmoore
Copy link
Member

@mdmoore mdmoore commented Dec 2, 2022

Fixes #5116

Changes proposed in this Pull Request

When the UPE is enabled, upe.js is enqueued which attempts to take over submissions of the Add Payment Method form. Because we're using the legacy card element, an error is thrown when the card payment method isn't found in the gatewayUPEComponents array. Because the normal, non-UPE, checkout.js is still enqueued, we can continue relying on it to handle payment method creation for cards from the My Account page.

Testing instructions

  1. Enable the UPE in the WooCommerce Payments settings
  2. Navigate to My Account > Payment Methods > Add Payment Method
  3. Add a new credit card and verify that it was successful(no errors on page.)
  4. Add a new UPE method(SEPA) and verify that it was successful(no errors on page.)
  • Run npm run changelog to add a changelog file, choose patch to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.
  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Post merge

@mdmoore mdmoore requested review from a team and timur27 and removed request for a team December 2, 2022 21:53
@mdmoore mdmoore changed the title Save cards to be saved via My Account Allow cards to be saved via My Account Dec 2, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

Size Change: +26 B (0%)

Total Size: 1.09 MB

Filename Size Change
release/woocommerce-payments/dist/upe_checkout.js 20.1 kB +26 B (0%)
ℹ️ View Unchanged
Filename Size
release/woocommerce-payments/assets/css/admin.css 913 B
release/woocommerce-payments/assets/css/success.css 401 B
release/woocommerce-payments/dist/blocks-checkout.css 2.13 kB
release/woocommerce-payments/dist/blocks-checkout.js 23.8 kB
release/woocommerce-payments/dist/checkout.css 2.21 kB
release/woocommerce-payments/dist/checkout.js 14.7 kB
release/woocommerce-payments/dist/fp_agent.js 14 kB
release/woocommerce-payments/dist/index.css 36.1 kB
release/woocommerce-payments/dist/index.js 307 kB
release/woocommerce-payments/dist/multi-currency-analytics.js 771 B
release/woocommerce-payments/dist/multi-currency-switcher-block.js 56.1 kB
release/woocommerce-payments/dist/multi-currency.css 14.7 kB
release/woocommerce-payments/dist/multi-currency.js 72.5 kB
release/woocommerce-payments/dist/order.css 248 B
release/woocommerce-payments/dist/order.js 12.4 kB
release/woocommerce-payments/dist/payment-gateways.css 1.2 kB
release/woocommerce-payments/dist/payment-gateways.js 47 kB
release/woocommerce-payments/dist/payment-request.js 11.7 kB
release/woocommerce-payments/dist/platform-checkout-express-button.js 12.7 kB
release/woocommerce-payments/dist/platform-checkout.css 3.73 kB
release/woocommerce-payments/dist/platform-checkout.js 70.8 kB
release/woocommerce-payments/dist/settings.css 47.4 kB
release/woocommerce-payments/dist/settings.js 111 kB
release/woocommerce-payments/dist/subscription-edit-page.js 392 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.css 7.18 kB
release/woocommerce-payments/dist/subscription-product-onboarding-modal.js 12.6 kB
release/woocommerce-payments/dist/subscription-product-onboarding-toast.js 434 B
release/woocommerce-payments/dist/subscriptions-empty-state.css 298 B
release/woocommerce-payments/dist/subscriptions-empty-state.js 44.1 kB
release/woocommerce-payments/dist/tos.css 236 B
release/woocommerce-payments/dist/tos.js 15.5 kB
release/woocommerce-payments/dist/upe_checkout.css 2.21 kB
release/woocommerce-payments/dist/upe-blocks-checkout.css 2.13 kB
release/woocommerce-payments/dist/upe-blocks-checkout.js 26.2 kB
release/woocommerce-payments/includes/platform-checkout/assets/css/platform-checkout-express-button.css 247 B
release/woocommerce-payments/includes/subscriptions/assets/css/plugin-page.css 633 B
release/woocommerce-payments/includes/subscriptions/assets/js/plugin-page.js 355 B
release/woocommerce-payments/vendor/automattic/jetpack-admin-ui/src/css/jetpack-icon.css 224 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/i18n-loader.js 2.43 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/i18n-loader.js 1.01 kB
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/babel.config.js 160 B
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.css 2.27 kB
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.js 13.3 kB
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.rtl.css 2.27 kB
release/woocommerce-payments/vendor/automattic/jetpack-tracking/src/js/tracks-ajax.js 789 B
release/woocommerce-payments/vendor/automattic/jetpack-tracking/src/js/tracks-callables.js 925 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/about.css 1.2 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-order-statuses.css 403 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin.css 3.43 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/checkout.css 299 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/modal.css 742 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css 572 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/wcs-upgrade.css 411 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin-pointers.js 544 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin.js 8.97 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.js 6.8 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.min.js 3.83 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-coupon.js 544 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-subscription.js 2.35 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.js 22.1 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.min.js 11.6 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/payment-method-restrictions.js 1.29 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/wcs-meta-boxes-order.js 502 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/payment-methods.js 355 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/single-product.js 429 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/view-subscription.js 1.38 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/wcs-cart.js 387 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/modal.js 1.1 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/wcs-upgrade.js 1.27 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.css 392 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.js 3.06 kB

compressed-size-action

@frosso frosso linked an issue Dec 3, 2022 that may be closed by this pull request
Copy link
Contributor

@timur27 timur27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! Looks good and tests well 🚢

@mdmoore mdmoore merged commit 4e08ba3 into poc/upe-instances-multiplied Dec 6, 2022
@mdmoore mdmoore deleted the fix/5116-save-legacy-card branch December 6, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple UPE - Cannot add card payment method
2 participants