braintree
Version:
A library for integrating with Braintree.
64 lines (52 loc) • 1.89 kB
JavaScript
//@ sourceMappingURL=credit_card.map
// Generated by CoffeeScript 1.6.1
var AttributeSetter, CreditCard,
__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 = (function(_super) {
__extends(CreditCard, _super);
CreditCard.CardType = {
AmEx: "American Express",
CarteBlanche: "Carte Blanche",
ChinaUnionPay: "China UnionPay",
DinersClubInternational: "Diners Club",
Discover: "Discover",
JCB: "JCB",
Laser: "Laser",
Maestro: "Maestro",
MasterCard: "MasterCard",
Solo: "Solo",
Switch: "Switch",
Visa: "Visa",
Unknown: "Unknown",
All: function() {
var all, key, value;
all = [];
for (key in this) {
value = this[key];
if (key !== 'All') {
all.push(value);
}
}
return all;
}
};
CreditCard.CustomerLocation = {
International: 'international',
US: 'us'
};
CreditCard.CardTypeIndicator = {
Yes: "Yes",
No: "No",
Unknown: "Unknown"
};
CreditCard.Prepaid = CreditCard.Commercial = CreditCard.Payroll = CreditCard.Healthcare = CreditCard.DurbinRegulated = CreditCard.Debit = CreditCard.CountryOfIssuance = CreditCard.IssuingBank = CreditCard.CardTypeIndicator;
function CreditCard(attributes) {
CreditCard.__super__.constructor.call(this, attributes);
this.maskedNumber = "" + this.bin + "******" + this.last4;
this.expirationDate = "" + this.expirationMonth + "/" + this.expirationYear;
}
return CreditCard;
})(AttributeSetter);
exports.CreditCard = CreditCard;