nativescript-payments
Version:
A NativeScript plugin for in-app payments
40 lines • 1.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var item_common_1 = require("./item.common");
var Item = (function (_super) {
__extends(Item, _super);
function Item(nativeValue) {
var _this = _super.call(this, nativeValue) || this;
var formatter = NSNumberFormatter.alloc().init();
formatter.numberStyle = 2;
formatter.locale = nativeValue.priceLocale;
_this.itemId = nativeValue.productIdentifier;
_this.localizedDescription = nativeValue.localizedDescription;
_this.localizedTitle = nativeValue.localizedTitle;
_this.priceAmount = nativeValue.price.doubleValue;
_this.priceFormatted = formatter.stringFromNumber(nativeValue.price);
_this.priceCurrencyCode = nativeValue.priceLocale.objectForKey(NSLocaleCurrencyCode);
return _this;
}
Object.defineProperty(Item.prototype, "debug", {
get: function () {
if (this.nativeValue) {
var temp = {};
for (var i in this.nativeValue) {
if (this.nativeValue[i] != null) {
temp[i] = this.nativeValue[i];
}
}
return JSON.stringify(temp);
}
else {
return null;
}
},
enumerable: true,
configurable: true
});
return Item;
}(item_common_1.BaseItem));
exports.Item = Item;
//# sourceMappingURL=item.ios.js.map