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

Version Path
fake_stripe-0.3.0 lib/fake_stripe/assets/v1.js
fake_stripe-0.2.0 lib/fake_stripe/assets/v1.js
fake_stripe-0.1.0 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.12 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.11 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.10.6 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.10.5 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.10.4 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.10.3 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.10.2 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.10.1 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.10 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.9 lib/fake_stripe/assets/v1.js
fake_stripe-0.0.8 lib/fake_stripe/assets/v1.js