UNPKG

braintree

Version:

A library for integrating with Braintree.

37 lines (28 loc) 1.19 kB
//@ sourceMappingURL=customer.map // Generated by CoffeeScript 1.6.1 var AttributeSetter, CreditCard, Customer, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; AttributeSetter = require('./attribute_setter').AttributeSetter; CreditCard = require('./credit_card').CreditCard; Customer = (function(_super) { __extends(Customer, _super); function Customer(attributes) { var cardAttributes; Customer.__super__.constructor.call(this, attributes); if (attributes.creditCards) { this.creditCards = (function() { var _i, _len, _ref, _results; _ref = attributes.creditCards; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { cardAttributes = _ref[_i]; _results.push(new CreditCard(cardAttributes)); } return _results; })(); } } return Customer; })(AttributeSetter); exports.Customer = Customer;