-
Notifications
You must be signed in to change notification settings - Fork 2k
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: Fill credit card form with card holder name upon loading Edit Card Details page #485
Conversation
92d52b7
to
39218b6
Compare
One bug; when I edit my card, the local copy of the data doesn't update, so when I navigate back to edit the card, the old details are displayed until they reload. It probably makes sense to fix this in a different PR. |
I like this idea, but we will need to store some data in the purchases endpoint for Paypal. Either way this is probably a v2 change :) |
It actually appears at the top :) |
Could you be more specific? If I update a card on the |
0c56195
to
dafb5c2
Compare
I agree, you can create follow up task. Code looks good 👍 |
} ); | ||
}; | ||
|
||
if ( this.props.card ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope we can get rid of this condition once we introduce loading placeholder :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, there is some delay with filling up form field with card holder name, but this should also be deprecated with loader implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This specific Javascript error has been fixed separately in #621. |
dafb5c2
to
ec7ca47
Compare
Ok I think this is good to merge, as long as we work on the placeholder state soon :) |
ec7ca47
to
d62403d
Compare
@scruffian: Sounds good. I can start implementing loading placeholders with this page tomorrow (see #275) :) |
… the Edit Card Details page The identifier is not used anywhere in this component.
Purchases: Fill credit card form with card holder name upon loading Edit Card Details page
* @param card | ||
* @param fields | ||
*/ | ||
mergeCard( card, fields: {} ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it looks like a default param. A few lines above it's called without 2nd param, so that makes perfect sense.
This pull request fixes #193 partially by updating the
Edit Card Details
page to display the name attached to the stored credit card associated to the current purchase when it loads:It makes use of the
Stored Cards
store that relies on the/me/stored-cards
API endpoint. We only fill in the form with the card holder name for the time being but we should probably display the country and the postal code as well - these are probably the only fields that won't be updated by users in 95% of the cases. It doesn't make sense to display the last four digits as well as the expiration date for the opposite reason.This pull request doesn't address disabling of input fields - this is handled as a separate issue in #260.
Testing instructions
Upgrade Now
button on thePlans
pageSecure Payment
page with fake credit card informationPurchases
pageManage Purchase
pagePayment Method
section shows the right credit card logo and last digitsEdit Payment Method
navigation link to display theEdit Card Details
pageUpdate Card
buttonManage Purchase
page reflects these changesBilling History
pageNotes
I think we should remove the country and postal code returned with the payment data in the
/me/purchases
endpoint and update the/me/stored-cards
endpoint to return it. That way everything is located in theStored Cards
store. What do you think?