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

Purchases: Make credit card page more flexible #7537

Merged
merged 4 commits into from
Aug 18, 2016

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Aug 18, 2016

This is a follow up for #7484.

In this PR I added another couple of refactorings:

  • we have now 2 entry React components to distinguish Add Card Details (<AddCardDetails />) and Edit Card Details (<EditCardDetails />) pages
  • <PurchaseCardDetails /> was extracted and contains shared logic for Card components that operates on purchases
  • .../payment/edit url was updated to better reflect functionality of the page - .../payment/add

With that in place we should be ready to work on new flow for Connect for WooCommerce.

Testing.

  1. Go to Manage Purchases page (http://calypso.localhost:3000/purchases).
  2. Select a purchase paid with credit card.
  3. Click on Edit Payment Method link.
  4. You should see loading placeholder when page is loading (you can refresh a page if you missed loading step).
  5. When page is loaded you should see a form with a cardholder name provided.
  6. Play with the form to make sure it works as before.
  7. You can also try to click back button while validation is pending to make sure isMounted change is working properly. There should be no warnings on JS console complaining about incorrectsetState usage.
  8. Go back to Manage Purchases page.
  9. Pick a purchase paid with credits.
  10. Click on Add Payment Method link.
  11. You should see loading placeholder when page is loading (you can refresh a page if you missed loading step).
  12. When page is loaded you should see a form with no fields filled in.
  13. Play with the form to make sure it works as before.

Test live: https://calypso.live/?branch=update/improve-credit-card-page

@gziolo gziolo added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Janitorial [Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. labels Aug 18, 2016
@gziolo gziolo self-assigned this Aug 18, 2016
@gziolo
Copy link
Member Author

gziolo commented Aug 18, 2016

I'm receiving the following error when submitting a AUTH_DECLINE card:
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the CreditCardPage component.

@prettyboymp It's fixed now with 3105c04. We should do much better job when handling async request in Calypso. I guess it's wider issue.

@janm6k
Copy link
Contributor

janm6k commented Aug 18, 2016

Looks good 👍

@janm6k janm6k 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 Aug 18, 2016
@gziolo gziolo merged commit 44f8f05 into master Aug 18, 2016
@gziolo gziolo deleted the update/improve-credit-card-page branch August 18, 2016 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants