26 karma · joined Nov 30, 2012 (13y ago) · 12 submissions
comment 12y ago · link · parent
static bool IsValidLuhn(string numbers) { if (numbers == null) throw new ArgumentNullException("number", "number must have a value.");
var allNumbers = numbers .Where((c) => c >= '0' && c <= '9') .Reverse() .Select((c, i) => (i % 2 == 1) ? ((Convert.ToInt32(c) - 48) * 2).ToString() : c.ToString());
return allNumbers.Count() > 0 ? allNumbers.Aggregate((x, y) => x + y).Sum((c) => Convert.ToInt32(c) - 48) % 10 == 0 : false; }
Edit: Can sum one link me to HackerNews markdown?
comment 12y ago · link · parent
I think vasquez put an extra right angle bracket by mistake.
comment 13y ago · link · parent
comment 13y ago · link · parent
6.
Private Message. Secure communication, anyone, any device; NSA free.(privatemsg.matthew-dove.com ↗)
2 points · by 1337Coder · 13y ago · 4 comments
comment 13y ago · link · parent
A condition of this merchant account is that if someone issues a charge-back on their creditcard, if the merchant can't prove that the card owner brought the service/product then the funds are taken directly form their merchant account by the bank and then given back to the card-holder.
This is why anti-fraud systems are so important to merchants.
Case: I steal your creditcard, I buy a tv worth $10, 000. You notice this, and chargeback the merchant. The merchant has to pay you $10, 000 and he lost teh cost price of the tv he sold me (say $7, 000).
So by accepting your stolen card as payment, the merchant just lost $17, 000!
Source: I build payment gateways.