credit-card

Determine credit card type by number?

[亡魂溺海] 提交于 2019-11-26 11:56:02
问题 Can credit card type be determined solely from the credit card number? Is this recommended or should we always ask client for the type of credit card they\'re using? I Googled about it and found this algorithm: http://cuinl.tripod.com/Tips/o-1.htm , is this reliable? 回答1: Yes, the site you mentioned is correct. Many sites, incl. Google Checkout I believe, rely on automatic detection of the card type. It's convenient, makes the UI less cluttered (one less input box) and saves time. Go ahead!

When is the Scan Credit Card option available on iOS8 Safari?

走远了吗. 提交于 2019-11-26 10:07:27
问题 So Safari offers Scan Credit Card feature on iOS8 with some credit card forms. My question is, how does Safari determine when to offer this option? So far I found that this option is available on Amazon and PayPal, but none of my credit card input forms were able to reproduce this behaviour. 回答1: After a bit of research with an iOS8 browser and Chrome emulation I figured it out partially. I know of some solutions, but I don't know for sure if there are other ways to do it. You'll have to

Formatting a UITextField for credit card input like (xxxx xxxx xxxx xxxx)

那年仲夏 提交于 2019-11-26 08:43:10
问题 I want to format a UITextField for entering a credit card number into such that it only allows digits to be entered and automatically inserts spaces so that the number is formatted like so: XXXX XXXX XXXX XXXX How can I do this? 回答1: If you're using Swift, go read my port of this answer for Swift 4 and use that instead. If you're in Objective-C... Firstly, to your UITextFieldDelegate , add these instance variables... NSString *previousTextFieldContent; UITextRange *previousSelection; ... and

What is the best way to validate a credit card in PHP?

喜你入骨 提交于 2019-11-26 06:14:33
问题 Given a credit card number and no additional information, what is the best way in PHP to determine whether or not it is a valid number? Right now I need something that will work with American Express, Discover, MasterCard, and Visa, but it might be helpful if it will also work with other types. 回答1: There are three parts to the validation of the card number: PATTERN - does it match an issuers pattern (e.g. VISA/Mastercard/etc.) CHECKSUM - does it actually check-sum (e.g. not just 13 random