8000 Add ability to mask card number by hernan · Pull Request #231 · jessepollak/card · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add ability to mask card number #231

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

Merged
merged 2 commits into from
Dec 3, 2016
Merged

Conversation

hernan
Copy link
Contributor
@hernan hernan commented Feb 17, 2016

Related to #179 I implemented masking the card number on user input, added as a filter for numberInput handler.

@jessepollak
Copy link
Owner

Thanks for your PR and sorry for the long delay — just catching up! I'm going to leave a few comments, but I'm excited to merge this feature in!

cardType = payment.fns.cardType(val)
numbers = val.split(' ')

if (cardType == 'amex' && (numbers.length == 3)) || numbers.length >= 4
Copy link
Owner

Choose a reason for hiding this comment

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

Can you explain why we have to add this exception for amex? I'm a little bit wary of adding card type specific code here and wonder whether we can come up with a general solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Jesse
The amex check isn't really necessary as I dont know much about card numbers and how many groups numbers can exists added amex check to make sure that my code will not break with other card type.
I made a quick check removing the cardType check and works without problems, but again I dont know all the details of card numbers.

@soullivaneuh
Copy link

Maybe the same can be done for the CVV?

@caiquecastro
Copy link
Contributor

Haven't this PR been merged yet?

@@ -183,7 +188,7 @@ $('form').card({
## Using with other javascript libraries

Card has wrappers that make it easy to use with other javascript libraries:

Choose a reason for hiding this comment

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

This should be done on a separated commit.

@BallisticPain
Copy link
Collaborator

@hernan Are you intending to remove the AMEX specific check since you said it works fine without it in there?

@hernan
Copy link
Contributor Author
hernan commented Nov 17, 2016

@BallisticPain adjusted the fix, please review.

@BallisticPain
Copy link
Collaborator

@hernan, please fix the latest conflict. I'll review right after. Sorry I missed your last comment to review.

@hernan
Copy link
Contributor Author
hernan commented Nov 29, 2016

Hi @BallisticPain is older than current master and don't see conflicts, I'm not sure how to proceed in this case to provide a correct commit, if you could guide me would be grat

@Paschoali
Copy link

@hernan Hi! Sorry if I am wrong, but you can remove all your changes on README.md file, backing it to original. Wait, are you working on branch master? Why? Anyway, if you back README.md to original (you can copy the README.md content from the server and paste on your file), update your branch with master branch from the server, later make your changes on README.md again and commit again, your branch will be synchronized with server and the approval of the PR will be easier.

@BallisticPain
Copy link
Collaborator
BallisticPain commented Dec 2, 2016

@hernan
I would imagine you have this repository set as an upstream remote, is that correct?
git remote -v will give you the answer to the above. If you don't have an upstream...
git remote add upstream https://github.com/jessepollak/card.git

When I have merge conflicts, I usually attempt to rebase the upstream branch onto mine. Below are the steps I would usually use to perform a rebase. Be sure you're on the master branch.

  1. git fetch upstream - Grabs remote code from the upstream.
  2. git rebase upstream/master - Adds upstream commits before your commits.
  3. Follow the instructions to fix any conflicts (should just be checking the conflicts in the README.md). Then run git rebase --continue
  4. At this point your master should be up to date with upstream/master, but you will need to force the push up to your remote master origin via git push --force origin master
  5. That will update this PR with your "fixed" branch.

Edit: Moved the upstream add to the first paragraph.

Thanks for your continued responses and diligence!
Jarvis

@hernan
Copy link
Contributor Author
hernan commented Dec 2, 2016

@BallisticPain your guide worked without a glitch! thank you very much, to patch should be fine now, please review.

@BallisticPain BallisticPain merged commit d22d62b into jessepollak:master Dec 3, 2016
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.

6 participants
0