Sha256: cebb10f6d0c2b029fb928eb468b2497948cdcb6689d8efc2247fa1e394f345ba
Contents?: true
Size: 1002 Bytes
Versions: 14
Compression:
Stored size: 1002 Bytes
Contents
window.Stripe = { createToken: function(creditCard, handler) { function isValidCardNumber(number) { var validCardNumbers = ['4242424242424242', '4242 4242 4242 4242']; return $.inArray(number, validCardNumbers) >= 0; } if (isValidCardNumber(creditCard.number)) { handler(200, { id: 123, card: { last4: 4242, brand: 'Visa', exp_month: '12', exp_year: '2018' } }); } else { handler(402, { error: { code: 'incorrect_number', message: 'Your card number is incorrect', param: 'number', type: 'card_error' } }); } }, cardType: function(value) { return 'Visa' }, setPublishableKey: function() {}, validateCardNumber: function(value) { return true; }, validateCVC: function(value) { return true; }, validateExpiry: function(value) { return true; } }; window.Stripe.card = { createToken: window.Stripe.createToken };
Version data entries
14 entries across 14 versions & 1 rubygems