bitpay-sdk
Version:
Complete version of the NodeJS library for the new cryptographically secure BitPay API
30 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bill = void 0;
const Currency_1 = require("../../Currency");
const Item_1 = require("./Item");
const BitPayExceptionProvider_1 = require("../../Exceptions/BitPayExceptionProvider");
class Bill {
/**
* Constructor, create a minimal request Bill object.
*
* @param number A string for tracking purposes.
* @param currency The three digit currency type used to compute the bill's amount.
* @param email The email address of the receiver for this bill.
* @param items The list of itens to add to this bill.
*/
constructor(number, currency, email, items) {
this.number = number;
this.setCurrency(currency);
this.email = email;
this.items = items;
}
setCurrency(currency) {
if (!Currency_1.Currency.isValid(currency))
BitPayExceptionProvider_1.BitPayExceptionProvider.throwInvalidCurrencyException(currency);
this.currency = currency;
}
}
exports.Bill = Bill;
exports.default = Item_1.Item;
//# sourceMappingURL=Bill.js.map